[MUSIC]
In this video we will illustrate how to use regression analysis in place of
at t-test.
We will begin with a question, and the question is, is there a statistically
significant difference in teaching evaluation scores for men and women?
When we compute, the averages while using the teaching evaluation data set,
we find that the teaching evaluation score for women is around 3.9, and for
men, it's around 4.06.
The question is, is this difference, even though it's small,
statistically significant.
We can run at t-test using Python and compute the statistical significance for
the t-test.
Here, our conclusion is that the teaching evaluation scores difference between men
and women, is statistically significant.
What if we were to do the same thing with the regression model?
We will do the linear regression in Python.
We will be using the statsmodel library.
We will create a list for the independent variable, that is the female variable,
which has been turned to a binary variable,
where 1 equals female and 0 is male.
We will also create a list for the dependent variable,
teaching evaluation score.
We will manually add the constant beta zero, then we will fit and
make predictions, and print out the model summary.
The model summary will print out a table like this.
But we are only interested in this part of this table for the t-test,
it prints out the coefficient error, t statistics and pin value.
We can see the t statistics for the female variable is negative 3.25,
and the P value is less than 0.05.
That means that there is a statistical difference in mean values for male and
female instructors.
The coefficient means that you are most likely to lose about 0.17 marks for
being a female.
We can see that the results from using a regression model, and
the conclusion is identical, if we run a t-test.
[MUSIC]