+ All Categories
Home > Documents > Duration models Bill Evans 1. timet0t0 t2t2 t 0 initial period t 2 followup period a b c d e f h g i...

Duration models Bill Evans 1. timet0t0 t2t2 t 0 initial period t 2 followup period a b c d e f h g i...

Date post: 20-Dec-2015
Category:
View: 213 times
Download: 0 times
Share this document with a friend
38
Duration models Bill Evans 1
Transcript

Duration models

Bill Evans

1

timet0 t2

t0 initial periodt2 followup period

ab

c

d

e

f

h

g

i

Flow sample

timet0 t1 t2

t0 initial periodt1 people sampledt2 followup period

ab

c

d

e

f

h

g

i

Stock sample

Interpreting Coefficients

• This is the same for both Weibull, Exponential, and any other proportional hazard model

• For Weibull, λ(ti ) = ργitρ-1

• γi = exp(β0 + β1 + x2i β2 …. xki βk)

4

• Suppose x1i is a dummy variable

• When xi1=1, then

• γi1 = exp(β0 + β1 + x2i β2 …. xki βk)

• When xi1=0, then

• γi0 = exp(β0 + β1 + x2i β2 …. xki βk)

5

• Let λi1 be hazard when x1i=1 and λi0 when xi1=0

• Percentage change in hazard (λi1 – λi0)/ λi0

• (ργi1 tρ-1 – ργi0 tρ-1 ) /ργi0 tρ-1 = exp(β1) -1

• Percentage change in the hazard when x1i turns from 0 to 1.

• STATA prints out exp(β1), just subtract 16

Suppose x2i is continuous

• Suppose we increase x2i by 1 unit• γi1 = exp(β0 + β1x1i + x2i β2 …. xki βk)• γi2 = exp(β0 + β1 x1i+ (x2i +1)β2 …. xki βk)

• Can show that (λi1 – λi0)/ λi0 =• (ργi2 tρ-1 – ργi1 tρ-1 ) / ργi1 tρ-1 = exp(β2) – 1• Percentage change in the hazard for 1 unit

increase in x7

NLMS

• National longitudinal mortality survey• Match of monthly CPS data sets to National

Death Index• Public Use version

– Five monthly CPS data sets from 1979-1981– 637,162 people– Each followed for 9 years (3288 days)

• Our sample– Males, 50-70, who were married at the time of the

survey– Used to examine bereavement effect

8

Key Variables

• followh -- days of followup for husband (max is 3288)

• Deathh =1 if husband dies during followup

• Note if deathh=0, then followh=3288

• Deathh identifies whether the data is censored.

9

• Variable | Obs Mean Std. Dev. Min Max• -------------+--------------------------------------------------------• followh | 40715 3005.135 723.6469 2 3288• followw | 40715 3173.552 469.8656 8 3288• age | 40715 59.16623 5.807821 50 70• educ | 40715 2.808817 1.335242 1 5• income | 40715 4.313717 1.72004 1 7• -------------+--------------------------------------------------------• raceh1 | 40715 .9188997 .2729925 0 1• raceh2 | 40715 .0611323 .2395757 0 1• deathh | 40715 .1818494 .3857251 0 1• deathw | 40715 .0795776 .2706414 0 1• hhid | 40715 125273.2 72259.65 7 249994

10

------------------------------------------------------------------------------ > - storage display value variable name type format label variable label ------------------------------------------------------------------------------ > - followh float %9.0g days of followup for husband followw float %9.0g days of followup for wife age float %9.0g age of husband educ float %9.0g husband, 0-8, 9-11, 12, 13-15, 16+ income float %9.0g family inc, top group is $50k+ raceh1 float %9.0g white, non hispanic raceh2 float %9.0g black, non hispanic deathh float %9.0g =1 if husband died during followup deathw float %9.0g =1 if wife died during followup hhid float %9.0g household ID ------------------------------------------------------------------------------

11

• educh – =1 if <8 years– =2 if 9-11 years– =3 if 12 years– =4 if 13-15 years– =5 if 16+ years

12

• income (Family income)– 1 <$5K– 2 ≥ $5K, < $10K– 3 ≥ $10K, < $15K– 4 ≥ $15K, < $20K– 5 ≥ $20K, < $25K– 6 ≥ $25K, < $50K– 7 ≥ $50K

13

Duration Data in STATA

• Need to identify variable that measures duration

stset length, failure(failvar)• Length=duration variable• Failvar=1 when durations end in failure, =0

for censored values• If all data is uncensored, omit failure(failvar)

• In our case• stset followh, failure(deathh)

14

Kaplan-Meier Curves

• Graph of raw data

• What fraction of people exit the sample in each period

• “Risk set” includes people who make it to the next period

15

Getting Kaplan-Meier Curves

• Tabular presentation of results sts list• Graphical presentation sts graph• Results by subgroup sts graph, by(educ)• Graph hazard functions

Sts graph, hazard

16

0.0

00.

25

0.5

00.

75

1.0

0

0 1000 2000 3000 4000analysis time

Kaplan-Meier survival estimate

17

.00

002

.00

004

.00

006

.00

008

0 1000 2000 3000 4000analysis time

Smoothed hazard estimate

18

0.0

00.

25

0.5

00.

75

1.0

0

0 1000 2000 3000 4000analysis time

educ = 1 educ = 2educ = 3 educ = 4educ = 5

Kaplan-Meier survival estimates, by educ

19

.00

002

.00

004

.00

006

.00

008

.00

01

0 1000 2000 3000 4000analysis time

educ = 1 educ = 2educ = 3 educ = 4educ = 5

Smoothed hazard estimates, by educ

20

MLE of duration model with Covariates

• Basic syntax• streg covariates, d(distribution)

• streg age raceh1 raceh2 _Ie* _Ii*, d(weibull) nohr;

• In this model, STATA will print out exp(β)• If you want the coefficients, add ‘nohr’

option (no hazard ratio)

21

Weibull regression -- log relative-hazard form No. of subjects = 40715 Number of obs = 40715 No. of failures = 7404 Time at risk = 122354067 LR chi2(13) = 2597.17 Log likelihood = -24763.897 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0770805 .0022274 34.61 0.000 .0727148 .0814462 raceh1 | .2191812 .0922558 2.38 0.018 .0383632 .3999993 raceh2 | .3462384 .1004901 3.45 0.001 .1492813 .5431954 _Ieduc_2 | .036706 .0344257 1.07 0.286 -.0307672 .1041791 _Ieduc_3 | -.1245817 .0315895 -3.94 0.000 -.186496 -.0626674 _Ieduc_4 | -.0743026 .0437755 -1.70 0.090 -.1601009 .0114957 _Ieduc_5 | -.2715017 .0464355 -5.85 0.000 -.3625137 -.1804897

Whites have higher mortality than hispanics –Hispanic “paradox”

Mortality fallingIn education butIt is notmonotonic 22

------------------------------------------------------------------------------ _t | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Iincome_2 | -.1199924 .0472621 -2.54 0.011 -.2126245 -.0273603 _Iincome_3 | -.2577632 .0480422 -5.37 0.000 -.3519242 -.1636023 _Iincome_4 | -.3768464 .0522829 -7.21 0.000 -.479319 -.2743738 _Iincome_5 | -.4700834 .0544088 -8.64 0.000 -.5767227 -.363444 _Iincome_6 | -.5893131 .0528025 -11.16 0.000 -.6928042 -.4858221 _Iincome_7 | -.8204638 .0783839 -10.47 0.000 -.9740933 -.6668342 _cons | -15.49301 .2042763 -75.84 0.000 -15.89338 -15.09264 -------------+---------------------------------------------------------------- /ln_p | .1546417 .0112594 13.73 0.000 .1325737 .1767097 -------------+---------------------------------------------------------------- p | 1.16724 .0131424 1.141763 1.193285 1/p | .8567221 .0096462 .838023 .8758384 ------------------------------------------------------------------------------

Mortality is monotonic in income

Weibull parameter, hazardIs increasing in duration 23

------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.080129 .0024059 34.61 0.000 1.075424 1.084855 raceh1 | 1.245057 .1148637 2.38 0.018 1.039109 1.491824 raceh2 | 1.41374 .1420669 3.45 0.001 1.161 1.721499 _Ieduc_2 | 1.037388 .0357128 1.07 0.286 .9697013 1.109799 _Ieduc_3 | .8828661 .0278893 -3.94 0.000 .8298619 .9392559 _Ieduc_4 | .9283907 .0406407 -1.70 0.090 .8520578 1.011562 _Ieduc_5 | .762234 .0353947 -5.85 0.000 .6959248 .8348612 _Iincome_2 | .8869272 .0419181 -2.54 0.011 .8084597 .9730106 _Iincome_3 | .7727782 .037126 -5.37 0.000 .7033335 .8490797 _Iincome_4 | .6860214 .0358672 -7.21 0.000 .6192049 .7600479 _Iincome_5 | .6249502 .0340028 -8.64 0.000 .5617363 .6952776 _Iincome_6 | .5547082 .02929 -11.16 0.000 .5001715 .6151912 _Iincome_7 | .4402274 .0345067 -10.47 0.000 .3775345 .5133311 -------------+---------------------------------------------------------------- /ln_p | .1546417 .0112594 13.73 0.000 .1325737 .1767097 -------------+---------------------------------------------------------------- p | 1.16724 .0131424 1.141763 1.193285 1/p | .8567221 .0096462 .838023 .8758384 ------------------------------------------------------------------------------

24

• The magnitude (> or < 1) of the parameters is informative– Hazard increasing in age– Whites, Blacks have higher mortality rates– Hazard decreases with income and age– P-value is for the test that parameter = 1

• The Weibull parameter ρ = 1.167. – Check 95% confidence interval (1.14, 1.19). Can reject

null p=1 (exponential)– Low probability P<1 – Hazard is increasing over time

25

Interpret coefficients

• Age: every year of age hazard increases by 8%

• Black, non-Hispanics: have 41% greater hazard than Hispanics

• White, non-Hispanics: 24.5% greater hazard than Hispanics

• Notice results are – Monotonic in income– Nearly monotonic in education

26

• Educ 5: those with college degree.762 – 1 = -0.328 or a 32.8% lower hazard than those with <9 years of school

• Income 5, those with >$50K in income have a 0.44 – 1 = -0.54 or a 54% lower hazard than those with income <$5K

27

. streg age raceh1 raceh2 _Ie* _Ii*, d(exp);

Exponential regression -- log relative-hazard form No. of subjects = 40715 Number of obs = 40715No. of failures = 7404Time at risk = 122354067 LR chi2(13) = 2557.23Log likelihood = -24853.379 Prob > chi2 = 0.0000------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]-------------+---------------------------------------------------------------- age | 1.079425 .0024034 34.33 0.000 1.074725 1.084146 raceh1 | 1.241462 .1145318 2.34 0.019 1.036108 1.487515 raceh2 | 1.407746 .1414651 3.40 0.001 1.156077 1.714202 _Ieduc_2 | 1.037157 .0357046 1.06 0.289 .9694863 1.109552 _Ieduc_3 | .884399 .0279394 -3.89 0.000 .8312995 .9408902 _Ieduc_4 | .9295894 .0406939 -1.67 0.095 .8531566 1.01287 _Ieduc_5 | .7642151 .0354907 -5.79 0.000 .6977265 .8370397 _Iincome_2 | .8887569 .0420042 -2.50 0.013 .8101282 .9750171 _Iincome_3 | .7758393 .0372727 -5.28 0.000 .7061201 .8524422 _Iincome_4 | .6893931 .0360434 -7.11 0.000 .6222483 .7637833 _Iincome_5 | .6284558 .034194 -8.54 0.000 .5648866 .6991787 _Iincome_6 | .5580047 .0294658 -11.05 0.000 .5031409 .618851 _Iincome_7 | .443217 .0347429 -10.38 0.000 .3800953 .5168212------------------------------------------------------------------------------

To run an exponential – just change the distrbution

28

Cox models

• . stcox age raceh1 raceh2 _Ie* _Ii*;

29

. * run cox proportional hazards model;

. stcox age raceh1 raceh2 _Ie* _Ii*; failure _d: deathh analysis time _t: followh id: hhidCox regression -- Breslow method for tiesNo. of subjects = 40715 Number of obs = 40715No. of failures = 7404Time at risk = 122354067 LR chi2(13) = 2608.19Log likelihood = -76566.71 Prob > chi2 = 0.0000------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]-------------+---------------------------------------------------------------- age | 1.080333 .0024067 34.69 0.000 1.075627 1.085061 raceh1 | 1.245519 .1149061 2.38 0.017 1.039494 1.492376 raceh2 | 1.414956 .1421888 3.45 0.001 1.161999 1.722979 _Ieduc_2 | 1.037417 .0357138 1.07 0.286 .9697289 1.109831 _Ieduc_3 | .8823358 .0278711 -3.96 0.000 .829366 .9386886 _Ieduc_4 | .9281931 .0406331 -1.70 0.089 .8518745 1.011349 _Ieduc_5 | .7615854 .0353637 -5.87 0.000 .6953344 .8341488 _Iincome_2 | .8866648 .0419057 -2.55 0.011 .8082206 .9727227 _Iincome_3 | .7722259 .0370996 -5.38 0.000 .7028304 .8484732 _Iincome_4 | .685404 .0358353 -7.22 0.000 .618647 .7593647 _Iincome_5 | .6242297 .0339635 -8.66 0.000 .5610889 .6944759 _Iincome_6 | .5540265 .0292542 -11.18 0.000 .4995565 .6144358 _Iincome_7 | .439497 .0344497 -10.49 0.000 .3769077 .5124798------------------------------------------------------------------------------30

Comparing Hazard Ratios

Expon. Weibull Cox

Age 1.079

(0.0024)

1.080

(0.0024)

1.080

(0.0024)

Raceh1 1.241

(0.1145)

1.245

(0.1148)

1.246

(0.1149)

Raceh2 1.4078

(0.141)

1.4137

(0.142)

1.415

(0.142)

31

Comparing Hazard Ratios

Expon. Weibull Cox

Educ2 1.037

(0.0357)

1.037

(0.0357)

1.037

(0.0357)

Educ3 0.8843

(0.0279)

0.8829

(0.0280)

0.8823

(0.0279)

Educ4 0.9296

(0.0407)

0.9284

(0.0419)

0.9282

(0.0419)

Educ5 0.7642

(0.0355)

0.7622

(0.0359)

0.7616

(0.0354)32

Comparing Hazard Ratios

Expon. Weibull Cox

Income5 0.6284

(0.0342)

0.6249

(0.0359)

0.6242

(0.0340)

Income6 0.5580

(0.0294)

0.5547

(0.0293)

0.5540

(0.0293)

Income7 0.4432

(0.0347)

0.4402

(0.0345)

0.4395

(0.0344)

33

Time vary covariates

• The example so far have examines the impact of time invariant covariates on outcomes

• Can be the case that time varying covariates matter as well– What happens to jobless spell when UI

benefits run out?

34

Example: Bereavement Effect

• Heightened mortality after the death of a spouse

• Especially pronounced in the 2 years after spouse’s death

• Measure many possible

• Time-varying covariate – the dummy variable turns on the day your spouse dies ahead of you

35

• followh is the husband’s duration measure

• followw is the wife’s

• If followw<followh, wife dies before the husband

36

. stsplit bereavement, after(time=followw) at(0);(2771 observations (episodes) created)

. recode bereavement -1=0 0=1;(bereavement: 43486 changes made)

. stcox age raceh1 raceh2 _Ie* _Ii* bereavement;

37

. stcox age raceh1 raceh2 _Ie* _Ii* bereavement;Cox regression -- Breslow method for tiesNo. of subjects = 40715 Number of obs = 43486No. of failures = 7404Time at risk = 122354067 LR chi2(14) = 2635.84Log likelihood = -76552.883 Prob > chi2 = 0.0000------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]-------------+---------------------------------------------------------------- age | 1.079492 .0024106 34.25 0.000 1.074778 1.084227 raceh1 | 1.240377 .1144358 2.33 0.020 1.035196 1.486225 raceh2 | 1.403174 .1410254 3.37 0.001 1.15229 1.708681 _Ieduc_2 | 1.038709 .0357596 1.10 0.270 .9709336 1.111215 _Ieduc_3 | .8835838 .0279117 -3.92 0.000 .8305371 .9400187 _Ieduc_4 | .9275845 .040601 -1.72 0.086 .8513257 1.010674 _Ieduc_5 | .7632188 .0354458 -5.82 0.000 .6968144 .8359514 _Iincome_2 | .8860515 .041878 -2.56 0.010 .8076592 .9720527 _Iincome_3 | .7732764 .0371528 -5.35 0.000 .7037818 .8496333 _Iincome_4 | .6885298 .0360055 -7.14 0.000 .6214563 .7628426 _Iincome_5 | .6270364 .034122 -8.58 0.000 .5636016 .697611 _Iincome_6 | .5570053 .0294192 -11.08 0.000 .5022289 .617756 _Iincome_7 | .4420974 .0346619 -10.41 0.000 .3791237 .5155313 bereavement | 1.318605 .066781 5.46 0.000 1.194004 1.45621------------------------------------------------------------------------------38


Recommended