Hypothesis test for the slope of a least squares regression
Significance Test for the Slope of a Regression Line
The hypothesis test for the slope in a least squares regression answers a focused question: does the sample provide convincing evidence of a real linear relationship between and in the population, or could the observed trend be due to random chance?
You use the sample slope to make an inference about the true population slope .
Setting Up the Hypotheses
Before running a test, you need to translate the research question into a pair of hypotheses about the population slope . The null hypothesis always represents the “no relationship” case (), and the alternative hypothesis describes the kind of relationship you’re looking for — any linear relationship (two-tailed), a positive one, or a negative one. Your choice of alternative depends on the context of the problem and what direction (if any) you have reason to suspect before looking at the data.
Hypotheses
The null hypothesis states that , meaning there is no linear relationship between and in the population:
The alternative hypothesis is one of the following:
- Two-tailed test: — there is a linear relationship (positive or negative).
- One-tailed positive test: — there is a positive linear relationship.
- One-tailed negative test: — there is a negative linear relationship.
The Test Statistic
To measure how far the sample slope is from the hypothesized population slope (in standard error units), compute:
Where:
- : The test statistic, which measures how many standard errors the sample slope is away from the hypothesized population slope.
- : The sample slope from the regression line ().
- : The hypothesized value of the slope from the null hypothesis (typically ).
- : The standard error of the slope. This measures how much the sample slope varies from sample to sample. A smaller means a more precise estimate.
Degrees of freedom: .
Making a Decision
There are two possible ways to make a decision:
Method 1: p-value approach
Use the test statistic and the degrees of freedom () to find the p-value.
- If , reject — there is significant evidence of a linear relationship.
- If , fail to reject — there is not significant evidence of a linear relationship.
Method 2: Critical value approach
Find the critical t-value from the t-distribution using the degrees of freedom () and the significance level .
- For : reject if .
- For : reject if .
- For : reject if .