Comparing Two Populations
Result 6.2:
If X1,1, X1,2, . . . , X1,n1 is a random sample from Np(µ1, Σ) and
X2,1, X2,2, . . . , X2,n2 is an independent random sample from Np(µ2, Σ)
(note common Σ) then
T2 =
h
X̄1 − X̄2 − (µ1 − µ2)
i0
"
!
1
1
+
Sp
n1
n2
#−1
h
X̄1 − X̄2 − (µ1 − µ2)
is distributed as
(n1 + n2 − 2) p
× Fp,n1+n2−p−1,
n1 + n2 − p − 1
where Sp is the pooled variance matrix:
Sp =
n1 − 1
n2 − 1
S1 +
S2 .
n1 + n2 − 2
n1 + n2 − 2
1
i
Example: turtle carapace dimensions
• Responses: length, width, height (mm).
• Factor: gender
• n1 = n2 = 24.
• > pairs(turtle[,1:3],
col = ifelse(turtle$Gender == "male",
"red", "blue"))
• SAS proc glm program and output.
2
110
130
●
●
● ●
●
●●● ●
●
●
●
●●
●
●●● ●
● ●
●
●
●
●● ● ●
●●
●●
● ●
●
●
● ●
130
●
●●
●●●
●
● ●
●●●
●
●●●
●● ●●
●●●●
●●
●
●
● ●
●
●
●
●
●●
●●
● ●
●●
●●
●
●
●● ●
●●
●
● ●
● ●
●
●
●●
● ●
●● ●
●
●
●
●●
●
●● ●
●
●
●
●● ●
●
Width
●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
● ●
●●
●
●
●
●
●●
●
●●
●
●
● ●
●●●
●●
●●
●
●
●●
●
120
●●●
● ●
● ●
●
●
●
100
● ●
●●
●
● ●●
● ●
●
●
●
●
● ●
●
●●
●
●
●●
●
●
●●
140
●
●● ●
●
●
●
●●●
● ●
●
●
●
●●●
●●●
●●
●●●●
●
●
●●
160
180
●
Height
●
35 40 45 50 55 60 65
90
110
●
80
●
●●
●
●
140
●
120
Length
●●
●●
100
●
●●
●
●● ●
●●● ●
●
180
90
160
80
35 40 45 50 55 60 65
3
• Unequal variance matrices: if n1 and n2 are large, T 2 is
approximately χ2
p.
• Note: so is
(n1 + n2 − 2) p
× Fp,n1+n2−p−1,
n1 + n2 − p − 1
so the analysis for equal variances is approximately valid.
4
Comparing Several Populations
• Xl,1, Xl,2, . . . , Xl,nl is a random sample from Np(µl , Σ), l =
1, 2, . . . , g.
• Samples are independent.
5
MANOVA table:
Source of
variation
Matrix sum of squares and
cross products (SSCP)
Degrees of
freedom
Treatment
Pg
= l=1 nl (x̄l − x̄) (x̄l − x̄)0
0
Pg
Pnl = l=1 j=1 xl,j − x̄l xl,j − x̄l
g−1
0
Pnl Pg
= l=1 j=1 xl,j − x̄ xl,j − x̄
Pg
l=1 nl − 1
Residuals
B
W
Pg
l=1 nl − g
Corrected
Total
B+W
Note: in proc glm, B and W are called H and E, respectively.
6
• Likelihood ratio test of H0 : µ1 = µ2 = · · · = µg is based on
Wilks’ Λ∗:
|W |
1
Λ∗ =
=
|B + W |
|W−1B + I|
• Other proposed statistics, all functions of W−1B:
– Pillai’s trace, trace B (B + W)−1 = trace
h
i
I + B−1W
h
i
−1
– Hotelling-Lawley trace, trace W B ;
– Roy’s greatest root, maximum eigenvalue of W−1B.
7
−1
;
Example: Egyptian skulls
• Responses: max breadth, base height, base length, nasal
height (mm);
• Factor: period (1 = 4000 BC, 2 = 3300 BC, 3 = 1850 BC);
• g = 3, n1 = n2 = n3 = 30.
• > pairs(skulls[, 1:4],
col = c("blue", "red", "green")[skulls$Period])
• SAS proc glm program and output.
8
145
45
Breadth
145
135
125
BHeight
●
●
●
●
● ●
●
●
●● ●
●
●●
●
●●●
●●
●●●●
●
●● ●●● ●
●● ● ●
● ● ●●
●●●●
● ●● ●●●
● ●
● ●
● ●●
● ●●● ● ●
● ●
●
● ● ●●
● ● ●
●
●
●
60
●
55
50
45
●
●
●
●
●
130
●
●
●
●
● ●
●
●●
●
●
●●●●
● ●●
●
● ● ●
●●●
● ● ● ●●
● ● ●
●
● ● ●
●
●
●●● ● ●
● ● ●
●● ● ●
●
● ●●
● ●
●
● ●
●
● ●● ●
●
●
●
● ●
●
●●
●●
●
●
●
●● ●
●● ●●●
● ●●●●● ●●●
● ● ●● ●
● ● ●● ● ● ●
●●●●●● ●●● ●●
●●●●● ●●●
●●●●
●●
●
●●
● ●
●
● ●●
● ●● ● ●
120
●
●
●
●
●● ●
●●
●
●●
●
●
●●
● ●●●●●● ●● ●
●●
● ●
●
●●●● ●● ●
●● ●
●●●
● ● ●●
● ● ●●
●●
●● ●
● ●●●● ●
● ●
●
●
●
● ●
●●
●
●
●
●
140
●
●●
● ● ●
●
● ● ● ●●
● ●
● ●
● ●●●●●
●
● ●
●
●
●● ● ●● ● ●●
●
●●●●●●●●●●
●● ●● ● ●●
●●● ● ● ●
●
● ● ●
●
●
● ●
●
● ●●
●
●
●●
●
●
●
●●●
●●●●●
●
●●
● ●
●●● ●●● ●
●
●
● ●
●
●●●● ●●
●● ●●● ● ●
●
● ●●●
● ●●●●
●●● ● ●
●●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
● ●
●●● ● ● ● ●●
●● ●●
●
●●
●●●
●
● ● ●●
●
● ●●●●
● ●●●
●
●●● ●●●
●
●●● ●● ●
● ● ●●●●●
●
●
●
●
●
●
●
●
●
●
● ●
●
140
●
●
●
●
● ● ●●● ● ●
●
●
●● ●
●
●● ●
●●●
●● ●●
● ● ●● ● ●
● ●● ● ●●
● ●●
●● ●
●●
●●●● ●
●
● ● ●●●
●●● ●
●
●
●
●
●
●●
●
●●
●
●
●
●
●
●
●
● ● ●
●
● ●● ● ●
●● ●
●● ●●●● ● ● ●
●
●● ●
● ●● ●● ●
● ● ● ●●● ●
● ●● ●
● ●●
●● ●
● ●●●
●
●● ●
●●
●●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●●●
●●● ●
●
●
●
●
●
● ●●●●
●
● ●● ●●●
●
●●
●●
●
●●●● ●
● ● ● ●
●●
●●●●
● ●
● ●●
●
●
● ●
●●
●●●
● ● ●
●
●● ●
●
●
●
●
●
110
●
●
●
●
●
●●● ●●
●
● ● ● ●
● ● ● ●
● ●
● ●●●●
●
●
●
●● ● ●
●● ● ● ●
●
●
● ● ● ●●
●●●● ● ● ●
●
● ● ●
●
● ●
●
●
● ● ● ●
●
●
●
●
●
● ●●●
●
60
130
●
55
120
●
50
●
●
●
BLength
100
135
●
90
125
●
●
● ●
●● ●
● ●● ●●
● ●●●
● ●● ●
● ● ●●●●
● ● ●●●●● ●
●
●● ●●●●●●● ●● ●
●●●
●● ● ●●
●
●● ● ●●● ● ●
●●
●●●
●● ●
●
●● ●●
●
90
100
●
NHeight
110
9
SAS 9.1
The GLM procedure now compute[s] exact p-values for three
of the four multivariate tests (Wilks’ Lambda, the HotellingLawley Trace, and Roy’s Greatest Root) and an improved Fapproximation for the fourth (Pillai’s Trace).
Specifying
MSTAT=EXACT computes exact p-values for three of the four
tests (Wilks’ Lambda, the Hotelling-Lawley Trace, and Roy’s
Greatest Root) and an improved F-approximation for the fourth
(Pillai’s Trace).
10
© Copyright 2026 Paperzz