18. Inference for Regression
Math 115
Example 1: Study Hours and Exam Scores
A statistics instructor wants to know if there is a relationship between the number of hours students spend studying per week and their exam scores. A random sample of 42 students reported their average weekly study hours, and their scores on the final exam (out of 100 points) were recorded.
The scatterplot below shows the data with the least squares regression line:
The regression output from statistical software is:
| Term | Estimate | Std. Error | T statistic | P-value |
|---|---|---|---|---|
| (Intercept) | 56.764 | 6.940 | 8.18 | 0.0000 |
| study_hours | 2.110 | 0.868 | 2.43 | 0.0197 |
(a) Write the equation of the least squares regression line.
(b) Interpret the slope in the context of this problem.
(c) State the null and alternative hypotheses for testing whether there is a linear relationship between study hours and exam scores.
(d) Verify the T statistic using the slope and standard error from the output.
(e) Using \(\alpha = 0.05\) and \(df = 40\), state your conclusion in the context of the problem.
(a) Equation of the regression line:
From the output, the intercept is 56.764 and the slope is 2.11.
\[\widehat{exam\_score} = 56.76 + 2.11 \times study\_hours\]
(b) Interpret the slope:
The slope is \(b_1 = 2.11\).
For each additional hour of weekly studying, we expect a student’s exam score to increase by 2.11 points, on average.
(c) Hypotheses:
Let \(\beta_1\) represent the true population slope (the relationship between study hours and exam scores for all students).
- \(H_0: \beta_1 = 0\) (There is no linear relationship between study hours and exam scores)
- \(H_A: \beta_1 \neq 0\) (There is a linear relationship between study hours and exam scores)
(d) Verify the T statistic:
From the output: \(b_1 = 2.11\) and \(SE = 0.868\)
\[T = \frac{b_1 - 0}{SE} = \frac{2.11}{0.868} = 2.43\]
This matches the T statistic in the output (2.43). ✓
(e) Conclusion:
- Test statistic: \(T = 2.43\)
- Degrees of freedom: \(df = n - 2 = 42 - 2 = 40\)
- P-value: 0.0197
Since the p-value (0.0197) is less than \(\alpha = 0.05\), we reject \(H_0\).
Conclusion: There is convincing evidence of a linear relationship between weekly study hours and exam scores. Students who study more tend to score higher on the exam.
Note: This is an observational study, so we cannot conclude that studying more causes higher exam scores. There may be confounding variables (e.g., student motivation, prior knowledge).
Example 2: Temperature and Electricity Usage
An energy company wants to estimate how daily high temperature affects residential electricity usage (for air conditioning). They collected data from 55 randomly selected summer days, recording the daily high temperature (°F) and average household electricity usage (kWh) in a residential neighborhood.
The scatterplot below shows the data with the least squares regression line:
The regression output from statistical software is:
| Term | Estimate | Std. Error | T statistic | P-value |
|---|---|---|---|---|
| (Intercept) | 15.5501 | 5.5467 | 2.80 | 0.007 |
| temp | 0.4417 | 0.0641 | 6.89 | 0.000 |
(a) Interpret the slope in the context of this problem.
(b) Using the regression output, calculate a 95% confidence interval for the slope.
(c) Interpret the confidence interval in the context of this problem.
(d) Based on the confidence interval, would you reject \(H_0: \beta_1 = 0\) at the \(\alpha = 0.05\) significance level? Explain.
(a) Interpret the slope:
The slope is \(b_1 = 0.442\).
For each additional degree Fahrenheit in daily high temperature, we expect average household electricity usage to increase by 0.442 kWh, on average.
(b) Calculate the 95% confidence interval:
From the output: \(b_1 = 0.4417\) and \(SE = 0.0641\)
Step 1: Calculate degrees of freedom
For regression, \(df = n - 2\).
\[df = 55 - 2 = 53\]
Step 2: Find the critical value \(t^*\)
In Jamovi, go to Randomize → Model-Based Inference. Enter \(df = 53\) and confidence level 95%. This gives \(t^* = 2.006\).
Step 3: Calculate the confidence interval
The formula for a confidence interval is: \[b_1 \pm t^*_{df} \times SE\]
Substituting values: \[0.4417 \pm 2.006 \times 0.0641\]
\[0.4417 \pm 0.1286\]
Lower bound: \(0.4417 - 0.1286 = 0.313\)
Upper bound: \(0.4417 + 0.1286 = 0.57\)
95% CI: (0.313, 0.57)
(c) Interpret the confidence interval:
We are 95% confident that for each additional degree Fahrenheit in daily high temperature, average household electricity usage increases by between 0.313 and 0.57 kWh.
(d) Decision based on CI:
Yes, we would reject \(H_0: \beta_1 = 0\) at the \(\alpha = 0.05\) level.
Reasoning: The 95% confidence interval (0.313, 0.57) does not contain 0. Since 0 is not a plausible value for the slope based on this interval, we have sufficient evidence to conclude that there is a linear relationship between temperature and electricity usage.
This is consistent with the p-value (< 0.001) being less than 0.05.