Dear all,
I work on a single record per id, single spell survival dataset with late entry and try to do everything I need in this framework with the built in Stata commands. This means the standard hazard-/survival function graphs by groups as well as (semi-)parametric regressions.
quickly to the setting: Let's call a person going to a certain store a relationship. I want to model the survival of these relationships in the last 12 quarters prior to the specific store's closing. In this respect I am not worried about right censoring because the spell is either completed when the relationship has terminated before the store has closed forever, or the spell lasts until t=12. There is nothing after the "right end" of my study time.
My question relates to the "left end" of my sample, i.e. the relationships that existed prior the last 12 quarters of the store's existence, that also survived into my analysis time. I am in the fortunate situation to have a very large dataset that goes back all the way so I know when every relationship started.
My question is how to properly take this information into account to not have a problem arising from left censoring.
Can this be accomplished by simply typing
stset timevar, failure(D_CENSORED=1) origin(time 0) enter(time relastartdate)
where D_CENSORED is an indicator variable equal to 1 when the spell ends before the store closes, and relastartdate gives the start quarter of the relationship, relative to the beginning of analysis time (i.e. it's negative for otherwise left-censored observations)? I tried this with a dataset I created just for this purpose but inclusion of the enter() option does not seem to alter the kaplan-meier survival function or anything else.
Any help is appreciated!
Swati
/edit: I also just tried stsetting the dataset with positive values for relastartdate but it still did have no effect. I did this because I realized before timevar should be positive. is this because all obs before becoming at risk are ignored for the analysis? but how can I address the left censoring then without leaving these observations out or integrating out?
I work on a single record per id, single spell survival dataset with late entry and try to do everything I need in this framework with the built in Stata commands. This means the standard hazard-/survival function graphs by groups as well as (semi-)parametric regressions.
quickly to the setting: Let's call a person going to a certain store a relationship. I want to model the survival of these relationships in the last 12 quarters prior to the specific store's closing. In this respect I am not worried about right censoring because the spell is either completed when the relationship has terminated before the store has closed forever, or the spell lasts until t=12. There is nothing after the "right end" of my study time.
My question relates to the "left end" of my sample, i.e. the relationships that existed prior the last 12 quarters of the store's existence, that also survived into my analysis time. I am in the fortunate situation to have a very large dataset that goes back all the way so I know when every relationship started.
My question is how to properly take this information into account to not have a problem arising from left censoring.
Can this be accomplished by simply typing
stset timevar, failure(D_CENSORED=1) origin(time 0) enter(time relastartdate)
where D_CENSORED is an indicator variable equal to 1 when the spell ends before the store closes, and relastartdate gives the start quarter of the relationship, relative to the beginning of analysis time (i.e. it's negative for otherwise left-censored observations)? I tried this with a dataset I created just for this purpose but inclusion of the enter() option does not seem to alter the kaplan-meier survival function or anything else.
Any help is appreciated!
Swati
/edit: I also just tried stsetting the dataset with positive values for relastartdate but it still did have no effect. I did this because I realized before timevar should be positive. is this because all obs before becoming at risk are ignored for the analysis? but how can I address the left censoring then without leaving these observations out or integrating out?