- In this screen cast, I'll be talking to you
about paired t tests.
These are a special type of t tests.
To start us off I've got an example here.
Back in the winter of 2008 to 2009,
I would go cross country skiing a lot, and I would pass
through Nederland, which is to the west of Boulder.
I would look at the thermometer on my Volvo
and as I drove past the Nederland bank,
I would record the temperatures for both of those.
For example, my Volvo temperature reading might be 19,
and the bank might be reading 22 degrees.
What we're trying to do is,
is there a significant difference
between the temperature reading on my Volvo
and the thermometer at the Nederland bank?
This is a paired comparison because obviously,
the temperature is changing among these dates.
The variable that we want to look at is the difference
in the measurements for each of these dates.
And so this is an example of a paired test.
A paired t test is used to analyze the differences
between paired measurements.
For example, a measurement taken at two different times,
a pre-test and post test with an intervention administered
between the two time points.
A lot of times this is used in the medical field.
In clinical trials, a measurement might be taken
under two different conditions, for example,
completing a test under a control condition
and an experimental condition.
Measurements taken from two halves or sides of a subject
or experimental unit.
For example, measuring restoration
of hearing loss in a subject's left and right ears
using different hearing aids.
Obviously every person is going to
respond a little bit differently, and so if you compare
in a person the improvement in one ear versus the other,
that's usually the best way to do
these types of clinical experiments.
Other examples would be temperature measurements
with two different instruments,
comparing cholesterol levels over time
for different patients.
Cholesterol levels, just by the very nature
are gonna be very different in people
but the important thing is looking at the decrease
in cholesterol levels in a single patient.
And so that's an example of a paired experiment.
Maybe an ACL tear.
Maybe you look at the average balance time on a bum knee
versus a good knee.
Everybody's gonna be able to balance on a good knee
for different periods of time.
But the important thing is when you're looking
at rehabilitating an ACL tear, you want to look
at the difference between those balanced times
in the same patient, not among patients.
So in a paired t test, we analyze the differences
between paired measurements.
We collect the data, and they're paired.
So here we have, the first index here represents the group.
This might be the left ear versus the right ear.
The second index is the number of measurements.
So we collect paired measurements.
We then compute for each of those measurements
the difference between the first group and the second.
Or if we're talking about the hearing loss
restoration experiment,
we're talking about the left side and right side.
If this is thermometers, we're talking
about the temperature of my Volvo
minus the temperature that the bank is displaying,
and we come up with a brand new variable, the differences.
And this is a differences random variable.
The hypothesis test we perform is,
is the mean equal to some delta?
A lot of times 95% or more of the time,
delta is commonly zero.
You're just trying to compare
if there's any difference other than zero.
You can set up an upper tail test, a lower tail test,
or a two tail test.
So here is an upper tail test.
As always, we compute a test statistic instead
of calculated sample average.
Here we compute the average
of our differences, and we apply the t tests.
And again, a lot of times this is just zero.
We calculate a standard deviation of the differences,
and then we can apply the t tests.
And here we assume
that the variance of the differences is unknown.
We have the same type of rejection criteria
that we have considered with all of these t tests.
For a two-tailed test, our test statistic has to be greater
than t alpha over two with n minus one degrees of freedom,
or less than negative t alpha over two,
with n minus one degrees of freedom.
For an upper tailed test,
in order for us to accept the alternate, reject the null,
our test statistic has to be up in the tails
greater than t alpha with n minus one degrees of freedom.
And similarly, for a lower tail test,
our test statistic has to be way down in a left tail,
less than negative t alpha
with n minus one degrees of freedom
in order for us to accept the alternate hypothesis.
So let's revisit our experiment here.
Let's calculate this in Excel.
The first thing I'm gonna do is calculate
all the differences.
The differences I'm just gonna take as our Volvo temperature
minus the Nederland bank temperature.
I can just drag this down to compute all of the differences.
And in order for me to determine what type
of hypothesis test to do, whether that's going to be
an upper tail or a lower tail test,
I'm gonna take the average of the differences.
So that's equal to 0.2.
It appears that the Volvo temperature is a little bit higher
than the Nederland temperature.
We're also going to be calculating a standard deviation
of the differences, and that's equal to 2.54.
We can choose an alpha, so I'm gonna name this alpha,
and we can compute our test statistic here.
The hypothesis test we are doing here is an upper tail test
because our d bar is positive, we're comparing it to zero.
Our test statistic then is going to be our average
minus zero.
So I leave that off, divided by our standard deviation
of the differences.
And then a divide by divide by,
this is going to be multiplying by the count,
the square root of the count of our data,
and we end up with a test statistic of 0.30.
We have to compare this to the t distribution
with n minus one degrees of freedom.
Here we have 15 items, so we compare
to the t distribution with 14 degrees of freedom.
The critical t value that we would have to exceed
in this case would be t.inv one minus alpha
with 14 degrees of freedom.
We would have to exceed 1.76
in order to accept the alternate.
The conclusion then, because our test statistic,
which corresponds to our average,
just standardizing our average
of the differences to a t distribution,
that's what a test statistic is, is 0.3.
That is not way up in the right tail.
And so our conclusion is we can reject
the alternate hypothesis and fail to reject the null.
We can calculate a P-value.
A P-value for an upper tailed test is just
the area in the curve underneath the t distribution
to the right, in this case for an upper tail test,
of our test statistic with 14 degrees of freedom.
Our P-value for this case is 0.382.
And so that's not less than alpha of 0.05.
And again, that points to our conclusion
that we reject the alternate and fail to reject the null.
We can also use the data analysis tool.
If you go to data analysis and you go down here
to a paired two sample for means t test, we can use that.
Our variable one would be our Volvo temperatures.
Our variable two would be our Nederland bank temperatures.
The hypothesis mean difference in this case is zero.
We're gonna use an alpha of 0.05.
I'm gonna put this onto the spreadsheet
starting in cell I11.
Go ahead and click okay.
I can resize this real quick,
and it comes up with the same conclusion.
It calculates a P-value down here
for a one tailed test of 0.382.
Keep in mind that these data analysis tools
always perform a lower tail test.
Our test was that the Volvo temperature
is greater than the Nederland temperature,
but it just switches it around and it says
Nederland temperature less than Volvo temperature.
It's always a lower tailed test.
We get a test statistic of the same,
and this is just another way that you can confirm
or perform these paired t tests in Excel.
So hopefully you learned how to perform paired comparisons
using t tests in this screen cast.