Statistics Dictionary
To see a definition, select a term from the dropdown text box below. The statistics
dictionary will display the definition, plus links to related web pages.
Select term:
TwoSample tTest
A twosample ttest is used to test the difference (d_{0})
between two population means. A common application is to determine
whether the means are equal.
Here is how to use the test.

Define hypotheses.
The table below shows three sets of null and alternative hypotheses.
Each makes a statement about the difference d between
the mean of one population μ_{1} and
the mean of another population μ_{2}.
(In the table, the symbol ≠ means " not equal to ".)
Set

Null hypothesis 
Alternative hypothesis 
Number of tails 
1

μ_{1}  μ_{2} = d

μ_{1}  μ_{2} ≠ d

2 
2

μ_{1}  μ_{2} > d

μ_{1}  μ_{2} < d

1 
3

μ_{1}  μ_{2} < d

μ_{1}  μ_{2} > d

1 

Specify significance level. Often, researchers choose
significance levels
equal to
0.01, 0.05, or 0.10; but any value between 0 and
1 can be used.

Find degrees of freedom. The
degrees of freedom
(DF) is:
DF =
(s_{1}^{2}/n_{1} +
s_{2}^{2}/n_{2})^{2} /
{ [ (s_{1}^{2} / n_{1})^{2} /
(n_{1}  1) ] +
[ (s_{2}^{2} / n_{2})^{2} /
(n_{2}  1) ] }
If DF does not compute to an integer, round it off
to the nearest whole number. Some texts suggest that the
degrees of freedom can be approximated by the smaller of
n_{1}  1 and n_{2}  1; but the above formula
gives better results.

Compute test statistic. The test statistic is a t statistic (t) defined by
the following equation.
t = [ (x_{1}
 x_{2})
 d ]
/ sqrt[(s_{1}^{2}/n_{1})
+ (s_{2}^{2}/n_{2})]
where
x_{1} is the mean of sample 1,
x_{2} is the mean of sample 2,
d is the hypothesized difference between population means,
s_{1} is the
standard deviation
of sample 1,
s_{2} is the standard deviation of sample 2,
and n_{1} is the size of sample 1, and
n_{2} is the size of sample 2.

Compute Pvalue. The Pvalue is the probability of observing a
sample statistic as extreme as the test statistic. Since the
test statistic is a t statistic, use the
t Distribution Calculator
to assess the probability associated with the t statistic, having
the degrees of freedom computed above.

Evaluate null hypothesis. The evaluation involves comparing the Pvalue to the
significance level
,
and rejecting the null hypothesis when the Pvalue is less than
the significance level.
The twosample ttest can be used when the population variances are equal
or unequal, and with large or small samples.