Lesson 9.2 · Inference for Slopes
Significance tests for slope
Every scatterplot of sample data shows some slope, even when the two variables have nothing to do with each other in the population. A significance test for slope asks the key question: is the sample slope far enough from that chance alone is an unlikely explanation? If so, you have convincing evidence of a real linear relationship between the variables.
Hypotheses
If there is no linear relationship between and in the population, then the mean response doesn't change as changes, so the population slope is . That is almost always the null hypothesis.
Hypotheses for a test about slope
Here is the slope of the population regression line relating to . Define it in context, and choose the alternative before you look at the data, based on the research question.
A one-sided alternative such as matches a question like "Is there a positive linear relationship?" A two-sided alternative matches "Is there any linear relationship?"
The test statistic
The test follows the same pattern as every test you've seen: (statistic minus null value) divided by standard error.
t test for the slope
where is the null value (usually ). The P-value is the probability of getting a statistic at least this extreme, in the direction of , if is true.
The conditions are the same LINER conditions from the previous lesson: Linear, Independent (10% condition), Normal residuals, Equal SD, and Random.
What the output already tells you
Computer output does most of the arithmetic. In the explanatory variable's row, the T column is and the P column is the P-value for the test of against the two-sided alternative .
- For a two-sided test, use the P-value as printed.
- For a one-sided test, if is on the side that predicts, divide the printed P-value by 2.
- If is on the opposite side from (for example, is negative but ), the P-value is greater than and the data give no support to .
Common mistake
The P value in the output is almost always two-sided. Forgetting to halve it for a one-sided test is the most common mistake on these questions. Also, only use the printed T and P when the null value is . For any other null value, compute yourself.
A complete significance test
Worked example: Social media and sleep
A school counselor suspects that students who spend more time on social media get less sleep. She selects a random sample of students at her large high school and records each student's average daily social media use (, hours) and average nightly sleep (, hours).
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 7.7608 | 0.2588 | 29.99 | 0.000 |
| Social media | -0.2379 | 0.0735 | -3.24 | 0.007 |
S = 0.4563, R-Sq = 46.6%
Do the data give convincing evidence at the level of a negative linear relationship? A residual plot shows no pattern and a dotplot of residuals shows no strong skew.
State. and , where is the slope of the population regression line relating nightly sleep to daily social media use for all students at the school. Use .
Plan. test for the slope.
- Linear: The scatterplot is roughly linear and the residual plot shows no curve.
- Independent: is less than of the students at a large high school.
- Normal: The dotplot of residuals shows no strong skew or outliers.
- Equal SD: The residual plot shows roughly equal spread for all .
- Random: Random sample of students.
Do. From the output, with . The printed P-value is two-sided. Since is negative, as predicts, the one-sided P-value is .
Conclude. Because the P-value is less than , reject . There is convincing evidence of a negative linear relationship between daily social media use and nightly sleep for students at this school.
Because this was a random sample, not an experiment, the conclusion is about association. It does not show that social media use causes less sleep.
When the evidence isn't convincing
Worked example: Practice and free throws
A coach takes a random sample of players in a large youth league and records hours of free-throw practice per week () and free throws made out of attempts (). She wants to know whether there is any linear relationship. Assume the conditions are met.
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 11.6485 | 1.8391 | 6.33 | 0.000 |
| Practice | 0.4848 | 0.2588 | 1.87 | 0.098 |
S = 2.3507, R-Sq = 30.5%
, , where is the slope of the population regression line relating free throws made to weekly practice hours. With :
, , and the two-sided P-value is .
Since , fail to reject . There is not convincing evidence of a linear relationship between practice hours and free throws made for players in this league.
Notice what "fail to reject" does not say. It doesn't prove that ; with only players, the test may simply lack power to detect a real but modest relationship.
Tip
Switching to a one-sided test after seeing the data would halve the P-value here to about , just under . That is exactly why the alternative must be chosen from the research question before looking at the results.
Testing a nonzero slope
Worked example: Checking a new thermometer
An engineer compares a new digital thermometer () with a lab standard () on a random sample of water baths. If the new thermometer is accurate, the slope should be . The output gives and . Test against at . Assume the conditions are met.
The printed T and P test , so compute yourself:
The two-sided P-value is about . Since , reject . There is convincing evidence that the true slope differs from , so the new thermometer is not tracking the standard perfectly.
Tests and intervals agree
A two-sided test at level and a confidence interval with give matching conclusions. If the interval does not contain , a two-sided test of rejects . If the interval does contain , the test fails to reject. The interval gives extra information: a set of plausible values for the size of the slope.
Worked example: Using an interval to decide
A confidence interval for the slope relating a car's engine size (liters) to its highway fuel economy (mpg) is . What does it say about a test of versus at ?
The interval does not contain ; every plausible value of is negative. So the test would reject : there is convincing evidence of a (negative) linear relationship between engine size and highway fuel economy.
Practice
A researcher wants to test whether there is a positive linear relationship between the number of hours a phone has been charging () and its battery percentage (). Which hypotheses are correct?
Computer output for a regression shows a slope of with a standard error of . Find the test statistic for . Round to the nearest hundredth.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A significance test for slope is based on a random sample of individuals. How many degrees of freedom does the distribution have?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Regression output relating to shows a slope of in the explanatory variable's row, with P . You are testing against . What is the P-value for your test?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A test of versus , relating hours of daylight () to daily electricity use () for a random sample of homes, gives a P-value of . Using , which conclusion is correct?
A biologist tests versus , where is the slope of the population regression line relating water temperature to the growth rate of a species of algae. Which describes a Type II error in this context?
A theory predicts that the population slope relating to is . From a random sample of individuals, and . Find the test statistic for versus . Round to the nearest hundredth.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A confidence interval for the slope relating a runner's weekly mileage () to her 5K time in minutes () is . What can you conclude about a test of versus at ?