T Tests
T Tests
Single Sample
Dependent Samples
Independent Samples
From Z to t…
In a Z test, you compare your sample to a
known population, with a known mean and
standard deviation.
In real research practice, you often compare
two or more groups of scores to each other,
without any direct information about
populations.
Nothing is known about the populations that the
samples are supposed to come from.
The t Test for a Single Sample
The single sample t test is used to
compare a single sample to a
population with a known mean but an
unknown variance.
The formula for the t statistic is similar
in structure to the Z, except that the t
statistic uses estimated standard error.
From Z to t…
X hyp
Z
X hyp t
X sX
s
X sX
n Note n
lowercase
“s”.
( X ) 2
s
( X X ) 2
N n 1
Why (n – 1)?
To calculate the variance of a sample, when estimating the
variance of its population, use (n -1) in order to provide an
unbiased estimate of the population variance.
When you have scores from a particular group of people and
you want to estimate what the variance would be for people in
general who are like the ones you have scores from, use (n -1).
Population of 1, 2, 3
Degrees of Freedom
The number you divide by (the number
of scores minus 1) to get the estimated
population variance is called the
degrees of freedom.
The degrees of freedom is the number
of scores in a sample that are “free to
vary”.
Degrees of Freedom
Imagine a very simple situation in which the
individual scores that make up a distribution
are 3, 4, 5, 6, and 7.
If you are asked to tell what the first score is
without having seen it, the best you could do
is a wild guess, because the first score could
be any number.
If you are told the first score (3) and then
asked to give the second, it too could be any
number.
Degrees of Freedom
The same is true of the third and fourth
scores – each of them has complete
“freedom” to vary.
But if you know those first four scores (3, 4,
5, and 6) and you know the mean of the
distribution (5), then the last score can only
be 7.
If, instead of the mean and 3, 4, 5, and 6,
you were given the mean and 3, 5, 6, and 7,
the missing score could only be 4.
Degrees of Freedom
In the t test, because the known sample mean is
used to replace the unknown population mean in
calculating the estimated standard deviation, one
degree of freedom is lost.
For each parameter you estimate, you lose one
degree of freedom.
Degrees of freedom is a measure of how much precision an
estimate of variation has.
A general rule is that the degrees of freedom decrease when
you have to estimate more parameters.
( X ) 2
s
(X X ) 2
N n 1
The t Distribution
In the Z test, when the population distribution
follows a normal curve, the shape of the
distribution of means will also be a normal curve.
However, this changes when you do hypothesis
testing with an estimated population variance.
Since our estimate of is based on our sample…
And from sample to sample, our estimate of will
change, or vary…
There is variation in our estimate of , and more
variation in the t distribution.
The t Distribution
Just how much the t distribution differs from the
normal curve depends on the degrees of freedom.
The t distribution differs most from the normal curve
when the degrees of freedom are low (because the
estimate of the population variance is based on a
very small sample).
X hyp 3.49 3
t 2.72
sX .18
The t Test for a Single
Sample: Example
Decide if result is significant.
Reject H0, 2.72 > 1.711
Interpret result as it relates to your
research question.
The organic feed caused the chickens to
gain weight.
The t Test for a Single
Sample: Example
Odometers measure automobile mileage. How close
to the truth is the number that is registered?
Suppose 12 cars travel exactly 10 miles (measured
beforehand) and the following mileage figures were
recorded by the odometers:
9.8, 10.1, 10.3, 10.2, 9.9, 10.4, 10.0, 9.9, 10.3, 10.0, 10.1, 10.2
Using the .01 level of significance, determine if you
can trust your odometer.
The t Test for a Single
Sample: Example
State the research question.
Are odometers accurate?
State the statistical hypotheses.
H O : 10
H A : 10
The t Test for a Single
Sample: Example
Set the decision rule.
.01
df n 1 12 1 11
t crit 3.106
The t Test for a Single
Sample: Example
121.20
Calculate X 10.1
12
the test
nX 2 (X ) 2
X
statistic.
X
2 s
n(n 1)
9.8 96.04
(12)1224.87 (121.20) 2 X hyp 10.1 10.0
10.1 102.01
s t 1.25
10.3 106.09 12(11) sX .08
10.2 104.04
14698.44 14689.44
9.9 98.01 s
132
10.4 108.16
9
10.0 100.00 s
98.01
132
9.9
106.09
s .26
10.3
100.00 s .26
10.0 sX .08
10.1 102.01 n 12
10.2 104.04
121.20 1224.87
The t Test for a Single
Sample: Example
Decide if result is significant.
Fail to reject H0, 1.25<3.106
Interpret result as it relates to your
research question.
The mileage your odometer records is not
significantly different from the actual
mileage your car travels.
The t Test for Dependent Samples
Repeated-Measures Design
When you have two sets of scores from the
same person in your sample, you have a
repeated-measures, or within-subjects
design.
You are more similar to yourself than you
are to other people.
The t Test for Dependent Samples
Related-Measures Design
When each score in one sample is paired, on a
one-to-one basis, with a single score in the other
sample, you have a related-measures or matched
samples design.
You use a related-measures design by matching
pairs of different subjects in terms of some
uncontrolled variable that appears to have a
considerable impact on the dependent variable.
The t Test for Dependent Samples
X hyp D Dhyp
t t
sX sD
The t Test for Dependent Samples
D Dhyp
t
sD
sD
sD
n
nD 2 (D) 2
sD
n(n 1)
Difference Scores
The way to handle two scores per person, or
a matched pair, is to make difference scores.
For each person, or each pair, you subtract one
score from the other.
Once you have a difference score for each person,
or pair, in the study, you treat the study as if
there were a single sample of scores (scores that
in this situation happen to be difference scores).
A Population of Difference Scores
with a Mean of 0
sD
16
D 2
8
8(42) (16) 2
s 1.2
8(7)
1.2
sD .42
8
20
t 4.76
.42
The t Test for Dependent
Samples: An Example
Decide if your results are significant.
Reject H0, -4.76<-2.365
Interpret your results.
After the pro-socialized medicine lecture,
individuals’ attitudes toward socialized
medicine were significantly more positive
than before the lecture.
The t Test for Dependent
Samples: An Example
At the Olympic level of competition, even the smallest factors can make the
difference between winning and losing. For example, Pelton (1983) has shown
that Olympic marksmen shoot much better if they fire between heartbeats, rather
than squeezing the trigger during a heartbeat. The small vibration caused by a
heartbeat seems to be sufficient to affect the marksman’s aim. The following
hypothetical data demonstrate this phenomenon. A sample of 6 Olympic
marksmen fires a series of rounds while a researcher records heartbeats. For
each marksman, an accuracy score (out of 100) is recorded for shots fired during
heartbeats and for shots fired between heartbeats. Do the data indicate a
significant difference? Test with an alpha of .05. During Heartbeats Between Heartbeats
93 98
90 94
95 96
92 91
95 97
91 97
The t Test for Dependent
Samples: An Example
State the research hypothesis.
Is better accuracy achieved by marksmen
when firing the trigger between heartbeats
than during a heartbeat?
State the statistical hypotheses.
H0 : D 0
H A : D 0
The t Test for Dependent
Samples: An Example
Set the decision rule.
.05
df 6 1 5
t crit 2.015
The t Test for Dependent
Samples: An Example
D Dhyp
t
Calculate the test statistic. sD
During Between Difference D2 17
93 98 -5 25
D 2.83
6
90 94 -4 16
95 96 -1 1
6(83) (17) 2
92 91 1 1 sD 2.64
6(5)
95 97 -2 4
91 97 -6 36
2.64
TOTAL -17 83 sD 1.08
6
2.83 0
t 2.62
1.08
The t Test for Dependent
Samples: An Example
Decide if your results are significant.
Reject H0, -2.62<-2.015
Interpret your results.
Marksmen are significantly more accurate
when they pull the trigger between
heartbeats than during a heartbeat.
Issues with Repeated
Measures Designs
Order effects.
Use counterbalancing in order to eliminate any
potential bias in favor of one condition because
most subjects happen to experience it first (order
effects).
Randomly assign half of the subjects to
experience the two conditions in a particular
order.
Practice effects.
Do not repeat measurement if effects linger.
The t Test for Independent
Samples
Observations in each sample are
independent (not related to) each
other.
We want to compare differences
between sample means, not a mean of
differences.
( X 1 X 2 ) ( 1 2 ) hyp
t
sX
1X2
Sampling Distribution of the
Difference Between Means
Imagine two sampling distributions of the
mean...
And then subtracting one from the other…
If you create a sampling distribution of the
difference between the means…
Given the null hypothesis, we expect the mean of the
sampling distribution of differences, 1- 2, to be 0.
We must estimate the standard deviation of the
sampling distribution of the difference between
means.
Pooled Estimate of the
Population Variance
Using the assumption of homogeneity of
variance, both s1 and s2 are estimates of the
same population variance.
If this is so, rather than make two separate
estimates, each based on some small sample,
it is preferable to combine the information
from both samples and make a single pooled
estimate of the population variance.
2 2
2 (n 1)s (n 1)s
sp 1 1 2 2
(n1 1) (n2 1)
Pooled Estimate of the Population
Variance s 2 1
(n 1)s1
2
(n 2 1)s 2
2
p
(n1 1) (n2 1)
The pooled estimate of the population variance becomes
the average of both sample variances, once adjusted for
their degrees of freedom.
Multiplying each sample variance by its degrees of freedom ensures
that the contribution of each sample variance is proportionate to its
degrees of freedom.
You know you have made a mistake in calculating the pooled
estimate of the variance if it does not come out between the two
estimates.
You have also made a mistake if it does not come out closer to the
estimate from the larger sample.
The degrees of freedom for the pooled estimate of the
variance equals the sum of the two sample sizes minus two,
or (n1-1) +(n2-1).
Estimating Standard Error of
the Difference Between Means
2 2
2 (n 1)s (n 1)s
sp 1 1 2 2
(n1 1) (n2 1)
s 2p s 2p
sX
1X2
n1 n2
( X 1 X 2 ) ( 1 2 ) hyp
t
sX
1X2
The t Test for Independent
Samples: An Example
The t Test for Independent
Samples: An Example
State the research question.
Do males, who rate high on a scale of
homophobia, become more or less aroused
to homosexual pornography than males
who rate low on a scale of homophobia?
State the statistical hypotheses.
Ho : 1 2 0
H1 : 1 2 0
or
Ho : 1 2
H1 : 1 2
The t Test for Independent
Samples: An Example
2 2
2 (n 1)s (n 1)s
sp 1 1 2 2
(n1 1) (n2 1)
2 (35 1)148.87 (29 1)139.16
s
p 144.48
(35 1) (29 1)
The t Test for Independent
Samples: An Example
Calculate the test statistic.
2 (35 1)148.87 (29 1)139.16
s
p 144.48
(35 1) (29 1)
s 2p s 2p
sX
1X2
n1 n2
144.48 144.48
sX 3.02
1X2
35 29
The t Test for Independent
Samples: An Example
Calculate the test statistic.
( X 1 X 2 ) ( 1 2 ) hyp
t
sX
1X2
X 1 24
X 2 16.5
144.48 144.48
sX 3.02
1X2
35 29
24 16.5
t 2.48
3.02
The t Test for Independent
Samples: An Example
Decide if your results are significant.
Reject H0, 2.48>2.00
Interpret your result.
Homophobic subjects show greater arousal
to homosexual pornography than non-
homophobic subjects.
The t Test for Independent
Samples: An Example
Stereotype Threat
X 1 6.58 X 2 9.64
9.59 9.59
sx X 1.29
1 2
12 11
6.58 9.64
t 2.37
1.29
The t Test for Independent
Samples: An Example
Decide if your result is significant.
Reject H0, - 2.37< - 1.721
Interpret your results.
Stereotype threat significantly reduced
performance of those to whom it was
applied.