mindstair

Home / Courses / Statistics 2 / Unit 5

Statistics 2 Unit 5: Simple Linear Regression Inference

Regression inference asks whether a straight-line relationship seen in a sample reflects a real relationship in the population, and how precisely we can estimate it. You will test and estimate slopes, read regression output, check conditions, and build confidence and prediction intervals.

Covers: The population regression model, Least-squares estimates and residuals, t test and confidence interval for the slope, R², correlation and the regression ANOVA, Conditions and residual plots, Confidence vs prediction intervals

Study guide

The simple linear regression model says that for each x, the response y is normally distributed around a mean that falls on a line: μ_y = β₀ + β₁x, with the same standard deviation σ at every x. The least-squares line ŷ = b₀ + b₁x estimates that population line, with b₁ = r(s_y/s_x) and b₀ = ȳ − b₁x̄; it always passes through (x̄, ȳ). Residuals, y − ŷ, estimate the random errors, and their standard deviation s = √(SSE/(n − 2)) estimates σ. Two parameters are estimated, so inference uses n − 2 degrees of freedom.

The key question is usually whether β₁ = 0, which would mean the mean of y does not change with x. The test statistic is t = b₁/SE(b₁) with n − 2 df, and a confidence interval for the slope is b₁ ± t*·SE(b₁). Software reports both b₁ and SE(b₁); you rarely compute SE by hand, but its formula, SE(b₁) = s/(s_x√(n − 1)), explains a lot: the slope is estimated more precisely when residual scatter is small, n is large, and the x values are spread out. Interpret the slope in context and in the units of the data, as an average change in y per unit of x.

Regression also has an ANOVA table. Total variation SST splits into SSR, explained by the line, and SSE, left in the residuals. R² = SSR/SST is the fraction of variation in y explained by the linear relationship, and in simple regression R² = r². The F statistic MSR/MSE has (1, n − 2) df and equals t² for the slope, so the F test and the two-sided t test agree. The test of zero correlation, t = r√(n − 2)/√(1 − r²), is also the same test. With huge samples, tiny correlations become significant, so always look at R² and the size of the slope.

Inference requires the LINE conditions: the mean of y is Linear in x, errors are Independent, errors are Normal, and errors have Equal variance. Check them with a residual plot (residuals versus x or ŷ) and a histogram or normal plot of residuals. Curvature signals non-linearity; a fan shape signals unequal variance; patterns over time suggest dependence. Watch also for influential points: an observation with an extreme x value has high leverage and can drag the line toward itself, sometimes creating or hiding a significant slope. Fit with and without such points and report what changes.

To estimate the mean response at a particular x*, use a confidence interval ŷ ± t*·s√(1/n + (x* − x̄)²/((n − 1)s_x²)). To predict a single new observation, use a prediction interval, which adds 1 inside the square root to account for individual scatter: ŷ ± t*·s√(1 + 1/n + (x* − x̄)²/((n − 1)s_x²)). Both intervals are narrowest at x̄ and widen as x* moves away, because slope uncertainty matters more far from the center. The prediction interval never shrinks below about ±t*·s, however large n is. Avoid extrapolating beyond the range of observed x values.

Key ideas

Formulas and rules

b₁ = r·s_y/s_x; b₀ = ȳ − b₁x̄
s = √(SSE/(n − 2))
t = b₁/SE(b₁), df = n − 2; CI: b₁ ± t*·SE(b₁)
SE(b₁) = s/(s_x√(n − 1))
R² = SSR/SST = r²; F = MSR/MSE = t²
CI for mean: ŷ ± t*s√(1/n + (x* − x̄)²/((n − 1)s_x²)); PI adds 1 under the root

Common mistakes

Before the test, make sure you can

Words to know

Population regression line
μ_y = β₀ + β₁x, the true mean of y at each x.
Least-squares line
The line ŷ = b₀ + b₁x that minimizes the sum of squared residuals.
Residual
Observed y minus predicted ŷ.
Regression standard error s
√(SSE/(n − 2)); the typical size of a residual and the estimate of σ.
SE of the slope
s/(s_x√(n − 1)), the standard error of b₁.
Slope t test
t = b₁/SE(b₁) with n − 2 df, testing H₀: β₁ = 0.
R²
SSR/SST, the fraction of variation in y explained by the linear model.
SSR
Regression sum of squares: variation in y explained by the fitted line.
Residual plot
A plot of residuals against x or ŷ used to check linearity and equal variance.
LINE conditions
Linear mean, Independent errors, Normal errors, Equal variance.
Leverage
How far an observation's x value is from x̄; high leverage gives it potential to move the line.
Influential point
An observation whose removal noticeably changes the slope or conclusions.
Confidence interval for mean response
An interval for the average y among all individuals with a given x.
Prediction interval
An interval for one new individual's y at a given x; wider than the CI for the mean.
Extrapolation
Predicting y for x values outside the range of the data.

Sample practice questions

30 more questions like these, from level 1 to 5, are in the practice set.

Question 1 (level 1)

In the simple linear regression model μ_y = β₀ + β₁x, the parameter β₁ represents:

  1. The standard deviation of the y values around the fitted line
  2. The value of y when x equals its mean
  3. The correlation between x and y in the population
  4. The change in the mean of y for each one-unit increase in x
Show the answer and steps

Answer: D) The change in the mean of y for each one-unit increase in x

  1. β₁ is the population slope.
  2. It gives how much the mean response changes per unit of x.
  3. The spread around the line is σ, and correlation is a separate, unit-free measure.
Question 2 (level 1)

The standard t test for a linear relationship in simple regression tests:

  1. H₀: b₁ = 0
  2. H₀: r = 1
  3. H₀: β₁ = 0
  4. H₀: β₀ = 0
Show the answer and steps

Answer: C) H₀: β₁ = 0

  1. If β₁ = 0, the mean of y does not change with x.
  2. Hypotheses are about the population slope β₁, not the sample slope b₁.
  3. Rejecting H₀ gives evidence of a linear relationship.
Question 3 (level 3)

For n = 20 houses, the slope of price ($1,000s) on lot size (1,000 sq ft) is 2.4 with SE 0.8. What is the 95% confidence interval for β₁?

  1. (1.60, 3.20)
  2. (0.72, 4.08)
  3. (0.73, 4.07) with 19 df
  4. (0.83, 3.97)
Show the answer and steps

Answer: B) (0.72, 4.08)

  1. df = 20 − 2 = 18; t* = 2.101.
  2. Margin = 2.101 × 0.8 = 1.68.
  3. 2.4 ± 1.68 = (0.72, 4.08); z* = 1.96 gives (0.83, 3.97), and ±1 SE gives (1.60, 3.20).