Comparison with Confidence Intervals
Explore how to build and interpret confidence intervals alongside hypothesis tests using the infer package in R. This lesson teaches you to create bootstrap distributions, visualize intervals, and understand the relationship between confidence intervals and hypothesis testing through a unified framework.
We'll cover the following...
One of the great things about the infer package is that we can jump seamlessly between conducting hypothesis tests and constructing confidence intervals with minimal changes! Recall the code from the previous section that creates the null distribution, which in turn is needed to compute the
To create the corresponding bootstrap distribution needed to construct a 95% confidence interval hypothesize() step because we’re no longer assuming a null hypothesis hypothesize() line of code. Second, we switch the type of resampling in the generate() step to bootstrap instead of permute.
Using this bootstrap_distribution, let’s first compute the percentile-based confidence intervals:
Using our shorthand interpretation for 95% confidence intervals, we’re 95% confident that the true difference in population proportions