Mostly Harmless StatisticsXYZ Homework Edition

⇩ Download ▾

12.5 Hypothesis Test for Linear Regression

To test to see if the slope is significant we will be doing a two-tailed test with hypotheses. The population least squares regression line would be y=β0+β1x+εy = \beta_{0} + \beta_{1} x + \varepsilon where β0\beta_{0} (pronounced “beta-naught”) is the population yy-intercept, β1\beta_{1} (pronounced “beta-one”) is the population slope and ε\varepsilon is called the error term.

If the slope were horizontal (equal to zero), the regression line would give the same yy-value for every input of xx and would be of no use. If there is a statistically significant linear relationship then the slope needs to be different from zero. We will only do the two-tailed test, but the same rules for hypothesis testing apply for a one-tailed test.

We will only be using the two-tailed test for a population slope.

The hypotheses are:

H0:β1=0H_{0}: \beta_{1} = 0
H1:β10H_{1}: \beta_{1} \neq 0

The null hypothesis of a two-tailed test states that there is not a linear relationship between xx and yy. The alternative hypothesis of a two-tailed test states that there is a significant linear relationship between xx and yy.

Either a t-test or an F-test may be used to see if the slope is significantly different from zero. The population of the variable yy must be normally distributed.

F-Test for Regression

An F-test can be used instead of a t-test. Both tests will yield the same results, so it is a matter of preference and what technology is available. Figure 12-12 is a template for a regression ANOVA table,

Template for a regression table, containing equations for the sum of squares, degrees of freedom and mean square for regression and for error, as well as the F value of the data.
Figure 12-12: Regression ANOVA table template.

where nn is the number of pairs in the sample and pp is the number of predictor (independent) variables; for now this is just p=1p = 1. Use the F-distribution with degrees of freedom for regression = dfR=pdf_{R} = p, and degrees of freedom for error = dfE=np1df_{E} = n - p - 1. This F-test is always a right-tailed test since ANOVA is testing the variation in the regression model is larger than the variation in the error.

T-Test for Regression

If the regression equation has a slope of zero, then every xx value will give the same yy value and the regression equation would be useless for prediction. We should perform a t-test to see if the slope is significantly different from zero before using the regression equation for prediction. The numeric value of t will be the same as the t-test for a correlation. The two test statistic formulas are algebraically equal; however, the formulas are different and we use a different parameter in the hypotheses.

The formula for the t-test statistic is t=b1(MSESSxx)t = \frac{b_{1}}{\sqrt{ \left(\frac{MSE}{SS_{xx}}\right) }}

Use the t-distribution with degrees of freedom equal to np1n - p - 1.

The t-test for slope has the same hypotheses as the F-test:

H0:β1=0H_{0}: \beta_{1} = 0
H1:β10H_{1}: \beta_{1} \neq 0

Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University, https://mostlyharmlessstat.wixsite.com/webpage), © Rachel Webb, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.