Get startedGet started for free

Generating from H0

Imagine that when reading the newspaper, you come across someone who makes the following claim: "3/4 of all Americans believe in life after death". This can be interpreted as a point null hypothesis that the population proportion has a value of 0.75.

Use this hypothesis to generate a single dataset to explore.

This exercise is part of the course

Inference for Categorical Data in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Generate one dataset under H0
sim1 <- gss2016 %>%
  # Specify the response and success
  ___(response = ___, success = ___) %>%
  # Hypothesize the null value of p
  ___(null = ___, p = ___) %>%
  # Generate a single simulated dataset
  ___(reps = ___, type = ___)

# See the result
sim1
Edit and Run Code