Difference of means test (t-test)

The significance of differences between a sample mean, and a (perhaps hypothetical) “true” mean, or between two sample means, can be assessed using the t-statistic calculated as part of the t-test.  The t-statistic may be thought of as a scaled difference between the two means, where the absolute difference between means is rescaled using and estimate of the variability of the means.  The reference distribution for the t-statistic is the t-distribution, shape of which varies slightly as a function of sample size for , and strongly resembles the normal distribution in its shape.

The one-sample t-statistic is

                                             

where  is the sample mean,  is the true or hypothetized mean,  is the sample standard deviation, and  is the sample size.  The specific t-distribution that serves as the reference distribution for the t-statistic depends on the “degrees of freedom” (df) of the test statistic.  For this one-sample test,  

The two-sample t-statistic is

                                           

Where  and  are the means of the two samples, and  is a measure of the variability of the differences between the sample means.  When the population variances are assumed to be equal, a pooled variance estimate is calculated as the weighted average (by sample size) of the two sample variances

                            

and then

                   .

The degrees of freedom that define the specific t-distribution for this straightforward case is given by

                                         

If the population variances are not assumed to be equal, the separate sample variances are used as an estimate of :

                           

In this more complicated case, the degrees of freedom is given by

                 .