Constructing the Confidence Interval with MythBusters Yawn

Learn about constructing the confidence interval.

Let’s first construct the bootstrap distribution for p^seed\hat{p}_{seed}p^control\hat{p}_{control} and then use this to construct 95% confidence intervals for p^seed\hat{p}_{seed}p^control\hat{p}_{control}. We’ll do this using the infer workflow again. However, because the difference in proportions is a new scenario for inference, we’ll need to use some new arguments in the infer functions along the way.

Specify variables

Let’s take our mythbusters_yawn data frame and specify() which variables are of interest using the y ~ x formula interface where:

  • Our response variable is yawn: whether or not a participant yawned. It has levels "yes" and "no".

  • The explanatory variable is group: whether or not a participant was exposed to yawning. It has levels "seed" (exposed to yawning) and "control" (not exposed to yawning).

Get hands-on with 1200+ tech skills courses.