Exercise

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

Instructions

**50 XP**

##### Possible Answers

- Since both p-values are above 0.05, we fail to reject the hypotheses that both military spending and spending on space exploration are independent of political party.
- The data set is consistent with the hypothesis that there is no relationship between political party and space exploration spending, but does suggestion a relationship between party and spending on the military.
- The data set is inconsistent with the hypothesis that there is no relationship between both military spending and party as well as spending for space exploration and party.
- The data set is consistent with the hypothesis that there is no relationship between political party and military spending, but does suggestion a relationship between party and spending on space exploration.