Resource for full examples in infer

https://infer.netlify.app/articles/observed_stat_examples.html

Clone a repo + start a new project

Clone the appex-12 repo on GitHub and start a new project in RStudio.

We will live-code together, and then you must complete the remainder of this Application Exercise on your own!

Data

We will continue working with the Asheville Airbnb data.

library(tidyverse)
library(infer)
asheville <- read_csv("data/asheville.csv")

LIVE CODE TOGETHER!

Exercise 1

Suppose you are interested in whether at least half of the Airbnb listings in Asheville are more than $50 per guest per night. What would be your null and alternative hypotheses? There are two options!

Option 1

Option 2

Exercise 2

Simulate the null distribution to test your hypotheses. You can use 1000 reps for the in-class exercise.

Option 1

# don't forget to set a seed! 

Option 2

#create variable to track price
# don't forget to set a seed! 

Exercise 3

What was your p-value? What decision do you make with respect to your hypotheses, and what conclusion do you make in the context of the research problem?

Option 1

#calculate observed statistic


# obtain p-value

Option 2

#calculate observed statistic


# obtain p-value

YOUR TURN!

Exercise 4

Suppose you are interested in whether at least half of listings have a price per guest per night less than $50. How would your null and alternative hypotheses change in this case? Carry out the appropriate hypothesis test (Option 1 and/or Option 2 above), and report your p-value, decision, and conclusion in context of the research problem. Use a seed of 1234 to conduct this hypothesis test.

\(H_0\):

\(H_a\):

# your code here!