Get startedGet started for free

Is the data consistent with the model?

In general, it's a good idea to use two-tailed p-values, which you have calculated like this:

# Compute two-tailed p-value
null %>%
  summarize(pval = 2 * mean(stat <= d_hat))

In the case of the chi-squared, however, you compute only the right tail, which makes it a one-tailed test. This is the tail with statistics that are more common when the hypothesis of independence is false.

Using the objects that you created in the previous exercise (null_spac, null_arms, chi_obs_spac, and chi_obs_arms), compute the p-values of these two hypothesis tests and use them to select the correct answer below. Note that you'll have to tweak the code above to be sure to include only the right (greater than) tail in your p-values.

This exercise is part of the course

Inference for Categorical Data in R

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise