Dear All,
I have done a search on statalist, which has unfortunately not turned up anything. I am interested in investigating the association of a change over time of variable A with survival, where variable A was measured at baseline (A0) and 6 (A6) months. Survival time (time [in years]) is censored at 2 years. I have found some examples of scripts performing landmark analyses in Stata, but have been unable to verify whether these user suggested scripts are correct. I would like to have your input on the following script, where I am trying to perform landmark analyses with the landmark at 6 months (t=0.5)
Do I need to censor cases which experienced an event prior to t=0.5? Or does stsplit handle this for me? Thank you for your time and input!
I have done a search on statalist, which has unfortunately not turned up anything. I am interested in investigating the association of a change over time of variable A with survival, where variable A was measured at baseline (A0) and 6 (A6) months. Survival time (time [in years]) is censored at 2 years. I have found some examples of scripts performing landmark analyses in Stata, but have been unable to verify whether these user suggested scripts are correct. I would like to have your input on the following script, where I am trying to perform landmark analyses with the landmark at 6 months (t=0.5)
Do I need to censor cases which experienced an event prior to t=0.5? Or does stsplit handle this for me? Thank you for your time and input!
Code:
gen Adif = A6-A0 stset time, failure(event==1) id(ID) stsplit landmark, at(0.5) stcox Adif if landmark==0.5
Comment