code utk plot prediksi grip
insheet using S1t5histLG.txt, clear
capture label drop _all
label def clusterl 1 "Non-poor" 2 Poor
label val cluster clusterl
gen gripFhat = 28.1458 - (cluster-1)*1.1932 - ///
age*0.3028 - asset2*0.5004 - asset3*0.4361 + ///
asset4*0.0741 - asset5*0.1701 + hischool*2.2141 + ///
somecoll*5.5721 + intermed*1.7347 + managerial*3.7451 + ///
mmarried*1.9781 + msepdiv*4.79041 + mwidowed*2.0289 + ///
height*0.0926 - zonesouth*2.71820 - adillness*0.3663 - ///
occelnum35*0.3856collapse gripFhat, by(age cluster)
label var gripFhat "Predicted grip strength"
twoway (lfitci gripFhat age if cluster==1) ///
(lfitci gripFhat age if cluster==2, lpattern(dash) color(orange) ), ///
legend(region(lwidth(none)) row(1) label (1 "Non-poor") label (2 " ") ///
label (3 "Poor") label (4 " ")) scheme(s1color) saving(gripfemale.gph, replace)
gr combine gripmale.gph gripfemale.gph, row(1) iscale(1)
graph export grip.eps
graph export grip.png
graph export grip.pdf
capture label drop _all
label def clusterl 1 "Non-poor" 2 Poor
label val cluster clusterl
gen gripFhat = 28.1458 - (cluster-1)*1.1932 - ///
age*0.3028 - asset2*0.5004 - asset3*0.4361 + ///
asset4*0.0741 - asset5*0.1701 + hischool*2.2141 + ///
somecoll*5.5721 + intermed*1.7347 + managerial*3.7451 + ///
mmarried*1.9781 + msepdiv*4.79041 + mwidowed*2.0289 + ///
height*0.0926 - zonesouth*2.71820 - adillness*0.3663 - ///
occelnum35*0.3856collapse gripFhat, by(age cluster)
label var gripFhat "Predicted grip strength"
twoway (lfitci gripFhat age if cluster==1) ///
(lfitci gripFhat age if cluster==2, lpattern(dash) color(orange) ), ///
legend(region(lwidth(none)) row(1) label (1 "Non-poor") label (2 " ") ///
label (3 "Poor") label (4 " ")) scheme(s1color) saving(gripfemale.gph, replace)
gr combine gripmale.gph gripfemale.gph, row(1) iscale(1)
graph export grip.eps
graph export grip.png
graph export grip.pdf
0 Comments:
Post a Comment
<< Home