C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc 1 Predicting

advertisement
Predicting Changes in Wealth Using the Cube Root of the Changes in Wealth as the Dependent
Variable
Vartanian: SW 541
libname in1 v6 'h:\general PSID';
data a;set in1.w94b;
if divorce=1 or separat=1 then div=1;else div=0;
if chwlth2<0 then negative=1;else negative=0;
if chwlth2<0 then chwlth2=-chwlth2;
if chwlth2=0 then chwlth2=1;
cbrt=chwlth2**(1/3);
if negative=1 then cbrt=-cbrt;
tothrs2=tothrs2/1000;
*1994 values for initial wealth;
if wealth1<5000 then initial1=1;else if wealth1=. then initial1=.;else initial1=0;
if 5000<=wealth1<22420 then initial2=1;else if wealth1=. then initial2=.;else
initial2=0;
if 22420<=wealth1<95760 then initial3=1;else if wealth1=. then initial3=.;else
initial3=0;
if 95760<=wealth1<284480 then initial4=1;else if wealth1=. then initial4=.;else
initial4=0;
if 284480<=wealth1 then initial5=1;else if wealth1=. then initial5=.;else
initial5=0;
*1994 housing values;
if hsval94=0 then hs1=1;else hs1=0;
if 0<hsval94<=54880 then hs2=1;else hs2=0;
if 54880<hsval94<=117600 then hs3=1;else hs3=0;
if 117600<hsval94<=221760 then hs4=1;else hs4=0;
if hsval94>221760 then hs5=1;else hs5=0;
if 0<youngest<6 then young=1;else if youngest=. then young=.;else young=0;
if age>=65 then old=1;else old=0;
if bigcity=. or urban=. then small=.;else if bigcity=0 and urban=0 then
small=1;else small=0;
if ne=1 or nc=1 or west=1 then north=1;else if ne=. or nc=. or west=. then
north=.;else north=0;
if
if
if
if
if
if
-10000<=fmns<=1 then inpov=1;else if fmns=. then inpov=.;else inpov=0;
1<fmns<=1.5 then nrpov=1;else if fmns=. then nrpov=.;else nrpov=0;
1.5<fmns<=2 then pov2=1;else if fmns=. then pov2=.;else pov2=0;
2<fmns<=3 then pov3=1;else if fmns=. then pov3=.;else pov3=0;
3<fmns<=5 then pov4=1;else if fmns=. then pov4=.;else pov4=0;
fmns>5 then pov5=1;else if fmns=. then pov5=.;else pov5=0;
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
1
if nbpov ne . and rural ne . and femhead ne . and married ne . and dropout ne .
and ftwork ne . and black ne . and clersal ne . and uncy ne .;
proc reg data=a outest=a1;
model cbrt=prin1 inpov nrpov pov2 pov3 pov4 black othrace female kids married div
widowed young cohabit initial1-initial4 stocks reales hs1-hs4 dropout hsg scoll
age old uncy clersal crafop servlab ftwork bigcity urban south gotmarr tothrs2
gotdiv gotwid yrsmarr yrsdiv;
weight weight;
ods output parameterestimates=Female84;
output out=y p=pred;
run;
data d;set a1;
rename prin1=prin11 inpov=inpov1 nrpov=nrpov1 pov2=pov21 pov3=pov31 pov4=pov41
initial1=initia11 initial2=initia21 initial3=initia31
initial4=initia41 black=black1 othrace=othrace1 female=female1 kids=kids1
married=married1 young=young1 stocks=stocks1 reales=reales1 hs1=hs11 hs2=hs21
hs3=hs31 hs4=hs41 dropout=dropout1 hsg=hsg1 scoll=scoll1 age=age1 old=old1
uncy=uncy1 clersal=clersal1 crafop=crafop1 servlab=servlab1 ftwork=ftwork1
bigcity=bigcity1
urban=urban1 south=south1 gotmarr=gotmarr1 tothrs2=tothrs21 gotdiv=gotdiv1
gotwid=gotwid1 yrsmarr=yrsmarr1 yrsdiv=yrsdiv1 div=div1 widowed=widow1;
cloth=1;
drop _type_;
data e;set y;cloth=1;
data f;merge d e;by cloth;
xb=pred;
xb_male=xb-female*female1;
xb_fem=xb-female*female1+female1;
xb_rich=pred-inpov*inpov1-nrpov*nrpov1-pov2*pov21-pov3*pov31-pov4*pov41;
xb_inpov=xb_rich+inpov1;
xb_nrpov=xb_rich+nrpov1;
xb_pov2=xb_rich+pov21;
xb_pov3=xb_rich+pov31;
xb_pov4=xb_rich+pov41;
xb_white=pred-black*black1-othrace*othrace1;
xb_black=xb_white+black1;
xb_othr=xb_white+othrace1;
xb_in5=pred-initial1*initia11-initial2*initia21-initial3*initia31initial4*initia41;
xb_in1=xb_in5+initia11;
xb_in2=xb_in5+initia21;
xb_in3=xb_in5+initia31;
xb_in4=xb_in5+initia41;
xb_hs5=pred-hs1*hs11-hs2*hs21-hs3*hs31-hs4*hs41;
xb_hs1=xb_hs5+hs11;
xb_hs2=xb_hs5+hs21;
xb_hs3=xb_hs5+hs31;
xb_hs4=xb_hs5+hs41;
xb_nevM=xb-married*married1-gotmarr*gotmarr1-gotdiv*gotdiv1-gotwid*gotwid1yrsmarr*yrsmarr1yrsdiv*yrsdiv1-div*div1-widowed*widow1;
xb_ngm=pred-gotmarr*gotmarr1-married*married1;
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
2
xb_gm=xb_ngm+gotmarr1;
xb_marr=pred-married*married1-gotdiv*gotdiv1-gotwid*gotwid1-div*div1widowed*widow1+married1;
xb_div=pred-gotdiv*gotdiv1-gotwid*gotwid1-div*div1-widowed*widow1married*married1+div1;
xb_wid=pred-gotdiv*gotdiv1-gotwid*gotwid1-div*div1-widowed*widow1married*married1+widow1;
xb_ngdw=pred-gotdiv*gotdiv1-gotwid*gotwid1-married*married1-div*div1widowed*widow1;
xb_gd=xb_ngdw+gotdiv1;
xb_gw=xb_ngdw+gotwid1;
xb_coll=xb-dropout*dropout1-hsg*hsg1-scoll*scoll1;
xb_drop=xb_coll+dropout1;
xb_hsg=xb_coll+hsg1;
xb_scoll=xb_coll+scoll1;
xb_prof=xb-clersal*clersal1-crafop*crafop1-servlab*servlab1;
xb_cler=xb_prof+clersal1;
xb_craf=xb_prof+crafop1;
xb_serv=xb_prof+servlab1;
xb_rur=xb-bigcity*bigcity1-urban*urban1;
xb_big=xb_rur+bigcity1;
xb_urb=xb_rur+urban1;
xb_south=xb-south*south1+south1;
xb_north=xb-south*south1;
xb_stock=xb-stocks*stocks1+stocks1;
xb_real=xb-reales*reales1+reales1;
if female=1 then do;
xb_kidl=xb-kids*kids1+kids1*0;
xb_kidh=xb-kids*kids1+kids1*2.5;
xb_ymarrl=xb-yrsmarr*yrsmarr1+yrsmarr1*26.52;
xb_ymarrh=xb-yrsmarr*yrsmarr1+yrsmarr1*0;
xb_ydivl=xb-yrsdiv*yrsdiv1+yrsdiv1*0;
xb_ydivh=xb-yrsdiv*yrsdiv1+yrsdiv1*1.54;
xb_ageh=xb-age*age1+age1*56.63-old*old1;
xb_agel=xb-age*age1+age1*27.5-old*old1;
xb_prinl=xb-prin1*prin11+prin11*(-2.05);
xb_prinh=xb-prin1*prin11+prin11*(2.21);
xb_unl=xb-uncy*uncy1+uncy1*4.76;
xb_unh=xb-uncy*uncy1+uncy1*6.46;
xb_tothl=xb-tothrs2*tothrs21+tothrs21*0.51;
xb_tothh=xb-tothrs2*tothrs21+tothrs21*3.14;
xb_FTL=xb-ftwork*ftwork1+ftwork1*0;
xb_FTH=xb-ftwork*ftwork1+ftwork1*7.42;
end;
if female=0 then do;
xb_kidl=xb-kids*kids1+kids1*0;
xb_kidh=xb-kids*kids1+kids1*1.94;
xb_ymarrl=xb-yrsmarr*yrsmarr1+yrsmarr1*0;
xb_ymarrh=xb-yrsmarr*yrsmarr1+yrsmarr1*27.28;
xb_ydivl=xb-yrsdiv*yrsdiv1+yrsdiv1*0;
xb_ydivh=xb-yrsdiv*yrsdiv1+yrsdiv1*1.59;
xb_ageh=xb-age*age1+age1*53.77-old*old1;
xb_agel=xb-age*age1+age1*27.40-old*old1;
xb_prinl=xb-prin1*prin11+prin11*(-2.05);
xb_prinh=xb-prin1*prin11+prin11*(2.33);
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
3
xb_unl=xb-uncy*uncy1+uncy1*4.83;
xb_unh=xb-uncy*uncy1+uncy1*6.64;
xb_tothl=xb-tothrs2*tothrs21+tothrs21*1.04;
xb_tothh=xb-tothrs2*tothrs21+tothrs21*3.61;
xb_FTL=xb-ftwork*ftwork1+ftwork1*.24;
xb_FTH=xb-ftwork*ftwork1+ftwork1*7.93;
end;
pred1=pred;
rich=(xb_rich)**3;
inpov=(xb_inpov)**3;
nrpov=(xb_nrpov)**3;
pov2=(xb_pov2)**3;
pov3=(xb_pov3)**3;
pov4=(xb_pov4)**3;
white=(xb_white)**3;
black=(xb_black)**3;
othrace=(xb_othr)**3;
pred=(pred)**3;
initial1=(xb_in1)**3;
initial2=(xb_in2)**3;
initial3=(xb_in3)**3;
initial4=(xb_in4)**3;
initial5=(xb_in5)**3;
hs1=(xb_hs1)**3;
hs2=(xb_hs2)**3;
hs3=(xb_hs3)**3;
hs4=(xb_hs4)**3;
hs5=(xb_hs5)**3;
gotmarr=(xb_gm)**3;
married=(xb_marr)**3;
Div=(xb_div)**3;
Wid=(xb_div)**3;
gotdiv=(xb_gd)**3;
gotwid=(xb_gw)**3;;
dropout=(xb_drop)**3;
hsg=(xb_hsg)**3;
scoll=(xb_scoll)**3;
college=(xb_coll)**3;
kidl=(xb_kidl)**3;
kidh=(xb_kidh)**3;
ymarrl=(xb_ymarrl)**3;
ymarrh=(xb_ymarrh)**3;
ydivl=(xb_ydivl)**3;
ydivh=(xb_ydivh)**3;
agel=(xb_agel)**3;
ageh=(xb_ageh)**3;
prinl=(xb_prinl)**3;
prinh=(xb_prinh)**3;
stock=(xb_stock)**3;
real=(xb_real)**3;
unl=(xb_unl)**3;
unh=(xb_unh)**3;
tothl=(xb_tothl)**3;
tothh=(xb_tothh)**3;
prof=(xb_prof)**3;
cler=(xb_cler)**3;
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
4
craf=(xb_craf)**3;
serv=(xb_serv)**3;
rur=(xb_rur)**3;
big=(xb_big)**3;
urb=(xb_urb)**3;
south=(xb_south)**3;
north=(xb_north)**3;
ftworkL=(xb_ftl)**3;
ftworkH=(xb_fth)**3;
nevmarr=(xb_nevm)**3;
Female=(xb_fem)**3;
Male=(xb_male)**3;
predict=pred;
proc means data=f;var predict inpov nrpov pov2-pov4 rich initial1-initial5 white
black othrace hs1-hs5 gotmarr married div wid gotdiv gotwid dropout hsg scoll
college kidl kidh ymarrl ymarrh ydivl ydivh agel ageh prinl prinh stock real unl
unh tothl tothh prof cler craf serv rur big urb south north ftworkl ftworkh
nevmarr male female;
weight weight;
output out=aaa;
run;
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
5
The SAS System
17:10 Monday, February 3, 2003 101
The REG Procedure
Model: MODEL1
Dependent Variable: cbrt
Weight: WEIGHT
Analysis of Variance
DF
Sum of
Squares
Mean
Square
44
4831
4875
1211653
9355533
10567186
27538
1936.56247
Root MSE
Dependent Mean
Coeff Var
44.00639
12.02779
365.87272
Source
Model
Error
Corrected Total
R-Square
Adj R-Sq
F Value
Pr > F
14.22
<.0001
0.1147
0.1066
Parameter Estimates
Variable
Intercept
Prin1
inpov
nrpov
pov2
pov3
pov4
BLACK
OTHRACE
FEMALE
KIDS
MARRIED
div
WIDOWED
young
COHABIT
initial1
initial2
initial3
initial4
STOCKS
REALES
hs1
hs2
hs3
hs4
DROPOUT
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
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
13.07256
0.38123
-23.14475
-20.69407
-23.59939
-20.56332
-15.28790
-9.62956
-7.08881
-2.62394
0.53898
6.85406
-1.45770
6.18941
-1.01361
-11.00013
40.61934
34.41435
27.79630
16.49662
3.45450
-2.15505
-6.71834
-7.39262
-7.22473
-1.29228
-5.21302
8.02565
0.46147
3.65036
3.32698
3.05000
2.32053
1.94478
2.35975
4.63767
1.39393
0.75887
3.11398
2.70144
3.81949
1.84752
5.06129
3.07804
2.92291
2.48615
2.45867
1.59583
1.81024
2.78224
3.05884
2.51040
2.38867
2.33081
1.63
0.83
-6.34
-6.22
-7.74
-8.86
-7.86
-4.08
-1.53
-1.88
0.71
2.20
-0.54
1.62
-0.55
-2.17
13.20
11.77
11.18
6.71
2.16
-1.19
-2.41
-2.42
-2.88
-0.54
-2.24
0.1034
0.4088
<.0001
<.0001
<.0001
<.0001
<.0001
<.0001
0.1264
0.0598
0.4776
0.0278
0.5895
0.1052
0.5833
0.0298
<.0001
<.0001
<.0001
<.0001
0.0305
0.2339
0.0158
0.0157
0.0040
0.5885
0.0254
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
6
The SAS System
17:10 Monday, February 3, 2003 102
The REG Procedure
Model: MODEL1
Dependent Variable: cbrt
Parameter Estimates
Variable
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
HSG
SCOLL
AGE
old
UNCY
CLERSAL
CRAFOP
SERVLAB
FTWORK
BIGCITY
URBAN
SOUTH
GOTMARR
TOTHRS2
GOTDIV
GOTWID
YRSMARR
YRSDIV
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.39953
-0.04662
0.06938
-15.42974
-2.27268
-5.73311
-3.71115
-2.64253
0.23883
5.48570
1.81425
-3.47353
8.28298
0.47443
-24.41912
-3.09902
0.02253
0.08345
1.98033
1.92487
0.11668
2.87024
0.80700
2.04659
1.80008
2.83549
0.20875
1.85917
1.54526
1.39245
2.85034
0.75324
3.04051
3.96882
0.09797
0.46948
0.71
-0.02
0.59
-5.38
-2.82
-2.80
-2.06
-0.93
1.14
2.95
1.17
-2.49
2.91
0.63
-8.03
-0.78
0.23
0.18
0.4798
0.9807
0.5521
<.0001
0.0049
0.0051
0.0393
0.3514
0.2526
0.0032
0.2404
0.0126
0.0037
0.5288
<.0001
0.4349
0.8181
0.8589
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
7
The SAS System
17:10 Monday, February 3, 2003 103
The MEANS Procedure
Variable
N
Mean
Std Dev
Minimum
Maximum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
predict
4876
10472.90
22937.00
-191590.90
253980.69
inpov
4876
329.1510027
9751.41
-218497.99
64886.78
nrpov
4876
1893.11
9522.74
-192897.46
77497.19
pov2
4876
53.6538467
9876.19
-223483.28
62709.24
pov3
4876
1981.32
9532.43
-191590.90
78212.37
pov4
4876
6167.00
11733.54
-143660.16
110873.88
rich
4876
31711.22
32912.80
-51005.61
253980.69
initial1
4876
42320.56
58294.06
-37683.85
312419.68
initial2
4876
26755.93
41553.08
-62718.65
234310.36
initial3
4876
15143.74
27780.28
-99570.29
166661.72
initial4
4876
2334.66
15196.06
-191590.90
83636.37
initial5
4876
-16252.62
29072.04
-407620.68
20202.06
WHITE
4876
11193.15
23306.63
-110726.29
253980.69
BLACK
4876
2184.11
14451.27
-191590.90
154846.29
OTHRACE
4876
4143.85
15754.31
-167359.13
177882.10
hs1
4876
7675.36
17780.40
-186586.34
181420.57
hs2
4876
7006.39
17087.29
-193269.69
175014.85
hs3
4876
7170.41
17255.58
-191590.90
176595.50
hs4
4876
14247.04
24894.41
-138321.03
238747.63
hs5
4876
16188.02
26962.87
-128208.95
253980.69
GOTMARR
4876
13487.34
25504.67
-120305.01
271563.72
MARRIED
4876
13460.46
25271.66
-63247.68
253980.69
div
4876
4645.87
15551.25
-111662.68
166528.38
Wid
4876
4645.87
15551.25
-111662.68
166528.38
GOTDIV
4876
-14989.57
30358.52
-359665.55
32938.70
GOTWID
4876
3360.80
14479.22
-123474.21
152064.42
DROPOUT
4876
5414.84
16876.75
-247855.20
196753.99
HSG
4876
12466.61
24800.99
-177531.12
271780.51
SCOLL
4876
10670.39
22719.76
-191590.90
253980.69
COLLEGE
4876
10725.74
22784.00
-191126.46
254542.02
kidl
4876
9960.01
22351.56
-202540.63
245432.07
kidh
4876
11367.96
23931.27
-188916.57
257935.14
ymarrl
4876
10303.57
22706.78
-186575.56
246996.32
ymarrh
4876
10373.84
23030.49
-192491.02
254327.90
ydivl
4876
10465.93
22926.70
-191590.90
253980.69
ydivh
4876
10620.76
23107.13
-190312.40
255580.52
agel
4876
10330.05
21399.26
-192630.45
237967.34
ageh
4876
12665.45
24093.82
-173105.59
259674.35
prinl
4876
9184.10
21118.62
-198876.74
240316.84
prinh
4876
11092.09
23322.90
-182734.24
260204.63
STOCK
4876
12614.72
24839.29
-159171.45
253980.69
real
4876
8516.51
20515.30
-213890.41
253980.69
unl
4876
12229.24
24929.72
-170371.46
281389.97
unh
4876
7663.85
19654.38
-208532.74
231654.80
tothl
4876
9279.27
21140.84
-201336.63
238289.54
tothh
4876
10686.08
22765.47
-188749.79
252627.05
prof
4876
12316.90
24327.02
-139926.65
253980.69
cler
4876
5964.92
17497.21
-191590.90
191058.60
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
8
The SAS System
17:10 Monday, February 3, 2003 104
The MEANS Procedure
Variable
N
Mean
Std Dev
Minimum
Maximum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
craf
4876
7965.89
19526.09
-172130.34
211895.27
serv
4876
9119.99
20772.42
-162399.60
223495.13
rur
4876
8901.45
21036.03
-251654.06
193531.35
BIG
4876
15983.75
29167.37
-191590.90
253980.69
urb
4876
10982.37
23423.69
-230576.76
212318.90
SOUTH
4876
7840.23
19590.86
-191590.90
214439.12
north
4876
11773.96
24118.42
-159003.87
253980.69
ftworkL
4876
9441.02
21933.14
-198823.71
236870.57
ftworkH
4876
11585.26
24419.73
-181257.47
258596.45
NEVMARR
4876
4873.85
15502.34
-109685.73
174570.81
Male
4876
12009.19
24318.97
-166602.37
253980.69
FEMALE
4876
8923.00
20761.18
-191590.90
223700.65
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
C:\WP60\LECT2.PHD\NonLinear\cuberoot.wealth.doc
9
Download