T-test


The t-test of two paired or correlated sample means

A further commonly used form of t-test but should be used with caution. It is used when two samples are directly associated or occur in pairs.

For example, a biologist may want to determine whether there is a significant difference between foreleg and hindleg length in cats. Although these leg lengths may well differ the analysis is complicated by the fact that cats are of different sizes. Whilst we have different different cat sizes, the length of the foreleg in any one cat is proportional to that of the hindleg in the same cat and the data for each can therefore be associated in pairs for each animal.

Although this type of t-test is very powerful it should not be used in preference to the others unless you are sure that your two samples have a direct association. For example, you would not normally use this test if you were attempting to detect any statistical significant difference between the mean concentration of a particular chemical in streams at two sites. In this case, one of the other t-tests would be used, after testing the samples for normal distributions and homogeneity of variances.

This test does not deal with the original data measurements but rather the differences within each pair of measurements taken from the samples. For this reason, this test does not require samples with normal distributions or equality of variances. However, normality must be observed in the population of differences.

The non-parametric equivalent is the Wilcoxon paired sample test.

Script operation

This tool operates in much the same way as most of the others with no specific departures from the usual methods needed.

Click here for information about general script usage.

The following is the formula used in this t-test:

T Statistic Formula

Raw sample data is entered in two columns as shown. Note that this tool will not accept sample data with unequal sample sizes. Follow the worked example below to observe how summary statistics are computed for the two samples. Although the difference values for each data pair are calculated they are not printed to the spreadsheet except in the form of the mean value. Note that any raw data labels included within the input range are not reproduced in the output because this deals with statistics based on difference values only.

 Raw data:      	Spreadsheet output:

 Stress  Non-stress     T-Test: Two Means for Correlated Samples
      7 	  5
      9 	 15     Mean of Diff.:  	    -1.3
      4 	  7     Variance:       	 12.2333
     15 	 11     St.Dev.:		  3.4976
      6 	  4     St.Err.:		   1.106
      3 	  7     t:      		 -1.1754
      9 	  8     Count:  		      10
      5 	 10     d.f.:   		       9
      6 	  6     P(T<=t) one-tail:       0.135004
     12 	 16     T-Critical (95%):         1.8331
			T-Critical (99%):         2.8214
			P(T<=t) two-tail:       0.270007
			T-Critical (95%):         2.2622
			T-Critical (99%):         3.2498

Interpretation

In the matched-pairs or correlated sample t-test the hypotheses in the standard two-tailed test may take the form of:

HO: mean difference = 0; HA: mean difference is not = 0

Therefore retain HO. At the 0.05 level of significance (95% probability) the t-critical value of +2.2622 or -2.2622 is not exceeded by the value of the t-statistic. There is no significant difference between the two samples. i.e.,

t: -1.1754
d.f.: 9
P: >0.05 (i.e., 0.270007)

For both the one-tailed test and two-tailed tests the exact probability of obtaining the computed t-statistic is presented in the output.



Back to Main Document