T-test


The t-test of two independent sample means-assuming unequal variances

This is similar to the usual t-test but is designed for testing samples which are normally distributed but with statistically significant differences in variances. This is effectively a compromise, indicating that the t-test is fairly 'robust' when its requirements (i.e., normal distribution and equal variances) are not entirely met. There is a greater danger of falsely rejecting or retaining a null hypothesis with this method, although the chance of this can be reduced by using large sample sizes with equal amounts of data in each.

The comparison of means of two normally distributed samples with unequal variances is known as the 'Behrens-Fisher problem'. Although several solutions exist, the script included is one of the most reliable ways of undertaking such procedures and produces what is known as 'Welch's approximate t'. An associated approximated degrees of freedom is also determined.

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) are computed for the two columns and these have been labelled in the output under the headings 'Column 1' and 'Column 2'. Notice how the original samples were labelled as 'Sample A' and 'Sample B' but that these titles were not incorporated in the output by inclusion in the input data range.

 Raw data:         Spreadsheet output:

 SampleA  SampleB  T-Test:Two Means for Independent Samples:Unequal Variances
      74       66       		 Column 1   Column 2
      69       62  Count:       		8          8
      70       63  Sum: 		      557        499
      71       64  Mean:		   69.625     62.375
      73       65
      68       61  Standard Error:         1.8504
      71       63  Welchs approx. t:        3.918
      61       55  First d.f.:  		7
		   Second d.f.: 		7
		   Approx. d.f.:	    13.62
		   P(T<=t) one-tail:     0.000883
		   T-Critical (95%):       1.7709
		   T-Critical (99%):       2.6503
		   P(T<=t) two-tail:     0.001765
		   T-Critical (95%):       2.1604
		   T-Critical (99%):       3.0123

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.1604 and -2.1604. The test statistic value of 't' (3.918) is seen to exceed the critical value and the null hypothesis should therefore be rejected 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.

Note that if use of statistical distribution tables is being employed, the approximation that assigns a number of degrees of freedom to 't' does so in order that the ordinary t-distribution table may be used. Although the degrees of freedom may be non-integer this must be rounded to the nearest integer when entering the t-distribution table.



Back to Main Document