The t-Test

What it’s for:

The t-test, or Student’s t-test, after a pseudonym used by its inventor, William Sealy Gosset (Zar 1996), is used to compare two means, testing the null hypothesis that the two means are equal. If the two populations have unequal variance, a different formula is used for the t-test (see below). A variation on the t-test (not described here) can be used on data collected in pairs.

Assumptions/Cautions:

Data in each treatment group must be normally distributed (parametric test).
Each data point must be independent (data cannot be paired).
Repeated t-tests cannot be used to compare >2 means. An ANOVA should be used in this situation.
How to use it:

You must first determine whether your two populations have equal or unequal variance. Use the F test to compare sample variances, and use the appropriate version of the t-test as described below.

Equal Variance

1) Calculate the test statistic (t) using the formula in the box at right (Zar 1996).

2) Calculate degrees of freedom using the formula at the bottom of the box (Zar 1996).

3) Estimate a p-value using your calculated t and df, and a computer program or table.

4) Draw a conclusion, based on the p-value from 3). See also Types of Error.

Unequal Variance

1) Calculate the test statistic (t) using the formula in the box at right (Zar 1996).

2) Calculate degrees of freedom using the formula at the bottom of the box (Zar 1996).

3) Estimate a p-value using your calculated t and df, and a computer program or table.

4) Draw a conclusion, based on the p-value from 3). See also Types of Error.

MS Excel Tips:

MS Excel includes both equal variance and unequal variance versions of the t-test in its Data Analysis Tools (found under TOOLS, DATA ANALYSIS). These tools are included in the version of Excel installed in student computer labs at The University of Lethbridge, but are not included in the default installation of Excel. Custom installation is required. Output of the test includes both the two-tailed and one-tailed p-values, reported as p(T<=t). Excel also includes a built-in TTEST function, but this reports only p, not t or df. You will be required to include these in any paper reporting statistical analysis, so use the data analysis tool. RETURN