- [Teacher] In the previous screen cast
I showed you how we can calculate the slope
and intercept using least squared method
for simple linear regression.
I also showed you how we can calculate standard error
and we can calculate the standard error
of our coefficients for slope and intercept.
In this screen cast, I'm going to show you how
we can use the standard errors of our slope
and intercept to perform hypothesis tests on the slope
and intercept for simple linear regression.
Recall from the previous screen cast that our standard error
of the slope and intercept are given here.
And I go over all of these
different parameters in that previous screen cast.
These standard errors can be used to
perform hypothesis tests and calculate confidence intervals
on the slope and intercept.
And in this screen cast I'm gonna show you how
we can perform hypothesis tests.
The hypothesis tests that we're going to perform relate
to whether or not the slope and intercept are close enough
to zero such that we can just ignore that term.
This is typically not done for the intercept by the way.
Typically, you will leave an intercept
in the model regardless of whether or not it is significant.
But other parameters such as the slope here,
if we create a 95% confidence interval about beta one
and it includes zero, that means we can't rule
out that this beta one, the slope could be zero.
If the slope is zero
then we may as well just eliminate that term from the model.
It has no bearing on the output of our model.
So to test the slope, we're gonna set up a hypothesis test.
The null hypothesis is that the
slope is equal to some value, and in this case
what we're gonna do is we're gonna choose that to be zero.
If we do not accept the alternate hypothesis
then we can assume
that the slope is not necessary in our model.
In other words, the slope could be zero.
You can also do a lower tailed test and
a two-tailed test for the slope.
The test statistic is shown here.
We take our beta one estimate.
So beta one hat is estimated from our sample data
and we subtract whatever we are hypothesizing
in our null hypothesis.
And again, many times that's just equal to zero.
And we divide by the standard error of our slope.
We reject the null hypothesis if our test statistic
for this upper tail test is greater than T alpha with N
minus two degrees of freedom.
So this is very similar to some of the hypothesis
tests that we've done previously.
Note the N minus two, because now our degrees
of freedom are a little bit smaller because we've used
up two degrees of freedom in calculating our estimates
for beta, not in beta one.
Again, the most common and important
null hypothesis would be that the slope is equal to zero.
This addresses the question.
If we use the null hypothesis equal to zero,
does X have an effect on Y?
And there are parallel tests for beta, not
Let's continue our example from a previous screen cast.
Now our beta one is negative.
Our alternate hypothesis is going to be
that the slope is less than zero.
So we're doing a lower tailed test.
We can use this equation over here
to calculate our test statistic.
So I put in a test statistic here.
This is just equal to our beta one,
and we're checking to see if it's equal to zero.
So beta one not is just zero.
And then I can simply divide by the error of beta not.
And it's as simple as that.
This means that our test statistic is negative 6.16.
We test this against a negative T alpha
with two degrees of freedom T.INV.
And we're gonna use an alpha
of 0.05 N minus two degrees of freedom.
And when we do that, that's negative 2.015.
The conclusion, because T not for
this lower tail test is way down in the tail
it's a lot less than our critical T alpha of negative 2.01.
Our conclusion is that we accept the alternate
and the slope really is less than zero.
So the slope is significant.
If we go back to the regression output
you notice that the test statistic
of negative 6.17 is exactly what we got using Excel.
And now let's go ahead and calculate a P value.
And actually I'm just gonna put a green highlight here
because now we've calculated that.
You could also do the same thing for the intercept.
So I've shown you essentially how we can do that.
Let's calculate the P value.
The P value, remember, is the area in the tail to the left
for a lower tail test of our test statistic with N
minus two degrees of freedom and we have to use cumulative
and we get a P value of about 0.0008.
You notice that that's not quite
what the regression output is providing
The regression output is always
assuming a two-tailed distribution.
So if we actually multiply this by two,
two times that, we would get the same P value 0.0016
that the regression output is providing.
And you can do the same thing for the intercept.
So I've shown you how we can do all
of these things now by using simple Excel formulas.
If you wanted to perform a hypothesis test on the intercept,
you would just replace the subscript one here
with zero for the intercept.
Thanks for watching.