Computational Methods
The t Statistic
The form of the t statistic used varies with the
type of test being performed.
 To compare an individual mean with a
sample of size n to a value m, use
where is the sample mean of the observations
and s^{2} is the sample variance of the observations.
 To compare n paired differences to a value m, use
where is the sample mean of the paired
differences and s^{2}_{d} is the sample variance
of the paired differences.
 To compare means from two independent samples with
n_{1} and n_{2} observations to a value m, use
where s^{2} is the pooled variance

s^{2} = [((n_{1}1)s_{1}^{2}+(n_{2}1)s_{2}^{2})/(n_{1}+n_{2}2)]
and s_{1}^{2} and s_{2}^{2} are the
sample variances of the two groups.
The use of this t statistic depends on the assumption that
, where and
are the population variances of the two groups.
The folded form of the F statistic,
F', tests the hypothesis that the variances are
equal, where

F' = [(max(s_{1}^{2},s_{2}^{2}))/(min(s_{1}^{2},s_{2}^{2}))]
A test of F' is a twotailed F test because
you do not specify which variance you expect to be larger.
The pvalue gives
the probability of a greater F value under the
null hypothesis that .The Approximate t Statistic
Under the assumption of unequal variances, the approximate
t statistic is computed as
where

w_{1} = [(s_{1}^{2})/(n_{1})], w_{2} = [(s_{2}^{2})/(n_{2})]
The Cochran and Cox Approximation
The Cochran and Cox (1950) approximation of the probability level
of the approximate t statistic is the value of p such that

t' = [(w_{1}t_{1}+w_{2}t_{2})/(w_{1}+w_{2})]
where t_{1} and t_{2} are the critical values of the
t distribution corresponding to a significance level of
p and sample sizes of n_{1} and n_{2}, respectively.
The number of degrees of freedom is undefined when .In general, the Cochran and Cox test tends
to be conservative (Lee and Gurland 1975).
Satterthwaite's Approximation
The formula for Satterthwaite's (1946) approximation for the
degrees of freedom for the approximate t statistic is:

df = [( (w_{1}+w_{2})^{2} )/( ( [(w_{1}^{2})/(n_{1}1)]+[(w_{2}^{2})/(n_{2}1)] ) )]
Refer to Steel and Torrie (1980) or Freund,
Littell, and Spector (1986) for more information.
The form of the confidence interval varies with the statistic
for which it is computed. In the following confidence intervals involving
means, is the
% quantile of the t distribution with
n1 degrees of freedom.
The confidence interval for
 an individual mean from a sample of size n compared
to a value m is given by
where is the sample mean of the observations
and s^{2} is the sample variance of the observations
 paired differences with a sample of size n differences
compared to a value m is given by
where and s^{2}_{d} are the sample mean and sample variance
of the paired differences, respectively
 the difference of two means from independent samples with
n_{1} and n_{2} observations compared to a value m is given by
where s^{2} is the pooled variance

s^{2} = [((n_{1}1)s_{1}^{2}+(n_{2}1)s_{2}^{2})/(n_{1}+n_{2}2)]
and where s_{1}^{2} and s_{2}^{2} are the
sample variances of the two groups.
The use of this confidence interval depends on the assumption that
, where and
are the population variances of the two groups.
The distribution of the estimated standard deviation of a mean is not
symmetric, so alternative methods of estimating confidence
intervals are possible. PROC TTEST computes two estimates. For
both methods, the data are assumed to have a normal distribution
with mean and variance , both unknown. The methods are
as follows:
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.