Clone the appex-11 repo on GitHub and start a new project in RStudio.
We will be using the asheville dataset we saw in class
last week, which contains data about Airbnb rates in Asheville, NC. You
may load in the dataset with the following code (be sure to set
eval to be TRUE in the following R
chunks!):
library(tidyverse)
library(infer)
We will begin with Professor Tang demo-ing code. Then we will live-code together, and then you must complete the remainder of the Application Exercise on your own!
Suppose you are interested in whether the mean price per guest per night is actually less than $80. Choose the correct null and alternative hypotheses.
Let’s use simulation-based methods to conduct the hypothesis test specified in Exercise 1. We’ll start by generating the null distribution.
Fill in the code and uncomment the lines below to generate the null distribution.
set.seed(101)
null_dist <- asheville # %>%
Fill in the code and uncomment the lines below to calculate the p-value using the null distribution from Exercise 2.
mean_ppg <- asheville # %>%
null_dist <- asheville # %>%
Use the p-value from Exercise 3 to make your conclusion using a significance level of 0.05. Remember, the conclusion has 3 components
Suppose you are interested in whether the median price per guest per night is equal to or less than $80. Carry out a similar analysis to that undertaken in Exercises 1 - 4 to test these hypotheses.
# ii) generate null distribution
# iii) obtain p-value