# 3.3.4: Hypothesis Test for Simple Linear Regression

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$

( \newcommand{\kernel}{\mathrm{null}\,}\) $$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\id}{\mathrm{id}}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\kernel}{\mathrm{null}\,}$$

$$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$

$$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$

$$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\avec}{\mathbf a}$$ $$\newcommand{\bvec}{\mathbf b}$$ $$\newcommand{\cvec}{\mathbf c}$$ $$\newcommand{\dvec}{\mathbf d}$$ $$\newcommand{\dtil}{\widetilde{\mathbf d}}$$ $$\newcommand{\evec}{\mathbf e}$$ $$\newcommand{\fvec}{\mathbf f}$$ $$\newcommand{\nvec}{\mathbf n}$$ $$\newcommand{\pvec}{\mathbf p}$$ $$\newcommand{\qvec}{\mathbf q}$$ $$\newcommand{\svec}{\mathbf s}$$ $$\newcommand{\tvec}{\mathbf t}$$ $$\newcommand{\uvec}{\mathbf u}$$ $$\newcommand{\vvec}{\mathbf v}$$ $$\newcommand{\wvec}{\mathbf w}$$ $$\newcommand{\xvec}{\mathbf x}$$ $$\newcommand{\yvec}{\mathbf y}$$ $$\newcommand{\zvec}{\mathbf z}$$ $$\newcommand{\rvec}{\mathbf r}$$ $$\newcommand{\mvec}{\mathbf m}$$ $$\newcommand{\zerovec}{\mathbf 0}$$ $$\newcommand{\onevec}{\mathbf 1}$$ $$\newcommand{\real}{\mathbb R}$$ $$\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}$$ $$\newcommand{\laspan}[1]{\text{Span}\{#1\}}$$ $$\newcommand{\bcal}{\cal B}$$ $$\newcommand{\ccal}{\cal C}$$ $$\newcommand{\scal}{\cal S}$$ $$\newcommand{\wcal}{\cal W}$$ $$\newcommand{\ecal}{\cal E}$$ $$\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}$$ $$\newcommand{\gray}[1]{\color{gray}{#1}}$$ $$\newcommand{\lgray}[1]{\color{lightgray}{#1}}$$ $$\newcommand{\rank}{\operatorname{rank}}$$ $$\newcommand{\row}{\text{Row}}$$ $$\newcommand{\col}{\text{Col}}$$ $$\renewcommand{\row}{\text{Row}}$$ $$\newcommand{\nul}{\text{Nul}}$$ $$\newcommand{\var}{\text{Var}}$$ $$\newcommand{\corr}{\text{corr}}$$ $$\newcommand{\len}[1]{\left|#1\right|}$$ $$\newcommand{\bbar}{\overline{\bvec}}$$ $$\newcommand{\bhat}{\widehat{\bvec}}$$ $$\newcommand{\bperp}{\bvec^\perp}$$ $$\newcommand{\xhat}{\widehat{\xvec}}$$ $$\newcommand{\vhat}{\widehat{\vvec}}$$ $$\newcommand{\uhat}{\widehat{\uvec}}$$ $$\newcommand{\what}{\widehat{\wvec}}$$ $$\newcommand{\Sighat}{\widehat{\Sigma}}$$ $$\newcommand{\lt}{<}$$ $$\newcommand{\gt}{>}$$ $$\newcommand{\amp}{&}$$ $$\definecolor{fillinmathshade}{gray}{0.9}$$

We will now describe a hypothesis test to determine if the regression model is meaningful; in other words, does the value of $$X$$ in any way help predict the expected value of $$Y$$?

##### Simple Linear Regression ANOVA Hypothesis Test

Model Assumptions

• The residual errors are random and are normally distributed.
• The standard deviation of the residual error does not depend on $$X$$
• A linear relationship exists between $$X$$ and $$Y$$
• The samples are randomly selected

Test Hypotheses

$$H_o$$:  $$X$$ and $$Y$$ are not correlated

$$H_a$$:  $$X$$ and $$Y$$ are correlated

$$H_o$$:  $$\beta_1$$ (slope) = 0

$$H_a$$:  $$\beta_1$$ (slope) ≠ 0

Test Statistic

$$F=\dfrac{M S_{\text {Regression }}}{M S_{\text {Error }}}$$

$$d f_{\text {num }}=1$$

$$d f_{\text {den }}=n-2$$

Sum of Squares

$$S S_{\text {Total }}=\sum(Y-\bar{Y})^{2}$$

$$S S_{\text {Error }}=\sum(Y-\hat{Y})^{2}$$

$$S S_{\text {Regression }}=S S_{\text {Total }}-S S_{\text {Error }}$$

In simple linear regression, this is equivalent to saying “Are X an Y correlated?”

In reviewing the model, $$Y=\beta_{0}+\beta_{1} X+\varepsilon$$, as long as the slope ($$\beta_{1}$$) has any non‐zero value, $$X$$ will add value in helping predict the expected value of $$Y$$. However, if there is no correlation between X and Y, the value of the slope ($$\beta_{1}$$) will be zero. The model we can use is very similar to One Factor ANOVA.

The Results of the test can be summarized in a special ANOVA table:

Source of Variation Sum of Squares (SS) Degrees of freedom (df) Mean Square (MS) $$F$$
Factor (due to X) $$\mathrm{SS}_{\text {Regression }}$$ 1 $$\mathrm{MS}_{\text {Factor }}=\mathrm{SS}_{\text {Factor }} / 1$$ $$\mathrm{F}=\mathrm{MS}_{\text {Factor }} / \mathrm{MS}_{\text {Error }}$$
Error (Residual) $$\mathrm{SS}_{\text {Error }}$$ $$n-2$$ $$\mathrm{MS}_{\text {Error }}=\mathrm{SS}_{\text {Error }} / \mathrm{n}-2$$
Total $$\mathrm{SS}_{\text {Total }}$$ $$n-1$$
##### Example: Rainfall and sales of sunglasses

Design: Is there a significant correlation between rainfall and sales of sunglasses?

Research Hypotheses:

$$H_o$$:  Sales and Rainfall are not correlated      $$H_o$$:  1 (slope) = 0

$$H_a$$:  Sales and Rainfall are correlated      $$H_a$$:  1 (slope) ≠ 0

Type I error would be to reject the Null Hypothesis and $$t$$ claim that rainfall is correlated with sales of sunglasses, when they are not correlated. The test will be run at a level of significance ($$\alpha$$) of 5%.

The test statistic from the table will be $$\mathrm{F}=\dfrac{\text { MSRegression }}{\text { MSError }}$$. The degrees of freedom for the numerator will be 1, and the degrees of freedom for denominator will be 5‐2=3.

Critical Value for $$F$$ at  $$\alpha$$of 5% with $$df_{num}=1$$ and $$df_{den}=3} is 10.13. Reject \(H_o$$ if $$F >10.13$$. We will also run this test using the $$p$$‐value method with statistical software, such as Minitab.

Data/Results

$$F=341.422 / 12.859=26.551$$, which is more than the critical value of 10.13, so Reject $$H_o$$. Also, the $$p$$‐value = 0.0142 < 0.05 which also supports rejecting $$H_o$$.

Conclusion

Sales of Sunglasses and Rainfall are negatively correlated.

3.3.4: Hypothesis Test for Simple Linear Regression is shared under a CC BY-SA license and was authored, remixed, and/or curated by LibreTexts.