Two-Sample t-Tests Module 11 January 23, 2008

Two-Sample t-Tests
Module 11
January 23, 2008
This module focuses on a new PROC step called PROC TTEST. PROC TTEST tests
whether two means are equal. The p-values are reported where the two variances are
unequal. In the example below, the only unfamiliar command should be the CLASS
statement. This simply identifies the variable that you are testing for unequal mean or
Example 11.1 We wish to test whether boys run faster than girls. We have sample running times for boys and girls in two different races. In the first race we wish to see if the
running times were different. In the second race we want to know if boys run faster than
girls. Here is the program we would use.
filename datain ’running.dat’;
data one;
infile datain;
input class 1 gender $ 3 minute1 5 second1 7-8 minute2 10 second2 12-13;
race1 = minute1*60 + second1;
race2 = minute2*60 + second2;
proc ttest data=one;
class gender;
var time1 time2;
From the output we can see a few things. For the first race, the null hypothesis is always
that the variances from the two groups are equal. The test is reporting an F-statistic of
4.87 with a p-value of 0.0382. Remember that we reject the null hypothesis if the p-value
is less than our significance level, usually set at 5%.