The t distribution
and
comparison of two means
The
material covered in the
probability and
confidence interval pages should be understood or at least be familiar to
you before proceeding.
A
Randomised Controlled Trial (RCT) can be considered the most transparent and
effective research model to compare the outcomes of two or more interventions.
The design is randomised because suitable research subjects recruited into the
trial are randomly allocated to interventions (usually according to a series of
computer generated random numbers). Consequently, subjects in each group should
not be different other than the interventions allocated. Therefore, the
difference between groups will reflect the difference between interventions.
Other outcome measures and model variations exist, but this page will only
consider differences in means (normally distributed outcome) between two
groups. Note that the assumption of a normally distributed outcome cannot
always be assured. An introduction to the t distribution is presented before
the confidence interval of the difference between two means is discussed.
William Gosset was a brewer, but had an interest in statistics. He found the
estimation of probability for the z deviate unreliable if the observations were
few. He derived a correction of the probability estimate according to sample
size and called it t. Gosset published his papers under the pseudonym of
Student and this became known as Student’s t.
Student’s t allows the use of a small number of measurements to estimate what
may be true of the whole population. This forms the basis of modern inferential
statistics, where a small number of observations are made, and the results are
generalized to the wider population.
The
t distribution curve is wider than the normal one. Therefore, a larger area (or
higher probability) of being greater than a particular deviate is obtained
compared to the normal distribution. This difference varies with sample size
(degrees of freedom), such that the probability of t approaches that of z when
the sample size increases. Conceptually, this is represented by this
diagram. With infinite degrees of freedom (i.e., a large sample size), the
t and z have the same value for a particular probability, but with fewer cases,
t will be larger than z in obtaining the same probability.
When
calculating t, a one sided or two sided area needs to be specify. A
one sided t is conceptually similar to the z, and assumes all the excluded
values are on one side of the distribution, while a
two sided t assumes the area excluded are on both sides of the t
distribution, so that each side contains only half of the excluded area. In
calculations involving the confidence interval, the two sided t is usually
used.
Measurements provide far more information than counts or binary (yes/no)
decisions, so statistical conclusion can often be made with smaller sample
sizes. As a result, the t distribution is used extensively when measurements
can be considered normally distributed.
Program to calculate relationship between t and probability
Table of critical t-values
Below is a table of critical values of t. The column headers represent the
probability of being greater than the t-value. The row headers are the degrees
of freedom while each cell contains the t-value. This is the table for the two
sided test which is commonly used for comparing differences between two means.
If the research question is to find a difference in a particular direction
(e.g., bigger than), then the one sided test is used. When degrees of freedom
reach over 40, the computer program (two sided t) can be used to calculate the
probability or t-value.
| 0.1 |
0.05 |
0.02 |
0.01 |
0.005 |
0.002 |
0.001 |
| df | | | | | | | |
| 1 |
6.3138 |
12.7065 |
31.8193 |
63.6551 |
127.3447 |
318.4930 |
636.0450 |
| 2 |
2.9200 |
4.3026 |
6.9646 |
9.9247 |
14.0887 |
22.3276 |
31.5989 |
| 3 |
2.3534 |
3.1824 |
4.5407 |
5.8408 |
7.4534 |
10.2145 |
12.9242 |
| 4 |
2.1319 |
2.7764 |
3.7470 |
4.6041 |
5.5976 |
7.1732 |
8.6103 |
| 5 |
2.0150 |
2.5706 |
3.3650 |
4.0322 |
4.7734 |
5.8934 |
6.8688 |
| 6 |
1.9432 |
2.4469 |
3.1426 |
3.7074 |
4.3168 |
5.2076 |
5.9589 |
| 7 |
1.8946 |
2.3646 |
2.9980 |
3.4995 |
4.0294 |
4.7852 |
5.4079 |
| 8 |
1.8595 |
2.3060 |
2.8965 |
3.3554 |
3.8325 |
4.5008 |
5.0414 |
| 9 |
1.8331 |
2.2621 |
2.8214 |
3.2498 |
3.6896 |
4.2969 |
4.7809 |
| 10 |
1.8124 |
2.2282 |
2.7638 |
3.1693 |
3.5814 |
4.1437 |
4.5869 |
| 11 |
1.7959 |
2.2010 |
2.7181 |
3.1058 |
3.4966 |
4.0247 |
4.4369 |
| 12 |
1.7823 |
2.1788 |
2.6810 |
3.0545 |
3.4284 |
3.9296 |
4.3178 |
| 13 |
1.7709 |
2.1604 |
2.6503 |
3.0123 |
3.3725 |
3.8520 |
4.2208 |
| 14 |
1.7613 |
2.1448 |
2.6245 |
2.9768 |
3.3257 |
3.7874 |
4.1404 |
| 15 |
1.7530 |
2.1314 |
2.6025 |
2.9467 |
3.2860 |
3.7328 |
4.0728 |
| 16 |
1.7459 |
2.1199 |
2.5835 |
2.9208 |
3.2520 |
3.6861 |
4.0150 |
| 17 |
1.7396 |
2.1098 |
2.5669 |
2.8983 |
3.2224 |
3.6458 |
3.9651 |
| 18 |
1.7341 |
2.1009 |
2.5524 |
2.8784 |
3.1966 |
3.6105 |
3.9216 |
| 19 |
1.7291 |
2.0930 |
2.5395 |
2.8609 |
3.1737 |
3.5794 |
3.8834 |
| 20 |
1.7247 |
2.0860 |
2.5280 |
2.8454 |
3.1534 |
3.5518 |
3.8495 |
| 0.1 |
0.05 |
0.02 |
0.01 |
0.005 |
0.002 |
0.001 |
| df | | | | | | | |
| 21 |
1.7207 |
2.0796 |
2.5176 |
2.8314 |
3.1352 |
3.5272 |
3.8193 |
| 22 |
1.7172 |
2.0739 |
2.5083 |
2.8188 |
3.1188 |
3.5050 |
3.7921 |
| 23 |
1.7139 |
2.0686 |
2.4998 |
2.8073 |
3.1040 |
3.4850 |
3.7676 |
| 24 |
1.7109 |
2.0639 |
2.4922 |
2.7970 |
3.0905 |
3.4668 |
3.7454 |
| 25 |
1.7081 |
2.0596 |
2.4851 |
2.7874 |
3.0782 |
3.4502 |
3.7251 |
| 26 |
1.7056 |
2.0555 |
2.4786 |
2.7787 |
3.0669 |
3.4350 |
3.7067 |
| 27 |
1.7033 |
2.0518 |
2.4727 |
2.7707 |
3.0565 |
3.4211 |
3.6896 |
| 28 |
1.7011 |
2.0484 |
2.4671 |
2.7633 |
3.0469 |
3.4082 |
3.6739 |
| 29 |
1.6991 |
2.0452 |
2.4620 |
2.7564 |
3.0380 |
3.3962 |
3.6594 |
| 30 |
1.6973 |
2.0423 |
2.4572 |
2.7500 |
3.0298 |
3.3852 |
3.6459 |
| 31 |
1.6955 |
2.0395 |
2.4528 |
2.7440 |
3.0221 |
3.3749 |
3.6334 |
| 32 |
1.6939 |
2.0369 |
2.4487 |
2.7385 |
3.0150 |
3.3653 |
3.6218 |
| 33 |
1.6924 |
2.0345 |
2.4448 |
2.7333 |
3.0082 |
3.3563 |
3.6109 |
| 34 |
1.6909 |
2.0322 |
2.4411 |
2.7284 |
3.0019 |
3.3479 |
3.6008 |
| 35 |
1.6896 |
2.0301 |
2.4377 |
2.7238 |
2.9961 |
3.3400 |
3.5912 |
| 36 |
1.6883 |
2.0281 |
2.4345 |
2.7195 |
2.9905 |
3.3326 |
3.5822 |
| 37 |
1.6871 |
2.0262 |
2.4315 |
2.7154 |
2.9853 |
3.3256 |
3.5737 |
| 38 |
1.6859 |
2.0244 |
2.4286 |
2.7115 |
2.9803 |
3.3190 |
3.5657 |
| 39 |
1.6849 |
2.0227 |
2.4258 |
2.7079 |
2.9756 |
3.3128 |
3.5581 |
| 40 |
1.6839 |
2.0211 |
2.4233 |
2.7045 |
2.9712 |
3.3069 |
3.5510 |
| 0.1 |
0.05 |
0.02 |
0.01 |
0.005 |
0.002 |
0.001 |
Determining the difference between two means is commonly carried out in both
controlled trials and in epidemiological studies. Provided the measurements are
normally distributed, this is one of the most powerful statistical tests
available, in that, a clear decision can be made with very few cases.
Formulae for the difference between two means
The
parameters used for comparing two groups of measurements are: the number of
cases, mean and Standard Deviation (SD) of the measurements in the two groups.
The nomenclature is n1, m1, and s1 for number,
mean and SD of group 1, and n2, m2, and s2 for
group 2.
-
Difference (estimated difference in means) = m1 - m2
-
Degrees of freedom, df = n1 + n2 - 2
-
Pooled Standard Deviation, s = sqrt( ( (n1-1)s12
+ (n2-1)s22 ) / df )
-
The Standard Error of the difference, SE = s x sqrt(1/n1 + 1/n2)
-
The confidence interval is, Difference ± t x SE where t is dependent on the
Type I error and the degrees of freedom.
Program to calculate difference between two means
Example calculation of the difference between two means
A controlled trial of a diet regime to promote weight loss was conducted.
Subjects were divided into two groups. Group 1 were put on the test diet
and group 2 were merely observed (the control). The weight of each subject
was measured at recruitment and at 3 months. Weight loss was then
calculated.
In group 1, there were n1 = 15 cases, mean weight loss was m1
= 5Kg and the SD of weight loss was s1 = 1Kg. In group 2, n2
= 12, m2 = 3Kg and s2 = 2Kg. What is the 95%
confidence interval of the difference between the two groups?
Answer
-
The difference in means is, 5 - 3 = 2Kg
-
Degrees of freedom, df = 15 + 12 -2 = 25
-
The pooled SD = sqrt((15-1) x 1 x 1 + (12-1) x 2 x 2) / 25 ) = sqrt((14
+ 44)/25) = sqrt(2.32) = 1.52
-
SE = 1.52 x sqrt(1/15 + 1/12) = 1.52 x sqrt(0.15) = 1.52 x 0.39 = 0.59
-
The two sided t-value for probability of 0.05 and 25 degrees of freedom
= 2.0596
-
95% CI = 2 - 2.0596 x 0.59 to 2 + 2.0596 x 0.59 = 0.79 to 3.21
-
The diet regime is better than nothing by 0.79 to 3.21 Kg of weight loss
in 3 months
Exercise in difference between two means
A multi-centre trial was conducted which involved a nutritional supplement
for feeding refugee children from a famine stricken country. A number of
reception centres were selected, and subjects divided randomly in two
groups. One group was the given the supplement and the other the usual camp
diet. The weight gained over 5 weeks is to be analysed.
The following results were obtained from the centres. Calculate differences
and 95% confidence intervals and construct a
Forest
plot of the results.
|
Supplement |
Control |
|
n |
mean |
SD |
n |
mean |
SD |
|
Centre A |
5 |
2 |
2 |
6 |
1 |
2 |
|
Centre B |
8 |
3 |
1 |
7 |
2 |
3 |
|
Centre C |
6 |
2 |
3 |
3 |
0 |
2 |
|
Centre D |
10 |
3 |
1 |
8 |
1 |
2 |
|
Centre E |
5 |
4 |
1 |
5 |
3 |
1 |
|
Centre F |
15 |
3 |
2 |
18 |
2 |
2 |
|
Centre G |
12 |
2 |
2 |
16 |
1 |
2 |
|
Centre H |
6 |
3 |
2 |
6 |
2 |
1 |
|
Combined |
67 |
2.7 |
1.8 |
69 |
1.6 |
2 |
Answer
Results of the multi-centre trial are presented in the following table. These
results show the importance of sample size. Each centre only had a few
cases and show that the supplemented babies put on more weight. However, the
sample sizes are generally too small for conclusions to be drawn. The benefits
of the supplements become much more obvious when data are pooled.
|
Supplement |
Control |
Difference |
|
n1 |
mean1 |
SD1 |
n2 |
mean2 |
SD2 |
Diff |
SE |
95%CL |
| Centre A |
5 |
2 |
2 |
6 |
1 |
2 |
1 |
1.2 |
-1.7 to 3.7 |
| Centre B |
8 |
3 |
1 |
7 |
2 |
3 |
1 |
1.1 |
-1.4 to 3.4 |
| Centre C |
6 |
2 |
3 |
3 |
0 |
2 |
2 |
1.9 |
-2.6 to 6.6 |
| Centre D |
10 |
3 |
1 |
8 |
1 |
2 |
2 |
0.7 |
0.5 to 3.5 |
| Centre E |
5 |
4 |
1 |
5 |
3 |
1 |
1 |
0.6 |
-0.5 to 2.5 |
| Centre F |
15 |
3 |
2 |
18 |
2 |
2 |
1 |
0.7 |
-0.4 to 2.4 |
| Centre G |
12 |
2 |
2 |
16 |
1 |
2 |
1 |
0.8 |
-0.6 to 2.6 |
| Centre H |
6 |
3 |
2 |
6 |
2 |
1 |
1 |
0.9 |
-1.0 to 3.0 |
| Combined |
67 |
2.7 |
1.8 |
69 |
1.6 |
2 |
1.1 |
0.3 |
0.5 to 1.7 |
The
Forest plot helps demonstrate the relationship between sample size and the
confidence interval.

Version 1.0 Last change 6th July 2006