+34 616 71 29 85 carsten@dataz4s.com

Hypothesis test for the slope

e conduct hypothesis test for the slope to see if there is evidence for a relationship between X and Y. As we do not know the true regression line, we can only estimate it, and therefore it makes sense to test.


Key points on hypothesis testing of the regression slope

  • Hypothesis test on the regression slope typically tests the relationship between X and Y
  • The H0 is typically set to β̂1=0 claiming no relationship, but any other value can be tested as well


The purpose of hypothesis testing for the slope

A hypothesis test for the slope is based on the fundamentals of hypothesis testing.

The main purpose of regression analysis is to explore the relationship between the explanatory variable (X) and the dependent variable (Y). We pretend to be as confident as possible about this relationship which is expressed by the slope. Therefore, a hypothesis test for the slope (β̂1)=0 is the most common, but we can test for any value. If the slope is 0, it means that our sample statistics indicate no relationship.


How to set up the hypothesis test

We recall our estimated regression model:

Hypothesis test for the slope_estimated regression model



When conducting a hypothesis test for the slope, the null hypothesis claims that there is no linear relationship between X and Y:

Hypothesis test for the slope


The formula of the t-statistics says: β̂1 minus the hypothesized value, divided by the SE. As the hypothesized value typically will be 0, we can write as expressed below. In case, we test for another value, this value is applied instead of the 0.

t-statistics for the slope


Worked example

Back to the home-made example where we explore the relationship between persons’ height and their size of gloves:


Calculations_hypothesis test for the slope_regression


As explained in Standard error of the slope and Confidence intervals for the slope, we first calculate the sample standard deviation which then is plugged into the SE formula, and with the SE, we can calculate the t-statistic:

Calculating t-statistic for the slope_regression


The critical t-value for df = 13 at an alpha level of 0.05 is 2.160 (t-table or statistical software), and our t-statistic = 10.402 which is “far” beyond this critical value. We therefore reject the null hypothesis concluding that the provided data indicates that there is a strong relation between X and Y.

The output of Excel for this example:

P-value for the slope in Excel output


As the table shows the p-value for our data is 1.15 × 10-7= 0.000000115. This is an extremely low p-value giving us very high evidence against the H0 hypothesis and thus against the claim that there is no relationship.

We have very strong evidence that the true slope is not zero and that therefore is a relationship between X and Y. This extremely low p-value expresses that it would be extremely unlikely to see the increase of our line is due to chance alone. There definitely seems to be a relationship between X and Y.


Hypothesis test for the slope in MS Excel

Hypothesis test for the slope in MS Excel can be run through Data >> Data Analysis >> Regression, where the p-value is given. With the p-value we can conclude on the likelihood of getting the slope you get from your sample data due to chance alone.

If the p-value is “beyond” your alpha level, you would reject the H0and conclude that there is evidence for a relationship between X and Y.

Hypothesis test for the slope in Excel



Learning resources, hypothesis test for the slope

Carsten Grube

Carsten Grube

Freelance Data Analyst


Submit a Comment

+34 616 71 29 85

Call me

Spain: Ctra. 404, km 2, 29100 Coín, Malaga


Denmark: c/o Musvitvej 4, 3660 Stenløse

Drop me a line

What are you working on just now? Can I help you, and can you help me? 

About me

Learning statistics. Doing statistics. Freelance since 2005. Dane. Living in Spain. With my Spanish wife and two children. 

What they say

20 years in sales, analysis, journalism and startups. See what my customers and partners say about me.