1. Learn
  2. /
  3. Courses
  4. /
  5. Inference for Linear Regression in R

Connected

Exercise

CI using t-theory

In previous courses, you have created confidence intervals with the formula of statistic plus/minus some number of standard errors. With bootstrapping, we typically use two standard errors. With t-based theory, we use the specific t-multiplier.

Create a CI for the slope parameter using both the default tidy() call as well as mutate() to calculate the confidence interval bounds explicitly. Note that the two methods should give exactly the same CI values because they are using the same computations.

alpha has been set to 0.05 and the degrees of freedom of the twins dataset is given to you.

Instructions 1/2

undefined XP
    1
    2
  • Calculate the confidence level as one minus alpha.
  • Calculate the upper percentile cutoff from alpha.
  • Calculate the critical value from the inverse cumulative density function of the t-distribution, qt(). Pass it the upper percentile cutoff and the degrees of freedom.