ICS Week 4 - Handouts
ICS Week 4 - Handouts
4 STUDENT’S T-DISTRIBUTION
In previous sections, inferences about the population mean were made on the
assumption that the population standard deviation was known. The hypothesis test
based on the z-statistic is called z-test. When the population standard deviation (𝜎𝜎)
is unknown, estimation and hypothesis testing approach based on standard Normal
distribution cannot be used as the value of 𝜎𝜎 is required in both calculations. We
can then make inferences relying on t-distribution instead of standard Normal
distribution. Like the Normal distribution, the t-distribution is bell-shaped and
symmetrical. It has only one parameter, the degrees of freedom. The degrees of
freedom defines the shape of a t-distribution. A t-distribution with 𝑘𝑘 degrees of
freedom is denoted as 𝑡𝑡𝑘𝑘 . With the degrees of freedom increasing, the t-distribution
is more similar to a standard Normal distribution (Figure 8).
FIGURE 8. PROBABILITY DENSITY PLOTS OF SOME T-DISTRIBUTION TOGETHER WITH THE STANDARD
NORMAL DISTRIBUTION.
In statistics, the degrees of freedom equals the sample size minus the number of
parameters to be estimated. When having a dataset of sample size 𝑛𝑛 and making
inference about the population mean based on a t-distribution, the degrees of
freedom = 𝑛𝑛 − 1, as only one parameter (i.e. the mean) is estimated. Therefore, if
the sample size is large, the degrees of freedom is also large.
Inferences based on the t-distribution are made in the same way as described for
the Normal. The only difference is in the critical values, which depend on the sample
size and significance level (𝛼𝛼). For example, given the 5% significance level (𝛼𝛼 =
0.05), the critical value of the Normal distribution is 1.96, while for a t-distribution
this is 2.57 (when 𝑑𝑑𝑑𝑑 = 5) and 1.98 (if 𝑑𝑑𝑑𝑑 = 100) (see Table 2).
Significance level
Degrees of freedom
𝜶𝜶 = 𝟎𝟎. 𝟏𝟏𝟏𝟏 𝜶𝜶 = 𝟎𝟎. 𝟎𝟎𝟎𝟎 𝜶𝜶 = 𝟎𝟎. 𝟎𝟎𝟎𝟎
5 2.02 2.57 4.03
10 1.81 2.23 3.17
20 1.73 2.09 2.85
30 1.70 2.04 2.75
50 1.68 2.01 2.68
100 1.66 1.98 2.63
150 1.66 1.98 2.61
Standard Normal Distribution 1.65 1.96 2.58
respectively, where:
Twenty patients attended an osteoporosis clinic for a bone mass density (BMD) scan.
It is known that the BMD in this sample is plausibly normally distributed with an
average of 0.8 g/cm2 and a standard deviation of 0.1 g/cm2. Given that the 95%
critical values for a t distribution with 19 degrees of freedom are ± 2.093, find the
95% confidence interval for the mean BMD.
Solution 6
• 𝛼𝛼 = 1 − 95% = 0.05;
Notice that rounding to two decimal places is done at the last stage of the
calculation. Rounding in earlier stages may induce errors.
A standard is set of no more than 300 parts pollution per million for air in a city. In
a sample of measurements at 15 random locations, the reading was plausibly
normally distributed with a mean of 303 parts pollution per million and a standard
deviation of 3.6 parts per million. Can the city authorities claim they are achieving
the standard?
Solution 7
• 𝐻𝐻0 : The population mean pollution reading = 300 parts per million;
• 𝐻𝐻1 : The population mean pollution reading ≠ 300 parts per million.
6. Because the value of the test statistic is in the critical region (𝑡𝑡 = 3.23 > 2.145),
the null hypothesis is rejected at the 5% level of significance. Therefore, the city
authorities cannot claim they are achieving the standard of 300 parts pollution
per million for air in the city.
Note that if carrying out a one-sample t-test using statistical software, a p-value will
be given. The decision rule for the ‘p-value approach’ is always the same. For
example, if significance level is taken to be 0.05, then
SAQ 3:
Essentially, the procedure is the same as before. However, there is one further and
important consideration: the relationship between the two samples. Consider the
following scenarios.
Scenario 1: A new treatment for eczema has been developed and a trial is set up to
determine if it is more effective than the current preparation of choice. Each patient
is given both treatments simultaneously, applying the new preparation to one side
of the body and the existing formula to the opposite side.
Superficially these two scenarios are similar but there is one essential difference. In
the first case, the outcomes of the treatments will be dependent because they are
applied to the same individual, albeit on different sides of the body. These are
paired observations. In the second case, however, the casts will be applied to
different individuals and the outcomes will be independent.
The tests described here can be extended to more than two groups. The techniques
are broadly known as analysis of variance (ANOVA). Details are beyond the scope of
this unit but are described in Altman (1997).
A study is designed to determine if a new treatment for asthma is more effective than
the existing preparation. Subjects are matched by age, severity of illness and previous
treatment history, which are the factors known to affect asthma. Are the outcomes
dependent or independent? Why?
Solution 8
SAQ 4:
b) Levels of lead are measured in samples of blood taken from two different groups
of children. The first group live near a lead smelter and the second group live in
an unpolluted area. Each child in the smelter group is matched for age and
gender with a child in the unpolluted area.
d) Two analgesics are compared in two groups of patients with chronic pain.
e) Smoking rates have been measured in the same twenty patients selected at
random from a general practice before and six-months after, the introduction
of a health education campaign.
1. The distribution of the paired differences (not the original data) is plausibly
Normal.
2. The differences are independent of each other (i.e. the difference from the
1st pair is independent from the differences from the 2nd, 3rd, …, nth pairs).
Note this does not mean the original data are independent. Within each pair,
the data are dependent (e.g. pre-SBP & post-SBP of a same patient are
dependent).
When the two assumptions are satisfied, the inferences can be made based on the
t-distribution. The null and alternative hypotheses are:
𝐻𝐻0 : There is no difference between the two samples, i.e. the mean of the paired
differences 𝜇𝜇𝑑𝑑 = 0.
𝐻𝐻1 : There is significant difference between the two samples, i.e. the mean
difference 𝜇𝜇𝑑𝑑 ≠ 0.
𝑑𝑑̅ − 0 𝑑𝑑̅
𝑡𝑡 = = ,
𝑠𝑠𝑑𝑑 /√𝑛𝑛 𝑠𝑠𝑑𝑑 /√𝑛𝑛
The value of 𝑡𝑡, calculated using the above formula, is then compared with a critical
value 𝑡𝑡𝑛𝑛−1,𝛼𝛼 (degrees of freedom = n – 1, significance level = 𝛼𝛼). The decision rule
will be the same as the one-sample t-test, that is,
When we get {𝑑𝑑1 , 𝑑𝑑2 , … , 𝑑𝑑𝑛𝑛 }, the sample mean difference 𝑑𝑑̅ is determined by:
Ten patients with eczema were given two treatments: Preparation A and
Preparation B. Preparation A was applied to one side of the body and B to the other.
The severities of each patient’s symptoms were measured before and after
treatment and the reductions in severity were recorded. The mean difference of the
reduction in severity was 1.3 units and the standard deviation was 4.55 units. The
differences of reduction (i.e. reduction under A – reduction under B) are plausibly
normally distributed. Does this study support the notion that both preparations are
equally effective? (Usually in practice, data is given in a form of the following table)
Patient 1 2 3 4 5 6 7 8 9 10
Treatment A 𝑑𝑑1𝐴𝐴 𝑑𝑑2𝐴𝐴 𝑑𝑑3𝐴𝐴 … … … … … … 𝑑𝑑10 𝐴𝐴
Treatment B 𝑑𝑑1𝐵𝐵 𝑑𝑑2𝐵𝐵 𝑑𝑑3𝐵𝐵 … … … … … … 𝑑𝑑10 𝐵𝐵
Solution 9
Patient 1 2 3 4 5 6 7 8 9 10
Treatment A 𝑑𝑑1𝐴𝐴 𝑑𝑑2𝐴𝐴 𝑑𝑑3𝐴𝐴 … … … … … … 𝑑𝑑10 𝐴𝐴
Treatment B 𝑑𝑑1𝐵𝐵 𝑑𝑑2𝐵𝐵 𝑑𝑑3𝐵𝐵 … … … … … … 𝑑𝑑10 𝐵𝐵
Difference
𝑑𝑑1 𝑑𝑑2 𝑑𝑑3 𝑑𝑑10
(A-B)
Here:
• 𝑑𝑑1 = 𝑑𝑑1𝐴𝐴 − 𝑑𝑑1𝐵𝐵 , 𝑑𝑑2 = 𝑑𝑑2𝐴𝐴 − 𝑑𝑑2𝐵𝐵 , …, 𝑑𝑑10 = 𝑑𝑑10 𝐴𝐴 − 𝑑𝑑10 𝐵𝐵 . They are the
differences of the two treatments (A and B) in a same patient. The ten
differences themselves are independent, as they are from independent
patients.
• The mean of the differences {𝑑𝑑1 , 𝑑𝑑2 , … 𝑑𝑑10 } is 1.3 units and the standard
deviation of {𝑑𝑑1 , 𝑑𝑑2 , … 𝑑𝑑10 } is 4.55 units, i.e. 𝑑𝑑̅ = 1.3 and 𝑠𝑠𝑑𝑑 = 4.55.
• 𝐻𝐻1 : The two treatments are not equally effective, i.e. 𝜇𝜇𝑑𝑑 ≠ 0.
𝑑𝑑̅ − 0 1.3
𝑡𝑡 = = = 0.91.
𝑠𝑠𝑑𝑑 /√𝑛𝑛 4.55/√10
Generally, testing the equality of means from two independent samples is to test if
the two independent samples are from the same (plausibly Normal) population.
Necessary assumptions include:
1. The data is plausibly normally distributed. (In the above example, this
means that the HbA1c reduction in both groups, drug A and drug B, should
be normally distributed.)
2. The population variances (or standard deviation) of the two groups are
equal.
When the two assumptions are satisfied, we can test the difference in the population
means using the unpaired t-test (also known as the t-test for two independent
samples).
Suppose the two samples are of size 𝑛𝑛1 and 𝑛𝑛2 . The sample means are 𝑋𝑋�1 and 𝑋𝑋�2, and
the standard deviations are 𝑠𝑠1 and 𝑠𝑠2 , respectively. The null and alternative
hypotheses are:
We need to calculate a pooled standard deviation of the two samples, given by:
which follows the t-distribution with (𝑛𝑛1 + 𝑛𝑛2 − 2) degrees of freedom. Then the
decision rule is,
The unpaired t-test described above requires two conditions to be satisfied: (i)
Normality; and (ii) equal variances, i.e. the two population variances are equal.
Unpaired t-test is fairly robust to slight departures from Normality. But it is less robust
to unequal variances. When variances are not equal, caution should be exercised in
comparing the means, because clearly the samples are not drawn from the same
population. In such cases, there are four options:
Welch’s test modifies unpaired t-test and is suitable to use when samples are known
to have arisen from Normal distributions with unequal variances. The Welch’s test
statistic is given by:
𝑠𝑠12 𝑠𝑠22
𝑛𝑛1 + 𝑛𝑛2
𝑑𝑑𝑑𝑑 = .
𝑠𝑠14 𝑠𝑠 4
2 + 2 2
𝑛𝑛1 (𝑛𝑛2 − 1) 𝑛𝑛2 (𝑛𝑛1 − 1)
You do not need to remember these formulas as the essential idea of Welch’s test is
the same as unpaired t-test, apart from the modifications shown above. It can be
implemented by software.
A sample of nineteen severely underweight patients was divided into two groups.
Twelve were given high protein diets and seven followed a low protein regime. The
• Mean weight gain of patients on the high protein diet = 12.0 kg.
• Mean weight gain of patients on the low protein diet = 10.1 kg.
b) Determine the 95% confidence interval for the difference between the mean
weights gained with the two diets.
Solution 10
a) An unpaired t-test is appropriate as: (i) the two samples are independent; (ii)
weight gain is plausibly Normal; and (iii) the population standard deviation is
unknown. The steps of carrying out an unpaired t-test are given below:
𝐻𝐻0 : The mean weight gain on both diets are the same;
𝐻𝐻1 : The mean weight gain on both diets are not the same.
3. The two sample standard deviations are comparable. Then the pooled
standard deviation can be calculated as:
8. There is not enough evidence to suggest the weight gain on the two diets are
significantly different at the 5% significance level.
1 1
(𝑋𝑋�1 − 𝑋𝑋�2 ) ± 𝑡𝑡𝑛𝑛1 +𝑛𝑛2 −2 × 𝑠𝑠 × � +
𝑛𝑛1 𝑛𝑛2
1 1
= (12.0 − 10.1) ± �2.11 × 2.11 × � + �
12 7
= [−0.22, 4.02] .
The 95% confidence interval of the weight gain difference is -0.22 kg to 4.02 kg.
1. What do you notice about the 95% confidence interval for the difference
between the mean weight gained with the two diets?
Solution 11
2. It is possible that the difference between the mean weight gained with each diet
is equal to zero. This is equivalent to the outcome of the hypothesis test, which
concluded that both diets lead to a similar weight gain (i.e. the difference
between the mean weight gained with the two diets is zero).