Comparing randomization CIs and t-based CIs

As with hypothesis testing, if technical conditions hold (technical conditions are discussed more in the next chapter), the CI created for the slope parameter in the t-distribution setting should be in line with the CI created using bootstrapping. Create a CI for the slope parameter and compare it to the one created using the bootstrap percentile interval from the previous chapter.

Note that the bootstrap and t-intervals will not be exactly the same because they use different computational steps to arrive at the interval estimate.

This exercise is part of the course

Inference for Linear Regression in R

View Course

Hands-on interactive exercise

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

alpha <- 0.05

# Calculate the confidence level
confidence_level <- ___

# Calculate lower percentile cutoff
p_lower <- ___

# ... and the upper one
p_upper <- ___