Duration Analysis

ref:Winkleman pp.275-277,data:kids.dta, code's source: kids2.do l.132-

サバイバルモデルにあてはめる。

streg

/*Duratoin Analysis of Age at First Birth*/
/*Winkleman pp.275-277*/
keep if year==2002 & afb<40

tabstat kids age, statistics( count mean sd ) by(year) columns(variables)
stset afb, failure(afb)

streg educ sibs white immig lowinc16 city16, nohr robust d(exponential)    
estimates store exponential
stcurve, hazard 


streg educ sibs white immig lowinc16 city16, nohr robust d(weibull)   
estimates store weibull
stcurve, hazard

streg educ sibs white immig lowinc16 city16, nohr robust d(gompertz)   
estimates store gompertz
stcurve, hazard

streg educ sibs white immig lowinc16 city16,  d(lognormal) 
estimates store lognormal
stcurve, hazard

streg educ sibs white immig lowinc16 city16,  d(lognormal) frailty(gamma) 
estimates store gamma
stcurve, hazard
 
stcox educ sibs white immig lowinc16 city16,  basehc(bhc) 
estimates store bcox
stcurve, hazard

estimates table exponential weibull gompertz lognormal gamma, t stats(N ll) b(%8.3f)
estimates table bcox, t stats(N ll) b(%8.3f) keep (educ sibs white immig lowinc16 city16)