The original data are below. Notice that CO2 ("tco2_value_") is measured at 61 at baseline, then measured at 48 on day 83, then 37 on day 145.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long mrn float(seq follow_time obs_date) byte tco2_value_
5739573 1 0 21319 61
5739573 2 83 21402 48
5739573 3 145 21464 37
5739573 4 730 22049 37
end
format %td obs_date
After i type stsplit timeband, at(0 90 180 365) I am getting an issue where the CO2 is inserted into time intervals before the actual CO2 is observed. As you can see below, the CO2 is now input as 37 at day 90, even though we don't observe a CO2 of 37 until day 145. i would like the CO2 to stay the observed value until the next observation.
How can I prevent this issue?
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long mrn float(seq follow_time obs_date) byte tco2_value_ int timeband
5739573 1 0 21319 61 .
5739573 2 83 21402 48 0
5739573 3 90 21464 37 0
5739573 3 145 21464 37 90
5739573 4 180 22049 37 90
5739573 4 365 22049 37 180
5739573 4 730 22049 37 365
end
format %td obs_date
Thank you for your time,
Jason
0 Response to help with stsplit in survival analysis with time-varying covariate
Post a Comment