I have a question regarding stcurve command when trying to plot survival functions for data that is stset with multiple records per individual with discrete time varying covariates.
First, bit of background:
The data is from an impact evaluation study that tried to see which method of outreach was the most successful in reaching people with outstanding (unresolved) warrants to use an online service that lets them submit a request to the district court to settle these warrants. Six outreach methods (phone calls, mailing postcards, posting flyers, talking to faith organizations, talking to social service organizations, talking to employment service organizations) were implemented in 16 different geographic regions. The intervention was assigned at the geographic region level, and each region received anywhere from one to four outreach methods. The different outreach attempts were carried out in different time periods. In this context, the time varying covariates are the outreach methods (people received it for certain number of days after the start date for each method in each geographic area).
Separate from the outreach efforts, there was an amnesty period that was set by the local police department/court that encouraged people to clear their warrants without fear of arrest etc.
Here is a sample of the data for one individual with person id 15:
The time_access value of 162 is the time at failure, t is the time at measurement, access is the indicator if the person is censored or not, outcome_access indicates failure at time t (when t=time_access=162, outcome_access is 0). phone is the dummy for being in the treatment group for the phone intervention. phone_during is the indicator that marks when phone outreach method was carried out (1 during intervention, 0 before or after), phone_exposure is the indicator that marks if the person has been treated (1 from the start of the intervention to the failure date), timesince_phone is the number of days since the phone outreach began. amnesty_during is the indicator that marks the amnesty period.
For person id 15, we see that he/she accessed the online service on t=162, amnesty period ran from t=106 to t=151, the phone outreach method ran from t=113 to t=119. phone_exposure remains 1 from t=113 to then end.
Trying to see the effectiveness of each outreach method and trying to look at how amnesty period affected effectiveness, I ran a Cox regression
I want to graph the survival functions that look at the effect of each program in isolation using stcurve but I don't know how to incorporate the amnesty_during variable. What I want is for amnesty_during value to "kick in" during times t=106 and t=151.
For example, the survival curve for people who don't 't receive any outreach method will be predicted by the command
But by default stcurve will use the average value of all the other covariates in the stcox regression which I do not want.
However, my understanding of the stcurve command is that if I type
then it will estimate the survival curve when amnesty_during is 1 for the entire time period. Is this a valid concern? I suppose if this is true, I suspect I shouldn't be using stcurve in the first place for data with time varying covariates.
First, bit of background:
The data is from an impact evaluation study that tried to see which method of outreach was the most successful in reaching people with outstanding (unresolved) warrants to use an online service that lets them submit a request to the district court to settle these warrants. Six outreach methods (phone calls, mailing postcards, posting flyers, talking to faith organizations, talking to social service organizations, talking to employment service organizations) were implemented in 16 different geographic regions. The intervention was assigned at the geographic region level, and each region received anywhere from one to four outreach methods. The different outreach attempts were carried out in different time periods. In this context, the time varying covariates are the outreach methods (people received it for certain number of days after the start date for each method in each geographic area).
Separate from the outreach efforts, there was an amnesty period that was set by the local police department/court that encouraged people to clear their warrants without fear of arrest etc.
Here is a sample of the data for one individual with person id 15:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(p_ID t) int time_access float outcome_access byte(access phone) float(phone_during phone_exposure timesince_phone amnesty_during) 15 1 162 0 1 1 0 0 0 0 15 2 162 0 1 1 0 0 0 0 15 106 162 0 1 1 0 0 0 1 15 107 162 0 1 1 0 0 0 1 15 113 162 0 1 1 1 1 0 1 15 119 162 0 1 1 1 1 6 1 15 120 162 0 1 1 0 1 7 1 15 151 162 0 1 1 0 1 38 1 15 152 162 0 1 1 0 1 39 0 15 162 162 1 1 1 0 1 49 0 end
The time_access value of 162 is the time at failure, t is the time at measurement, access is the indicator if the person is censored or not, outcome_access indicates failure at time t (when t=time_access=162, outcome_access is 0). phone is the dummy for being in the treatment group for the phone intervention. phone_during is the indicator that marks when phone outreach method was carried out (1 during intervention, 0 before or after), phone_exposure is the indicator that marks if the person has been treated (1 from the start of the intervention to the failure date), timesince_phone is the number of days since the phone outreach began. amnesty_during is the indicator that marks the amnesty period.
For person id 15, we see that he/she accessed the online service on t=162, amnesty period ran from t=106 to t=151, the phone outreach method ran from t=113 to t=119. phone_exposure remains 1 from t=113 to then end.
Trying to see the effectiveness of each outreach method and trying to look at how amnesty period affected effectiveness, I ran a Cox regression
Code:
stcox phone_exposure##amnesty_during postcard_exposure##amnesty_during flyer_exposure##amnesty_during faith_exposure##amnesty_during service_exposure##amnesty_during job_exposure##amnesty_during warrantage_pre i.intervention_package ,vce(cluster intervention_package);
For example, the survival curve for people who don't 't receive any outreach method will be predicted by the command
Code:
stcurve, survival at(phone_exposure=0 postcard_exposure=0 flyer_exposure=0 faith_exposure=0 service_exposure=0 job_exposure=0);
However, my understanding of the stcurve command is that if I type
Code:
stcurve, survival at(phone_exposure=0 postcard_exposure=0 flyer_exposure=0 faith_exposure=0 service_exposure=0 job_exposure=0 amnesty_during=1);