I am analysing risk för preterm birth after appendectomy. I have data for two cohorts - one with patients that were operated during pregnancy and a reference population that had no operation. I want to analyse the impact on risk of preterm birth related to the length of gestation when the study cohort was operated compared to the reference cohort at identical length of gestation. I will analyse the impact of the appendectomy at various weeks when the exposure occurred.
I have tried to do this comparison using stcox starting and ending the follow up at a specific length of gestation using these commands :
stset grdbs, failure(partuslt37w) origin(time 154) exit(time 195)
stcox i.appect
stdescribe if appect==1
stdescribe if appect==0
stsum, by(appect)
(grdbs is length of gestation in days starting at last menstrual period, partuslt37w is a binary variable identifying partus before 37 weeks (ie prematurity), appect is a binary variable coded 0 for the reference cohort and 1 for the appendicitis cohort. The reason I start at 154 days is that the register do not include births before 22 weeks which is normally regarded as the limit for viability. .
This works for identifiying the differnce in risk of premature birth between the two cohorts, but only during the same followup period as the inclusion. I want to compare the riskdifference of premature births for the included subset also the weeks that followed after the inclusion period. I guess I need to use stsplit and maybe a second stset??
I need help to formulate this command.
I have tried to do this comparison using stcox starting and ending the follow up at a specific length of gestation using these commands :
stset grdbs, failure(partuslt37w) origin(time 154) exit(time 195)
stcox i.appect
stdescribe if appect==1
stdescribe if appect==0
stsum, by(appect)
(grdbs is length of gestation in days starting at last menstrual period, partuslt37w is a binary variable identifying partus before 37 weeks (ie prematurity), appect is a binary variable coded 0 for the reference cohort and 1 for the appendicitis cohort. The reason I start at 154 days is that the register do not include births before 22 weeks which is normally regarded as the limit for viability. .
This works for identifiying the differnce in risk of premature birth between the two cohorts, but only during the same followup period as the inclusion. I want to compare the riskdifference of premature births for the included subset also the weeks that followed after the inclusion period. I guess I need to use stsplit and maybe a second stset??
I need help to formulate this command.

Comment