Hello.
I have a question on time varying analysis in stata (more specifically using the tvc function in Cox proportional hazard model).
I have a group of patients who I followup for an outcome (a cardiovascular event) over a period of time. The variable I am examining is an exposure (peritonitis) which does not happen at the start but rather at some point during followup. I am hoping to use time to exposure as a time varying covariate.
The variables are
Outcome (the cardiovascular event)
Time (Time from start to outcome or censoring)
Exposure (Peritonitis)
TimeExp (Time to peritonitis)
Im assuming the code is as follows
stset Time, failure(Outcome) scale(1)
stcox Exposure, tvc(TimeExp) texp(_t)
Is this the correct code?
The other question is what do I put in TimeExp for patients who did not have an exposure. Do I leave it as blank? or do I set some other value?
Thank you for guiding me with this.
I have a question on time varying analysis in stata (more specifically using the tvc function in Cox proportional hazard model).
I have a group of patients who I followup for an outcome (a cardiovascular event) over a period of time. The variable I am examining is an exposure (peritonitis) which does not happen at the start but rather at some point during followup. I am hoping to use time to exposure as a time varying covariate.
The variables are
Outcome (the cardiovascular event)
Time (Time from start to outcome or censoring)
Exposure (Peritonitis)
TimeExp (Time to peritonitis)
Im assuming the code is as follows
stset Time, failure(Outcome) scale(1)
stcox Exposure, tvc(TimeExp) texp(_t)
Is this the correct code?
The other question is what do I put in TimeExp for patients who did not have an exposure. Do I leave it as blank? or do I set some other value?
Thank you for guiding me with this.
Comment