impera Open Impera

AP Statistics · Inference for quantitative data: slopes

Confidence intervals for slope

1The regression model

In the population, we model the relationship as

$$\mu_y = \alpha + \beta x$$

where $\beta$ is the true slope: the change in the mean of $y$ for each one-unit increase in $x$. The sample least-squares line $\hat{y} = a + bx$ gives the estimate $b$ of $\beta$.

Different samples give different slopes $b$: the sampling distribution of $b$ is centred at $\beta$, with standard error $SE_b$.

Check yourself

The sample slope b estimates:

  • The intercept α

  • The correlation r

  • The population slope β

  • The residual

Show the answer

The population slope β

Statistic for parameter.

2Conditions (LINER)

  • Linear: the true relationship is linear (check the scatterplot and residual plot for no curve).
  • Independent: observations are independent (10% condition when sampling without replacement).
  • Normal: for each $x$, $y$ varies normally about the line (check a histogram or dotplot of residuals for strong skew or outliers).
  • Equal SD: the spread of $y$ about the line is the same for all $x$ (residual plot has no fanning).
  • Random: data from a random sample or randomised experiment.

The regression model: at each x, y is normal about the true line with the same SD

Check yourself

A residual plot that fans out violates:

  • Normal

  • Equal SD

  • Random

  • Linear

Show the answer

Equal SD

Spread changes with x.

3The t-interval for slope

$$b \pm t^* SE_b, \qquad df = n - 2$$

We lose 2 degrees of freedom because we estimate both the slope and the intercept. $SE_b$ is usually read from computer output.

Worked example

a random sample of 20 used cars gives this output for price (thousands of dollars) against age (years): slope $b = -1.85$, $SE_b = 0.32$.

  1. $df = 18$, $t^* = 2.101$.
  2. $ME = 2.101 \times 0.32 \approx 0.67$.
  3. Interval: $(-2.52, -1.18)$.
  4. "We are 95% confident that the interval from −2.52 to −1.18 captures the true slope: for each extra year of age, the mean price of this model falls by between about $1,180 and $2,520."
Check yourself

For a slope interval with n = 25, df =

  • 23

  • 24

  • 22

  • 25

Show the answer

23

n − 2.

4Reading computer output

Typical regression output lists:

  • Constant (intercept $a$) and the explanatory variable row with Coef ($b$), SE Coef ($SE_b$), T and P.
  • S: the standard deviation of the residuals, $s$, the typical prediction error.
  • R-Sq: the coefficient of determination $r^2$.
Worked example

output row "Hours Coef 4.6 SE Coef 1.1 T 4.18 P 0.000". Here $b = 4.6$ and $SE_b = 1.1$; with $n = 15$, $df = 13$ and $t^* = 2.160$, so the 95% interval is $4.6 \pm 2.38 = (2.22, 6.98)$.

Check yourself

In computer output, the slope's standard error is listed as:

  • S, the typical residual

  • Coef in the Constant row

  • SE Coef in the x row

  • R-Sq, the coefficient

Show the answer

SE Coef in the x row

Next to the slope.

5Going deeper: the conditions, reading computer output and interpreting the interval

The least-squares line from a sample, $\hat{y} = a + bx$, estimates the true (population) regression line, $\mu_y = \alpha + \beta x$. The sample slope b is a statistic; it varies from sample to sample. The parameter of interest is the true slope β.

t interval for the slope

$$b \pm t^*\,SE_b, \qquad \text{df} = n - 2$$

  • $SE_b$, the standard error of the slope, estimates how much b typically varies from the true slope over repeated samples.
  • Two degrees of freedom are lost because two quantities (slope and intercept) are estimated.

Conditions: LINER

  • Linear: the true relationship between x and y is linear. Check: the scatterplot is roughly linear and the residual plot shows no curved pattern.
  • Independent: individual observations are independent; when sampling without replacement, the 10% condition.
  • Normal: for any fixed x, the response y varies normally about the true line. Check: a histogram, dotplot or normal probability plot of the residuals shows no strong skewness or outliers.
  • Equal standard deviation: the spread of y about the line is the same for all x. Check: the residual plot shows roughly equal scatter, with no fan shape.
  • Random: the data come from a random sample or a randomized experiment.

Reading computer output: a typical regression table.

  • Predictor "Constant": Coef 51.0; SE Coef 4.2; T 12.14; P 0.000.
  • Predictor "Hours": Coef 6.0; SE Coef 1.5; T 4.00; P 0.001.
  • S = 5.8; R-Sq = 47.1%.
  1. The row named for the explanatory variable gives the slope: b = 6.0, with $SE_b$ = 1.5.
  2. The "Constant" row gives the intercept: a = 51.0.
  3. S is the standard deviation of the residuals: the typical prediction error.
  4. R-Sq is r².
  5. T and P are for testing H₀: β = 0 (two-sided).
Worked example

the output above comes from a random sample of 20 students, with x = hours studied and y = exam score. The conditions are met. Construct a 95% confidence interval for the slope.

  1. State: β = the slope of the true regression line relating exam score to hours studied for all students in the population; 95% confidence.
  2. Plan: t interval for the slope; conditions stated as met.
  3. Do: df = 20 − 2 = 18; t* = 2.101. Margin of error = 2.101 × 1.5 = 3.15. Interval: 6.0 ± 3.15 = (2.85, 9.15).
  4. Conclude: We are 95% confident that the interval from 2.85 to 9.15 captures the slope of the true regression line relating exam score to hours studied. That is, each additional hour of study is associated with an increase of between 2.85 and 9.15 points in the mean exam score.

Using the interval

  • Because 0 is not in the interval, there is convincing evidence of a linear relationship (a non-zero slope) between hours studied and score. (An interval containing 0 would mean no such evidence.)
  • A claim that each hour adds 10 points is not supported: 10 lies outside the interval.

Interpreting $SE_b$: "If we took many random samples of 20 students, the sample slope would typically vary from the true slope by about 1.5 points per hour."

What makes the slope estimate more precise (smaller $SE_b$)?

  • A larger sample.
  • Less scatter about the line (smaller s).
  • More spread in the x-values: a wider range of x pins the line down better.

Interpreting the confidence level: about 95% of intervals constructed this way from repeated random samples would capture the true slope.

The intercept: its row in the output is used for the equation of the line, but inference about the intercept is rarely of interest.

Caution: a slope describes an association. Unless the data come from a randomized experiment, do not say that studying an extra hour causes the increase.

Common mistakes

  • Using df = n − 1.
  • Taking the standard error from the "Constant" row.
  • Confusing S (variability of residuals) with $SE_b$ (variability of the slope).
  • Interpreting the interval as a range for individual scores.
  • Leaving out "true" or "population" when defining the parameter.
  • Checking the Normal condition on the y-values in place of the residuals.
Check yourself

Regression output from a sample of 12 observations is used to build a confidence interval for the slope. How many degrees of freedom should be used?

  • 12

  • 11

  • 2

  • 10

Show the answer

10

For inference about a slope, df = n − 2.

6For top marks

  • Define $\beta$ in context: "the true slope of the population regression line relating price to age".
  • Check all LINER conditions, referring to the scatterplot and residual plot.
  • Interpret the interval as a change in the mean (predicted) response per unit of $x$.
  • If 0 is not in the interval, there is convincing evidence of a linear relationship.
Example

"Since 0 is not in the interval (−2.52, −1.18), there is convincing evidence of a negative linear relationship between age and price."

Check yourself

A 95% interval for β is (−0.4, 1.3). This suggests:

  • The conditions for inference failed

  • A strong positive linear relationship

  • No convincing evidence of a linear relationship

  • A clear negative linear relationship

Show the answer

No convincing evidence of a linear relationship

0 is plausible.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera