9. Simple Linear Regression: Simple Linear Regression
Inference about the Slope of a Linear Model
The linear relationship between two variables and in the population can be expressed with the following equation:
In order to perform statistical inference about the slope of a linear model, we will first need to determine the standard error of the slope.
Standard Error of the Slope
The standard error of the slope is a measure of the amount of error we can reasonably expect when using sample data to estimate the slope of a linear regression model and is calculated with the following formula:
where is the standard error of the estimate.
We will now take a look at two ways we can use the standard error of the slope to perform statistical inference about the slope coefficient of a linear regression model.
The calculation of assumes that the errors in the population are independent and normally distributed with a constant, but unknown variance (). The variance is estimated by . Because two means are calculated from the data in estimating the variance of the intercept and slope parameters, we are left with free-to-use data points on which the inference can be based. That is why inference for simple regression uses the -distribution with ( = degrees of freedom).
Confidence Interval for the Slope of a Linear Model
The general formula for computing a for the slope is:
Where is the critical value of the distribution such that .
Calculating t* with Statistical Software
Let be the confidence level in .
To calculate the critical value in Excel, make use of the function T.INV():
To calculate the critical value in R, make use of the function qt():
We can also use the standard error of the slope to perform a hypothesis test for the value of the slope of a linear regression model.
Hypothesis Test for the Slope of a Linear Model
The hypotheses of a two-sided test for the slope of a linear model are:
The relevant test statistic for the null hypothesis is:
Under the null hypothesis of the test, follows a -distribution with degrees of freedom:
Calculating the p-value of a Hypothesis Test for the Slope of a Linear Model
The calculation of the -value of a -test for is dependent on the direction of the test and can be performed using either Excel or R.
To calculate the -value of a -test for in Excel, make use of one of the following commands:
To calculate the -value of a -test for in R, make use of one of the following commands:
If , reject and conclude . Otherwise, do not reject .