Id | Status | Event | tstart | tstop | sus |
1 | 1 | 1 | 0 | 16377 | cocaine |
1 | 0 | 2 | 18019 | 18213 | alcohol |
2 | 0 | 1 | 0 | 18169 | alcohol |
3 | 1 | 1 | 0 | 16037 | cocaine paste |
3 | 1 | 2 | 16049 | 16129 | cocaine paste |
3 | 0 | 3 | 16212 | 16275 | cocaine paste |
4 | 0 | 1 | 0 | 16617 | cocaine |
5 | 1 | 1 | 0 | 16750 | marijuana |
5 | 0 | 2 | 17123 | 17525 | marijuana |
Code:
stset tstop, fail(status) exit(time .) id(id) enter(tstart) stpm2 sus, df(5) scale(hazard) predict su1, at(sus 1) hazard predict su2, at(sus 2) hazard predict su3, at(sus 3) hazard predict su4, at(sus 4) hazard predict su5, at(sus 5) hazard stphplot, by(sus) stcox i.sus stphtest, rank detail
Code:
stphtest, rank detail Test of proportional-hazards assumption Time: Rank(t) ---------------------------------------------------------------- | rho chi2 df Prob>chi2 ------------+--------------------------------------------------- 1b.sus | . . 1 . 2.sus | -0.05253 66.45 1 0.0000 3.sus | -0.08080 156.46 1 0.0000 4.sus | -0.04212 42.66 1 0.0000 5.sus | -0.10743 276.38 1 0.0000 ------------+--------------------------------------------------- global test | 341.50 4 0.0000 ----------------------------------------------------------------
Code:
stcox sus, tvc(sus) strata(event)
Code:
Stratified Cox regr. -- Breslow method for ties No. of subjects = 79,710 Number of obs = 103,775 No. of failures = 24,066 Time at risk = 1338295692 LR chi2(2) = 2273.74 Log likelihood = -239219.92 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- main | sus | 3.071586 .211246 16.32 0.000 2.684244 3.514823 -------------+---------------------------------------------------------------- tvc | sus | .9999414 4.21e-06 -13.90 0.000 .9999332 .9999497 ------------------------------------------------------------------------------ Stratified by event Note: Variables in tvc equation interacted with _t.
i found solutions for td effects like
Code:
scurve_tvc
Thank you for your help
0 Response to Plot recurrent event survival model(PWP-TT) with Time-Dependent effects
Post a Comment