Inference for Regression Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Inference for Regression.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

Using hypothesis tests and confidence intervals to draw conclusions about the true population slope \beta_1 of the linear relationship y = \beta_0 + \beta_1 x + \varepsilon, based on sample data.

You computed a sample regression line with slope b = 2.3. But is the true population slope actually different from zero? Maybe there's really no linear relationship and you just got a slope by chance. The regression t-test asks: 'Is my sample slope far enough from zero that it's unlikely to have occurred by random variation alone?'

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: The null hypothesis is typically H_0: \beta_1 = 0 (no linear relationship). A confidence interval for \beta_1 is b \pm t^* \cdot \text{SE}_b. Conditions: linearity, independence, normality of residuals, and equal variance.

Common stuck point: Students forget to check the conditions: (1) the residual plot should show no pattern, (2) residuals should be approximately normal, (3) the spread of residuals should be roughly constant across x.

Worked Examples

Example 1

medium
A regression output shows: slope b=2.5, SE_b=0.8, n=30. Test H_0: \beta=0 vs H_a: \beta \neq 0 at \alpha=0.05 using a t-test.

Solution

  1. 1
    Test statistic: t = \frac{b - \beta_0}{SE_b} = \frac{2.5 - 0}{0.8} = 3.125
  2. 2
    Degrees of freedom: df = n - 2 = 30 - 2 = 28
  3. 3
    Critical value: t^*_{0.025, 28} \approx 2.048 (two-tailed at \alpha=0.05)
  4. 4
    Since |t| = 3.125 > 2.048, reject H_0; the slope is significantly different from zero

Answer

t=3.125 > 2.048. Reject H_0. The slope is statistically significant at \alpha=0.05.
Testing whether the slope equals zero tests whether x is a useful predictor of y. Rejecting H_0: \beta=0 means the linear relationship exists (in the population). df = n-2 because two parameters (slope and intercept) are estimated.

Example 2

hard
Construct a 95% confidence interval for the slope \beta given: b=1.8, SE_b=0.5, n=25, and t^*_{0.025,23}=2.069.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
List the four conditions for valid regression inference and explain why each must be checked.

Example 2

hard
A regression of salary on years of experience gives: \hat{y} = 30000 + 2000x, R^2=0.72, slope p-value=0.001. A confidence interval for the slope is (1500, 2500). Provide a full interpretation of each result.

Background Knowledge

These ideas may be useful before you work through the harder examples.

linear regression lsrlresidualsr squaredhypothesis testingconfidence interval