Professional Documents
Culture Documents
Multi Variate Regression 2 X 2
Multi Variate Regression 2 X 2
Multi Variate Regression 2 X 2
Michael Friendly
Psychology 6140
1 Quantitative
y=X
2+ Quantitative
Y=XB
Quantitative
Regression
Multivariate regression
Categorical
ANOVA
MANOVA
Both
General MLM
Homogeneity of regression
MANCOVA
Multivariate regression
proc reg;
model y1-y4 = x1 x10;
But this:
Does not give simultaneous tests for all regressions
Does not take correlations among the ys into account
y1 " y p
Ynu p
x1 x 2
The LS solution, B =
" p
Enu p
" xq 1
SAS:
(XX)-1
XY gives same
coefficients as fitting p models separately.
(Omitting here: consideration of model selection
for each model)
R:
mod1<-lm(cbind(SAT, PPVT, Raven) ~ n+s+ns+na+ss, data=lo_ses)
Manova(mod1)
5
Coefficients:
(Intercept)
n
s
ns
na
ss
SAT
0.208
SAT
4.151
-0.609
-0.050
-1.732
0.495
2.248*
PPVT
0.511**
PPVT
33.006
-0.081
-0.721
-0.298
1.470*
0.324
Raven
0.222
Raven
11.173
0.211
0.065
0.216
-0.037
-0.052
Publish or perish? Doesnt look like there is much predictive power here!
Statistic
Wilks' Lambda
Pillai's Trace
Hotelling-Lawley
Roy's Max Root
7
Value
0.343
0.825
1.449
1.055
F Value
2.54
2.35
2.72
6.54
M=0.5
N=13.5
Num DF Den DF
15
15
15
5
80.46
93
49.77
31
Pr > F
0.0039
0.0066
0.0042
0.0003
8
y1
H0 : Lr uq Bqu p
E01 E02
E11 E12
E 21 E 22
E31 E32
Examples of GLH:
p=2 responses: y1, y2
q=3 predictors: X1 X3
(a)
No effect of X2, X3
H0 : 2
0r u p
T0
T
1
T2
T
3
0 0 1 0
LB
0 0 0 1
02u1
y2
Intercept
X1
X2
X3
T2
T
3
(b)
E
H0 : 21
E 22
E31
E32
0 1 1 L B
( 2 3 )
mtest x2-x3;
L B Mput
10
Extended GLH
H0 :
1
1
LBM
mtest y1-y2;
I,
E01 E02
E11 E12
E 21 E 22
E31 E32
12
1 T 1
T
MSH
o (MSH F u MSE )
MSE
0 is
| H OE | 0
13
14
15
16
|HE-1 - I| = 0
1, 2, , s = roots of |H(H+E)-1 - I| = 0
Oi
Ti
1 Ti
Oi
1 Oi
Ti
17
i 1 1 Oi
Pillai:
(1 Ti )
i 1
|E|
|HE|
1 1/ t mt 2k
u
~ F ( pnh , mt 2k )
1/ t
pnn
Association:
=1
1/s =
18
NB: df not
always integers
i 1
2n s 1
V
u
2m s 1 s V
tr [HE1 ]
2 = V/s
Ti
O 1 T
2 = H/(H+s)
i 1
19
T 1 O
tr [H(H E) ]
Hotelling-Lawley:
H
geometric mean
Oi
1
2(ns 1)
u H ~ F [s(2m s 1),2(ns 1)]
2
s (2m s 1)
20
dimension of H relative to E
R = 1
F
ne nh s
s
responses, of predictor xi
L = ( 0,0, , 1, 0,0)(1xq) in GLH
H = iT (XTX)-1i a rank 1 matrix (s=1)
All multivariate tests are exact & have the
same p-values
More parsimonious than separate univariate
tests for each response.
2 = R/(R+1)
~
F (s, ne nh s )
(Exact if s=1)
21
> Manova(mod1)
Type II MANOVA Tests: Pillai test statistic
Df test stat approx F num Df den Df Pr(>F)
n
1
0.0384
0.3856
3
29 0.76418
s
1
0.1118
1.2167
3
29 0.32130
ns 1
0.2252
2.8100
3
29 0.05696 .
na 1
0.2675
3.5294
3
29 0.02705 *
ss 1
0.1390
1.5601
3
29 0.22030
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Value
F Value
Wilks' Lambda
Pillai's Trace
Hotelling-Lawley
Roy's Max Root
0.733
0.267
0.365
0.365
3.53
3.53
3.53
3.53
Num DF
3
3
3
3
22
Den DF
Pr > F
29
29
29
29
0.0271
0.0271
0.0271
0.0271
23
They give a compact summary for all predictors, for a given test statistic
Gory details are available from the summary() method
24
Oi
1 U 2
1
2
3
Canonical
Correlation
Adjusted
Canonical
Correlation
Approximate
Standard
Error
Squared
Canonical
Correlation
0.716526
0.490621
0.266778
0.655198
0.414578
0.211906
0.081098
0.126549
0.154805
0.513409
0.240709
0.071170
1
2
3
1 O
Eigenvalue
Difference
Proportion
Cumulative
1.0551
0.3170
0.0766
0.7381
0.2404
0.7283
0.2188
0.0529
0.7283
0.9471
1.0000
1
2
3
25
Likelihood
Ratio
Approximate
F Value
Num DF
Den DF
Pr > F
0.34316907
0.70525204
0.92882959
2.54
1.43
0.79
15
8
3
80.458
60
31
0.0039
0.2025
0.5078
Wilks Lambda
26
T
Y eff
Yeff
T
28
Scale:
E: E/dfe
H: H/dfe
= critical value of Roy
statistic at level
Orientation: how xi
contributes to prediction
of y1, y2
Length: relative
strength of relation
30
HE plot
matrix
Error
Regr
Regr
ss
ns
na
SAT
Error
79
+s
na n
Only NA individually
significant (in this view)
NA & S contribute to
predicting PPVT
ns
ss
4
Regr
Regr
94
na
Error
Error
s
ns
ss
PPVT
ss
NS & SS contribute to
SAT
N doesnt contribute at
all
na
40
Error
Regr
Error
Regr
+
s
+
na
ss
21
Raven
ss s
na
n
ns
31
ns
ns
8
32
Homogeneity of Regression
3D HE plot
In the R version
(heplots package), 3D
plots can be rotated
dynamically
*-- test equal slopes, by allowing interactions (separate slopes for each group);
proc glm data=rohwer;
class SES;
model sat ppvt raven = SES|n SES|s SES|ns SES|na SES|ss /ss3 nouni;
manova h=SES*n SES*s SES*ns SES*na SES*ss;
run;
*-- MANCOVA model: test intercepts (means), assuming equal slopes;
proc glm data=rohwer;
class SES;
model sat ppvt raven = SES n s ns na ss /ss3 nouni;
manova h=_all_;
run;
33
34
NB: better than reporting separate results and making eyeball comparisons
35
36
37
> some(Adopted)
AMED BMIQ Age2IQ Age4IQ Age8IQ Age13IQ
3
14
89
126
115
113
90
6
8
64
125
109
96
87
23
6
92
116
121
119
109
30
13
78
108
90
86
80
31
16
87
113
97
101
109
32
15
63
127
121
119
101
40
8
95
140
130
126
118
42
15
65
110
111
114
95
52
13
74
121
132
132
113
58
11
88
112
107
110
103
38
Coefficients:
(Intercept)
AMED
BMIQ
Age2IQ
117.63046
-0.44136
0.04001
Age4IQ
93.33771
-0.02073
0.22172
Age8IQ
88.03739
-0.01216
0.30961
Age13IQ
76.84827
-0.16063
0.36747
= B (3 x 4)
39
40
> Manova(Adopted.mod)
BM
E 01 E 02
E11 E12
E
21 E 22
IQ
Age:
0 1
E 03
E13
E 23
E04
E14
E 24
13
41
42
Error
Error
AMEDReg
Age2IQ
AMED Reg
BMIQ
AMED Reg
BMIQ
BMIQ
81
Error
BMIQ
Reg
AMED
Error
145
Error
BMIQ
Reg
BMIQ
Reg
AMED
Age4IQ
Error
142
AMED
Pairwise HE plots
showing tests of AMED
& BMIQ + overall
regression
Signif. of BMIQ
largely from older ages
87
Reg Error
BMIQ
AMED
Error
Reg
BMIQ
AMED
ErrorReg
BMIQ
148
80
Error
BMIQ
Reg
Error
BMIQ
Reg
Error
BMIQ
Reg
132
AMED
AMED
AMED
2 22
23
2
43
4 4
8 82
83
2
3
13 13 13
AMED
Age8IQ
Age13IQ
66
43
44
HE plots: software
SAS macros
See: Friendly (2006): Data ellipses, HE plots ,
http://www.jstatsoft.org/v17/i06/
heplots, hemreg, hemat:
http://www.math.yorku.ca/SCS/sasmac/
R packages
Summary
MMRA multivariate tests for a collection of p
responses, each in up to s dimensions
Different test statistics combine these in different
ways, to say how big is H vs E
Canonical analysis: How many dimensions of Ys are
predicted by the Xs?
HE plots visualize the relations of responses to the
predictors
46