Lecture note 2
ONE AND TWO-RELATED SAMPLE TEST ON MEANS VECTOR: HOTELLING
T2
A statistical hypothesis is an assumption about a population which may or may not be true.
Hypothesis testing is a set of formal procedures used by statisticians to either accept or reject
statistical hypotheses.
Statistical hypotheses are of two types:
• Null hypothesis, 𝑯𝟎 - represents a hypothesis of chance basis.
• Alternative hypothesis, 𝑯𝟏 - represents a hypothesis of observations which are
influenced by some non-random cause.
Hypothesis testing consists of following four steps:
1. State the hypotheses -This step involves stating both null and alternative hypotheses.
The hypotheses should be stated in such a way that they are mutually exclusive. If one
is true then other must be false.
2. Formulate an analysis plan - The analysis plan is to describe how to use the sample
data to evaluate the null hypothesis. The evaluation process focuses around a single
test statistic.
3. Analyze sample data - Find the value of the test statistic (using properties like mean
score, proportion, t statistic, z-score, etc.) stated in the analysis plan.
4. Interpret results - Apply the decisions stated in the analysis plan. If the value of the
test statistic is very unlikely based on the null hypothesis, then reject the null
hypothesis.
There are two type errors in hypothesis testing
= Type I error, = Type II error
A. ONE-SAMPLE MULTIVARIATE CASE
A one random sample of N p-vector valued random variables can be written as a matrix
𝑦11 𝑦12 … 𝑦1𝑝
𝑦21 𝑦22 … 𝑦2𝑝
𝒀=[ ]
⋮ ⋮ ⋱ ⋮
𝑦𝑁1 𝑦𝑁2 … 𝑦𝑁𝑝
For testing groups of means for one sample
Hypothesis :
𝜇1 𝜇01 𝜇1 𝜇01
𝜇2 𝜇02 𝜇2 𝜇02
𝐻0 : [ ⋮ ] = [ ⋮ ] (specified) 𝐻1 : [ ⋮ ] ≠ [ ⋮ ] (say)
𝜇𝑝 𝜇0𝑝 𝜇𝑝 𝜇0𝑝
Statistical test
𝑇 2 = 𝑁𝐷2 where 𝐷 2 = (𝒚
̅ − 𝝁)𝑇 𝑆 −1 (𝒚
̅ − 𝝁) called Mahalanobis Distance
̅ = mean vector of observations
𝒚
𝝁 = mean vector of specified values
𝑆 = sample varian covarian matrix
N = number of observations
2
Reject 𝐻0 if 𝑇 2 > 𝑇1−𝛼,𝑝,𝑁−1
Alternatively, reject 𝐻0 if one of the following is true
• F criterion
(𝑁−𝑝)𝑇 2
> 𝐹𝛼,𝑝,𝑁−𝑝
(𝑁−1)𝑝
• Wilks criterion
1−Λ (𝑁−𝑝) 1
> 𝐹𝛼,𝑝,𝑁−𝑝 where Λ = 𝑇2
Λ 𝑝 1+[ ]
𝑁−1
• Roy criterion
(𝑁−𝑝) 𝜃𝑠 𝜆
> 𝐹𝛼,𝑝,𝑁−𝑝 where 𝜃𝑠 = 1+𝜆1 , 𝜆1 = the largest eigen value of S
𝑝 1−𝜃𝑠 1
• Lawley-Hotteling criterion
(𝑁−𝑝) 𝑇02 0 𝑇2
> 𝐹𝛼,𝑝,𝑁−𝑝 where 𝑁−1 = 𝜆1
𝑝 𝑁−1
Confidence interval
𝒂𝑇 𝑆𝒂 𝒂𝑇 𝑆𝒂
̅ − 𝑐0 √
𝒂′ 𝒚 ̅ + 𝑐0 √
≤ 𝒂′ 𝝁 ≤ 𝒂′ 𝒚
𝑁 𝑁
where 𝒂′ is a vector 0’s and 1 to indicate which dependent variable to be interested and
2
𝑐0 = 𝑇𝛼,𝑝,𝑁−1 . For two independent variables, 𝒂′ = [ 1 0] for the first variabel or 𝒂′ =
[ 0 1] for the second variable.
Example:
A random number of 𝑁 students enroll in an algebra course annualy. It has been the
instructor’s practice to administer an exam at the beginning of the course to test students’s
basic mathematics preparation (BM) and skill in dealing with word problems (WP). The
instructor hopes to find out from the examination whether his students’ preparation differs
from the school district’s standard, which shows scores in these areas to be 𝜇01 = 80 and
𝜇02 = 50. For a new term, the instructor has a class enrollment of 𝑛 = 28 students and
obtains the scores summarized in the following table.
Subject BM WP Subject BM WP
1 72 66 15 91 79
2 60 53 16 56 68
3 56 57 17 79 65
4 41 29 18 81 80
5 32 32 19 78 55
6 30 35 20 46 38
7 39 39 21 39 35
8 42 43 22 32 30
9 37 40 23 60 50
10 33 29 24 35 37
11 32 30 25 39 36
12 63 45 26 50 34
13 54 46 27 43 37
14 47 51 28 48 54
The question is, “Does the students’s preparation in basic mathematics and word problems
differ from the district’s standard?” If so, on which variables?
(1) The hypotheses to be tested
𝜇1 80
𝐻0 : [𝜇 ] = [ ]
2 50
𝜇1 80
𝐻1 : [𝜇 ] ≠ [ ] with a significance level 𝛼 = 0.05
2 50
2
(2) Criteria: Reject 𝐻0 if 𝑇 2 > 𝑇0.05,2,27 = 6.997
We have
50.536
̅=[
𝒚 ]
46.179
290.406 223.753
𝑆= [ ]
223.753 219.930
0.015932 −0.016209
𝑆 −1 = [ ]
−0.016209 0.021038
𝑇 2 = 293.69 .
2
Since 𝑇 2 = 293.69 > 𝑇0.05,2,27 = 6.997 then 𝐻0 is rejected.
To determine whether one or both variables contributed to rejection of 𝐻0 , the confidence
intervals are used.
For BM, 𝒂′ = [1 0] then
290.406 290.406
50.536 − 2.645√ ≤ 𝜇1 ≤ 50.536 − 2.645√
28 28
42.02 ≤ 𝜇1 ≤ 59.05
This interval does not include 𝜇01 = 80, we may conclude that variable 1, basic mathematics
skill contributed to the rejection of 𝐻0 .
For WP, 𝒂′ = [0 1] then
219.930 219.930
46.179 − 2.645√ ≤ 𝜇2 ≤ 6.179 − 2.645√
28 28
38.77 ≤ 𝜇2 ≤ 53.59
Since this interval include 𝜇02 = 50, it may be stated that variable 2, word problem skill did
not significantly contribute to the rejection of 𝐻0 .
Since the overall multivariate test is significant, a simple t intervals might be constructed for
each elemen of with 𝑐0 = 𝑡𝛼,𝑛−1. Using 𝑐0 = 𝑡0.025,27 = 2.052, interval for each element
2
become
43.93 ≤ 𝜇1 ≤ 57.14
40.43 ≤ 𝜇2 ≤ 51.93
We can also use Bonferroni method, with 𝑐0 = 𝑡 𝛼 ,𝑛−1 where in this example k= 2. Using
2𝑘
𝑐0 = 𝑡0.05,27 = 2.375, interval for each element become
4
290.406 290.406
50.536 − 2.375√ ≤ 𝜇1 ≤ 50.536 − 2.375√
28 28
42.88 ≤ 𝜇1 ≤ 58.18
and
219.930 219.930
46.179 − 2.375√ ≤ 𝜇2 ≤ 6.179 − 2.375√
28 28
39.52 ≤ 𝜇2 ≤ 52.84
B. TWO SAMPLE MULTIVARIATE CASE - PAIRED OBSERVATION
N p-vector paired observation can be represented as follows.
Treatment 1 Treatment 2
𝑦111 𝑦112 … 𝑦11𝑝 𝑦211 𝑦212 … 𝑦21𝑝
𝑦 𝑦122 … 𝑦12𝑝 𝑦 𝑦222 … 𝑦22𝑝
[ 121 ] [ 221 ]
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
𝑦1𝑁1 𝑦1𝑁2 … 𝑦1𝑁𝑝 𝑦2𝑁1 𝑦2𝑁2 … 𝑦2𝑁𝑝
The subsripts ijk denote the kth variable (characteristic) for the jth subject and the ith
treatment. The same subjects are treated twice in these treatments.
Matrix of differences is denoted by
𝑑11 𝑑12 … 𝑑1𝑝
𝑑21 𝑑22 … 𝑑2𝑝
⋮ ⋮ ⋱ ⋮
𝑑
[ 𝑁1 𝑑 𝑁2 … 𝑑 𝑁𝑝 ]
where 𝑑𝑖𝑗 = 𝑦1𝑗𝑘 − 𝑦2𝑗𝑘 for 𝑗 = 1, … , 𝑁 and 𝑘 = 1, … , 𝑝.
For testing groups of difference means for two related sample, the difference means from two
related sample are treated as in one sample case.
Hypotesis :
𝜇11 − 𝜇21 𝑜 𝜇11 − 𝜇21 𝑜
𝜇12 − 𝜇22 𝑜 𝜇12 − 𝜇22 𝑜
𝐻0 : 𝝉 = [ ⋮ ] = [ ⋮ ] (specified) 𝐻1 : 𝝉 = [ ⋮ ] = [ ⋮ ] (say)
𝜇1𝑝 − 𝜇2𝑝 0 𝜇1𝑝 − 𝜇2𝑝 0
2
Reject 𝐻0 if 𝑇 2 > 𝑇1−𝛼,𝑝,𝑁−1
Alternatively, reject 𝐻0 if one of the following is true
• F criterion
(𝑁−𝑝)𝑇 2
> 𝐹𝛼,𝑝,𝑁−𝑝
(𝑁−1)𝑝
• Wilks criterion
1−Λ (𝑁−𝑝) 1
> 𝐹𝛼,𝑝,𝑁−𝑝 where Λ = 𝑇2
Λ 𝑝 1+[ ]
𝑁−1
• Roy criterion
(𝑁−𝑝) 𝜃𝑠 𝜆
> 𝐹𝛼,𝑝,𝑁−𝑝 where 𝜃𝑠 = 1+𝜆1 , 𝜆1 = the largest eigen value of S
𝑝 1−𝜃𝑠 1
• Lawley-Hotteling criterion
(𝑁−𝑝) 𝑇02 0 𝑇2
> 𝐹𝛼,𝑝,𝑁−𝑝 where 𝑁−1 = 𝜆1
𝑝 𝑁−1
Confidence interval
𝒂𝑇 𝑆𝒂 𝒂𝑇 𝑆𝒂
̅ − 𝑐0 √
𝒂′ 𝒅 ̅ + 𝑐0 √
≤ 𝒂′ 𝝉 ≤ 𝒂′ 𝒅
𝑁 𝑁
Example:
In the study of motor skill performance under two conditions of body cooling with two types
of hand protection, data which reflect the accuracy of a complex training task were obtained
as follows.
condition 1 condition 2
subject y1j1 y1j2 y2j1 y2j2
1 33.5 6.0 19.8 5.0
2 52.8 65.0 30.0 5.5
3 52.0 37.0 21.9 17.9
4 56.9 14.0 28.9 2.0
5 40.9 6.2 43.8 8.1
6 72.0 78.4 64.3 49.0
7 55.6 31.0 47.2 20.0
8 64.4 10.0 36.4 3.0
9 72.8 68.0 50.5 37.9
10 62.7 19.0 47.4 39.0
𝜇 −𝜇 𝑜
𝐻0 : [𝜇11 − 𝜇21 ] = [ ]
12 22 𝑜
Matix of diffefences is
13.7 1.0
22.8 59.5
30.1 19.1
28.0 12.0
−2.9 −1.9
7.7 29.4
8.4 11.0
28.0 7.0
22.3 30.1
[15.3 −20.0]
From which, we have
̅ = [17.34]
𝒅
14.72
116.047 68.254
𝑆= [ ]
68.254 469.695
0.0094225 −0.0013692
𝑆 −1 = [ ]
−0.0013692 0.0023280
𝑇 2 = 26.32 .
2
Since 𝑇 2 = 26.32 > 𝑇0.05,2,9 = 10.033 then 𝐻0 is rejected.
To determine whether one or both variables contributed to rejection of 𝐻0 , the confidence
intervals are used.
For hand protection 1, 𝒂′ = [1 0] then
116.047 116.047
17.34 − 3.1675√ ≤ 𝜇11 − 𝜇21 ≤ 17.34 + 3.1675√
10 10
6.55 ≤ 𝜇11 − 𝜇21 ≤ 28.13
For hand protection 2, 𝒂′ = [0 1] then
469.695 469.695
14.72 − 3.1675√ ≤ 𝜇12 − 𝜇22 ≤ 14.72 + 3.1675√
10 10
−6.99 ≤ 𝜇12 − 𝜇22 ≤ 36.42
These intervals indicate that hand protection 1 but not two, conttributed significantly to
rejection of the hypothesis.