Clone a repo + start a new project

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!

LIVE CODE

Exercise 1: discuss with someone next to you

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.

  1. \(H_0: \mu = 80 \text{ vs. }H_a: \mu \neq 80\)
  2. \(H_0: \mu = 80 \text{ vs. }H_a: \mu < 80\)
  3. \(H_0: \mu = 80 \text{ vs. }H_a: \mu > 80\)
  4. \(H_0: \bar{x} = 80 \text{ vs. }H_a: \bar{x} \neq 80\)
  5. \(H_0: \bar{x} = 80 \text{ vs. }H_a: \bar{x} < 80\)
  6. \(H_0: \bar{x} = 80 \text{ vs. }H_a: \bar{x} > 80\)

Exercise 2

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 # %>%

Exercise 3

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 # %>%

Exercise 4

Use the p-value from Exercise 3 to make your conclusion using a significance level of 0.05. Remember, the conclusion has 3 components

YOUR TURN!

Exercise 5

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.

  1. State your hypotheses (in words is fine):
# ii) generate null distribution
# iii) obtain p-value
  1. Conclusion: