T-test


The t-test of two independent sample means

In common with other t-tests, this tool is based on detection of statistically significant differences in the mean values obtained from two data samples.

A very common form of t-test that should not be employed if there are significant differences in the variance of both samples. In common with many other t-tests it also assumes that the samples are drawn from a normally distributed population.

image of t distribution

The alternative non-parametric equivalent of this test is the Mann-Whitney 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 in this example summary statistics (i.e., the count (or 'n'), the sum, and the mean, etc.) are computed for the two columns and these have been labelled in the output under 'Group A' and 'Group B'. If sample data columns contain titles this can be reproduced in the output by including these in the input data range.

 Raw data:             Spreadsheet output:		

 Group A   Group B     T-Test: Two Means for Independent Samples
						 Group A       Group B
      16	20     Count:   		       8	     6
       9	 5     Sum:     		      88	    48
       4	 1     Mean:    		      11	     8
      23	16
      19	 2     Pooled variance: 	 60.1667
      10	 4     Std. Deviation:  	  7.7567
       5	       Std. Error:      	  4.1891
       2	       t:       		  0.7161
		       d.f.:    		      12
		       P(T<=t) one-tail:	0.243803
		       T-Critical (95%):	  1.7823
		       T-Critical (99%):	   2.681
		       P(T<=t) two-tail:	0.487606
		       T-Critical (95%):	  2.1788
		       T-Critical (99%):	  3.0545

Interpretation

Using the example above, the results are provided for both one-tailed and two-tailed tests at both the 95% and 99% levels of probability or significance.

The null hypothesis for a two-tailed test may take the form of:

"There is no statistically significant difference in the means of the two samples and they are derived from the same data population. Any observed difference is the product of chance sampling".

This null hypothesis should be rejected when the value of 't' determined is seen to exceed the critical value for a given one-tailed or two-tailed test at a given probability level. i.e.,

As the is symmetrical about the mean the rejection region for a two-tailed test at P=0.05 (95% level) falls beyond +2.1788 and -2.1788. This is not exceeded by the test statistic value of 't' (0.7161) and therefore the null hypothesis should be retained at this level.

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