Beruflich Dokumente
Kultur Dokumente
doc
vgg
Regresin Multivariante
1
Las v.a. Y1, Y2, ... Ys dependen linealmente de X1, X2, ... Xp ?
s + p variables cuantitativas; n observaciones
Y
explica,
X
{
{1
1
respuesta
Regresin simple
s=1 p=1
influye en 1 explicativa
cuantitativa
a explicar
1.1 El modelo:
n observaciones
yi
(n, 1)
matricialmente:
cuantitativa
= + xi1 + ui , i= 1 n
con las ui ~ N1(0,) independientes
(n, 2)
y = X + u
y
X
con
(2, 1)
(n, 1)
u ~ Nn (0, I)
vector de observaciones
conocido
matriz de diseo
conocida
vector de parmetros
desconocido
mlm_rm_1.doc
vgg
g. de l.
Regresin
2 (p+1)
Media general
Variable/s
Error residual
Total
Fuente Variacin
Variable
Error residual
Total corregida
1
1
(p)
n-2
(n-p-1)
n
SS
MSE
PX
MSR
F(R)= MSR/MSE
P1
MSM
F(M)= MSM/MSE
P1|X
y
SSR= SST-SSE= y'
2
SSM= n y
SSRm= SSR-SSm=
y - y 2
= ( y - y )( y - y )= y'
SSE= SST-SSR= ee=
= (y - y )(y - y )= yy- y y
PX
MSE
MST
P?y2
MSE
P1|X
MSRm
PX
MSE
P1
MSTm
g. de l.
SS
SSRm
n-2
SSE
n-1
P?y2
H0: = 0
F
F(Rm)= MSRm
/MSE
H1: 0
t
2
(y$ - y) t (y$ - y) /1 H0
MSR m (SSR SSM) /1
y$ y$ ny
: F1,n-2
F(Rm)=
=
= t
=
t
$
$
SSE /(n 2)
MSE
(y
y)
(y
y)
/(n
2)
e e /(n - 2)
mlm_rm_1.doc
vgg
{1
1 respuesta
cuantitativa
a explicar
2.1 El modelo:
n observaciones
s=1 p>1
X1 ,X 2 ,...X p
explican,
influyen en
1 44 2 4 43
p explicativas
cuantitativas
yi = + xi1 +p xi p + ui , i= 1 n
con los ui ~ N1(0,) independientes
(n, 1)
(n, p+1)
y = X + u
con
(p+1, 1)
(n, 1)
u ~ Nn (0, I)
matricialmente:
mlm_rm_1.doc
vgg
La estimacin del vector de medias bajo H0 ya no es la proyeccin sobre [X] sino sobre [X] Ho,
que es un subespacio dentro de [X]. La estimacin de se ha movido ho. Los residuos, eo, sern
ahora mayores que en el modelo sin restringir e o= e+ho. SSH evala la magnitud de esa
diferencia ho=eo-e. Despus, el test F decide si esa diferencia es significativa, es decir si es
difcil de obtener bajo H0 por simples variaciones en el muestreo. Para ello compara el cambio
que produce la restriccin H0 (SSH) con la variabilidad en las perturbaciones estimadas (SSE).
Utiliza el cociente MSH/MSE, que sigue una distribucin F.
Ejemplo 2:
Ejemplo 3:
0 0 1 -1 0 ... 0
________________________________________
s>1 p>1
mlm_rm_1.doc
vgg
Y ,Y ,...Y
1 14 22 4 3s
s respuestas
cuantitativas
a explicar
explican,
influyen en
s>1 p>1
X1 ,X 2 ,...X p
14243
p explicativas
cuantitativas
3.1 El Modelo:
n individuos observados (1i n) en s variables respuesta
Yj j= 1 s
y en p variables explicativas Xj j= 1 p
s respuestas del individuo i:
yi j = j+j xi1 +pj xip + uij
j=1s
siendo las perturbaciones para el individuo i: ui=(ui1,, uis)t ~ Ns(0,) independientes
(n, s)
matricialmente:
(n, p+1)
Y= XB + U,
(p+1, s)
(n, s)
Y
X
b)
columnas j
c)
matriz de observaciones
matriz de diseo
matriz de parmetros
conocida
s columnas yj
conocida
no cambia
desconocida
s
matriz de perturbaciones
desconocida
sxs
desconocida
n filas ui indeps.
s columnas uj
mlm_rm_1.doc
d) XB
columnas j
vgg
matriz de medias
desconocida
mlm_rm_1.doc
vgg
Y
=[e1||ep]
e = Y -Y
)t ( Y - Y
)
E= (Y - Y
$ =E/ n
E / (n-p-1)
3.5
estimador insesgado de
Contrastes
v=P[X]oY; e0=Y- Y
predicciones de Y y residuos bajo H0
Y
t
) ( Y -Y
) = E+H
E0= (Y - Y
sumas de cuadrados y PC residuales bajo H0
H= E0 - E ( > 0)
diferencia entre las dos matrices de SSPC.
mlm_rm_1.doc
vgg
rechazo si F grande
s r 4
2
s r 5
2
rechazo si 2 grande
tr (HE-1)
tr[EH-1]
tr (H(E+H)-1)
tr[E E0-1]
Test 4: Mayor valor propio de Roy (cota sup.): mayor v.p. de HE-1
de EH-1
En 2, 3 y 4 rechazo si grande
mlm_rm_1.doc
vgg
rechazo si F grande
1/
F=
m2 (1- )
~ Fm1, m2 ,
m1 1/
donde m1= sa ; =
s2a 2 4
s2 a 2 5
rechazo si grande
Y*=XB* + U*
H0*: AB* =K
YM=XBM + UM
H0: ABM =K
mlm_rm_1.doc
vgg
10
(0.000)
(0.000)
(0.000)
(0.001)
(0.487)
(0.000)
(0.000)
(0.003)
(0.001)
(0.202)
[ 41 42] = [0 0]
refiere coeficientes sin mezclar submodelos.
p-valor de la de Wilks= 0.0104;
se rechaza dbilmente H01.
T2) El coeficiente EDUC es el mismo en ambas ecuaciones y el EXPER tambin.
0 1 0 0 0
1
0
H02: ABM=0
con A=
M=
y
K=
1
0
0 0 0 1 0
0 1 0 0 0
0 0 0 1 0
11 12
B=
;
31 32
0 1 0 0 0
0 0 0 1 0
11 - 12
1
B =
; K=
31 - 32
0
0
(0.000)
(0.000)
(0.000)
(0.001)
R2=0.535
(0.000)
(0.000)
(0.002)
(0.000)
mlm_rm_1.doc
vgg
11
LIBNAME XX 'D:\np\rlm';
data xx.bank;
input
LCURRENT LSTART SEX JOBCAT RACE EDUC SENIOR AGE EXPERIENCE;
cards;
9.6853
10.2524
10.0345
9.4174
9.9282
10.2128
9.1050
9.3038
9.6816
9.9965
10.0858
9.6473
9.5359
10.3735
9.3927
9.5042
9.4556
10.0962
9.1378
10.2921
10.1659
9.3414
9.9035
9.4556
9.3927
9.5539
9.8119
10.1166
10.1266
10.5133
9.4174
10.6334
9.4174
10.2400
10.0266
9.5750
10.1166
9.0572
9.0711
9.0848
9.3927
9.1442
9.4415
9.3673
9.1757
9.3147
8.7578
9.2183
9.0642
10.0301
9.1050
9.0070
9.2591
9.3622
9.7527
9.6238
9.0780
8.9847
8.8901
9.5298
9.8389
9.0216
10.0123
9.4970
8.9771
9.0288
9.7642
8.8217
9.3361
9.2301
9.5324
9.4174
9.4026
9.3775
9.4076
10.0758
9.4319
9.2301
10.3546
9.4222
9.4174
10.5966
9.3927
9.1569
9.3201
9.1819
9.3927
9.4174
9.1050
9.2418
9.1881
8.8217
8.8305
9.1313
9.3876
9.0848
9.0143
8.9464
9.3038
9.1881
9.0359
9.7642
9.2873
8.6376
9.3049
9.4575
8.7948
8.6793
9.2301
9.3049
9.1582
9.1582
9.3147
8.7483
8.7483
8.7483
8.6995
9.1049
8.6482
9.2591
9.6158
8.7483
9.4724
8.7483
8.7483
8.7483
9.1377
9.5956
9.5462
9.6800
8.5941
9.3060
8.6995
9.5479
9.2103
8.9226
9.3497
8.4763
8.4118
8.4763
8.7948
8.5941
8.9226
8.4381
8.5370
8.9618
8.3138
8.6586
8.5941
9.3926
8.3848
8.4118
8.4381
8.5370
8.8530
8.7483
8.2687
8.3138
8.2687
8.9618
8.8392
8.6482
8.9862
8.6995
8.3138
8.5941
8.9618
8.3138
8.4763
8.6586
8.7483
8.6995
8.7483
8.7483
8.6995
9.5104
8.7483
8.4250
9.3497
8.6995
8.1886
9.7779
8.7483
8.5941
8.6995
8.6995
8.6995
8.6995
8.2687
8.5941
8.6482
8.1886
8.3138
8.4763
8.6995
8.3848
8.4118
8.1886
8.3138
8.3848
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
4
5
5
3
5
4
2
2
5
4
4
5
1
2
3
2
3
4
2
4
5
3
5
3
3
3
4
5
5
5
3
5
3
5
5
1
5
1
2
1
1
2
2
2
1
2
1
1
1
5
2
2
1
2
4
4
1
1
1
4
4
1
4
2
1
2
4
1
2
2
3
3
3
3
1
5
3
2
4
2
3
5
3
1
2
3
3
3
2
1
1
1
1
1
1
2
2
1
1
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
19
15
12
16
19
12
12
15
16
16
15
16
15
12
12
8
16
12
18
21
8
16
8
12
12
16
19
18
19
12
16
8
19
16
15
19
12
12
12
12
12
12
15
8
15
8
12
8
16
8
12
12
17
16
16
12
12
12
16
16
15
16
12
8
12
16
8
8
12
8
8
8
8
12
12
12
12
17
12
12
16
8
15
14
15
8
8
8
15
12
12
8
16
15
12
12
15
12
12
81
83
98
94
83
78
70
70
78
90
94
78
82
82
69
66
85
91
95
94
88
69
77
74
79
78
86
80
75
96
95
97
87
67
93
98
65
98
65
76
95
64
90
93
66
82
74
91
66
73
81
69
97
73
79
90
86
72
86
65
86
65
64
90
83
67
68
72
98
86
79
92
68
76
91
74
73
81
70
94
91
66
67
88
79
90
92
83
94
78
74
97
81
84
86
92
73
96
85
75
28.50
41.92
41.17
46.25
35.17
30.08
44.50
27.83
35.42
34.33
34.00
38.92
44.42
29.50
63.58
27.42
58.08
33.75
29.33
39.67
56.67
59.42
48.33
63.50
54.17
59.83
32.25
42.58
35.42
44.92
56.00
37.08
64.25
36.92
33.42
37.17
28.42
64.50
23.00
40.17
55.25
45.50
61.67
26.83
46.17
58.75
55.25
33.50
64.25
31.92
24.33
23.42
53.92
55.58
28.42
29.92
52.00
52.17
62.00
30.75
32.00
59.50
29.00
44.50
59.08
51.50
27.58
56.92
27.83
28.67
48.50
60.67
32.92
35.25
30.33
48.25
38.67
24.75
32.08
34.58
53.50
35.33
47.25
57.50
30.33
42.17
37.83
48.83
29.17
48.67
45.17
60.67
51.50
47.58
40.50
25.50
47.92
60.50
54.17
27.58
0.25
13.00
12.00
20.00
5.75
2.92
18.00
3.42
11.08
5.67
4.92
14.67
12.42
2.83
29.00
3.92
36.50
3.67
3.83
4.67
22.00
14.50
22.00
34.00
25.67
32.25
5.00
16.58
6.17
14.58
25.58
5.83
37.58
6.25
2.83
9.50
2.17
31.75
0.00
0.50
19.00
16.50
17.08
0.92
8.00
22.08
3.58
6.92
19.00
1.25
0.42
0.00
4.00
31.25
1.67
0.58
13.00
4.67
6.00
6.58
1.58
20.08
3.00
0.25
6.25
15.08
0.92
26.58
2.17
3.08
20.50
36.00
12.92
12.00
4.08
22.67
12.92
0.75
5.58
8.50
26.17
10.67
25.42
29.92
3.92
15.92
12.00
25.17
3.00
4.25
9.75
10.33
0.00
17.83
6.58
0.42
12.83
1.92
8.42
2.67
;
proc contents;
proc means; run;
proc gplot;
plot (LCURRENT LSTART)*( LSTART SEX JOBCAT RACE EDUC SENIOR AGE EXPERIENCE);
run;
proc reg;
modelo_COMPLETO:
model LCURRENT LSTART=EDUC SENIOR AGE EXPERIENCE;
Ho_basica_no_efecto_regresores: mtest / print /*--> "print" imprime E y H */;
*equivalente a : ;
Ho_basica_no_efecto_regresores: mtest EDUC,SENIOR,AGE,EXPERIENCE/print details;
*otros contrastes ;
Ho_no_intercept:
mtest intercept;
Ho_no_efecto_senior:
mtest SENIOR / print;
Ho_educ_iguales_exper_iguales:
mtest EDUC, EXPERIENCE, LSTART=LCURRENT ;
*
<-- matriz A --> / <-- matriz M --> ;
Ho_prueba_expresion: mtest 2*SENIOR=EDUC+EXPERIENCE, LSTART=LCURRENT;
modelo_sin_senior:
model LCURRENT LSTART=EDUC
AGE EXPERIENCE;
Ho_basica:
mtest / print;
Lstart_vs_Lcurrent:
mtest LSTART=LCURRENT;
run;
proc glm;
model LCURRENT LSTART=EDUC SENIOR AGE EXPERIENCE;
contrast 'EDUC=SENIOR' educ 1 senior -1; * --> matriz A ;
manova m=lcurrent-lstart prefix=diff;
* --> matriz M ;
run;
model y1 y2 y3=x1 x2 x3; mtest x1,x2;
mtest y1-y2, y2 -y3, x1;
mtest y1-y2;
The first MTEST statement tests the hypothesis that the x1and x2 parameters are zero for y1, y2 and
y3. The second MTEST statement tests the hypothesis that the x1 parameter is the same for all three
dependent variables. For the same model, the third MTEST statement tests the hypothesis that all
parameters except the intercept are the same for dependent variables y1 and y2.