+34 616 71 29 85 carsten@dataz4s.com

Standard error of the slope

The standard error of the slope is applied in the calculations of confidence intervals and hypothesis tests which are essential for inference about regression.

 

Key point about standard error of the slope

  • The standard error of the slope (SE) is a component in the formulas for confidence intervals and hypothesis tests and other calculations essential in inference about regression
  • SE can be derived from s² and the sum of squared exes (SSxx)
  • SE is also known as ‘standard error of the estimate’
  • SE is the mean distance of the observed Y values to the line for each given X
  • The larger the SE, the further the Y values from the regression line

 

Why inference on the slope?

Regression analysis explores the relationship between X and Y. It states an answer for whether we can be confident that there is a relationship between X and Y. As we recall, the expressions for the true model and for the estimated models can be written:

Standard error of the slope_line formulas

 We can conduct inference on both the intercept and the slope of our estimated model. But typically, we will be most interested in the slope, because the slope expresses the actual relationship between X and Y.

If the slope is different from 0, we would conclude that there is relationship between X and Y. And the relationship is sufficiently strong, we can decide to accept the model and calculate Y-estimates for X-values not included in our observations. Inference on the intercept is calculated in a similar way.

 

Sample distribution of the slope

In LINER model and Residual plots, I describe the conditions that our regression model should meet in order to proceed with the inference on our regression model. If these conditions are met, we can start working our way towards confidence intervals and hypothesis tests and for this we need the SE.

After checking the conditions for inference, we assume that our estimated slope, β̂1, is a normally distributed random variable with a mean of β1 and a variance equal to σ² divided by the sum of squares for X:

Beta1 follows the normal distribution

 

Sample variance of the slope

But σ² represents the true parameter for the true model which we don’t know, so we need to estimate σ² which we do by calculating the corresponding estimate for σ². We call this s² and calculate it:

Sample variance of slope

 

 

Why df=n-2?

In order to calculate our estimated regression model, we had to use our sample data to calculate the estimated slope (β̂1) and the intercept (β̂0). And as we used our sample data to calculate these two estimates, we lose two degrees of freedom. Therefore, df=n-2. I can be illustrated like this:

Why df equal to n-2

 

Now that we have our variance of β̂1, we can calculate the standard error of β̂1:

 

From sample variance to standard error

For the formula of SE, we need to find our sample standard deviation (s) which can be derived from the sample variance (s²) by taking the square root of s²:

Calculation of sample standard deviation (s)

 

And having our sample standard deviation (s), we now have all the pieces for the standard error of the slope formula:

Standard error of the slope (SE) formula

 

Where SSxx is the sum of the squared exes:

Calculation of squared sum of exes

 

Summary

β̂1 is a normally distributed random variable with a mean of β̂1 and a variance equal to σ² divided by the sum of squares for X. The population variance is estimated with the statistics of the sample variance (s²) from which we can derive the sample standard deviations (s) using this in the calculation of the SE:

Variance unknown_s_SE

 

 

Example

I will run an example on this 4 datapoint mini example to illustrate the calculation procedure of the standard error of the slope (β̂1):

Standard error of slope example

 

 

As calculated in the spreadsheet, our squared error of line is 0.7 and as our df (n-2) = 2. Having these two values, we can proceed with the calculation of the sample standard deviation of the slope:

Standard error of slope calculation

Having calculated the standard error of the slope, we can proceed with the statistical inference as confidence interval on the slope and hypothesis tests on the slope.

 

Standard error of the slope in MS Excel

In Excel you get the standard error of the slope and other summary statistics with Data >> Data Analysis >> Regression:

Standard error of slope in Excel

 

 

Learning statistics

 

Carsten Grube

Carsten Grube

Freelance Data Analyst

0 Comments

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.