Professional Documents
Culture Documents
1. One-sample T-Test
2. Matched Pairs T-Test
3. Two-sample T-Test
Introduction
Suppose you want to answer the following
questions:
Does a new headache medicine provide the
typical time to relief of 100 minutes, or is it
different?
Does a weekend training session have an effect
on performance on an exam?
Does a new headache medicine differ in time to
relief from a standard headache treatment?
One-Sample T-test
A one-sample t-test is used to compare a
sample to an average or general
population. You may know the average
height of men in the U.S., and you could
test whether a sample of professional
basketball players differ significantly in
height from the general U.S. population. A
significant difference would indicate that
basketball players belong to a different
distribution of heights than the general
U.S. population.
Two-Sample T-test
A two-sample t-test compares two groups on some
factor. For example, one group could receive an
experimental treatment and the second group
could receive a standard of care treatment or
placebo.
Notice that in a two-sample t-test, two distinct
groups are being compared, as opposed to the
one-sample, where one group is compared to a
general average, or a matched-pairs, where only
one group is being measured twice.
Interpreting Output
From the SAS output, you can see that the
mean relief time of the 10 subjects is 98.1
minutes. The calculated t* value = -1.28,
and this test statistic has a p-value of 0.23
(this value is found under the label Pr > |
t| which stands for the probability of
getting a value greater than the absolute
value of t*). This is a two-sided test. If this
were a one-sided test, you would simply
divide the p-value by 2.
Conclusion
If alpha = 0.05, then our p-value is greater
than alpha. Therefore, we fail to reject the
null hypothesis. The new headache
medicine does not provide a different time
to relief from 100 minutes.
Interpreting Output
The difference of the mean score (d-bar: beforeafter) is -7.33; on average the scores before the
weekend were lower than the scores after the
training session. (If in your paired statement you
had typed after*before the average difference
would be 7.33.)
Is this difference statistically significant? To
answer that question, look at the p-value. The t*
for the test is -4.35, and the p-value is 0.0074.
Conclusion
If alpha = 0.05, then the p-value < alpha,
and we reject the null hypothesis.
Therefore, we can conclude that average
scores are different before and after the
weekend session, and the training does
improve test scores.
A few notes:
Notice the variable group is followed by a
$ because it is a categorical variable
The code has specified that the univariate
procedure be performed on the variable
time, but that it is done by the class
group. This way you will have separate
summary statistics, plots and histograms
for the treatment and control groups.
P
e
r
c
e
n
t
80
60
40
20
0
100
e
r
c
e
n
t
80
60
40
20
0
80
85
90
95
100
t i me
105
110
115
120
Conclusion
The t* value for unpooled variances is -3.83, and
the corresponding p-value = 0.0141, which is
less than alpha (0.05). Therefore, we reject the
null and conclude that the treatment group
differs significantly from the control group in time
to relief from headache.
Notice from the SAS output that the treatment
group took an average of about 20 minutes
longer to feel relief than the control group (Diff
(1-2)), implying the treatment is significantly
worse than the control.