Hello,
I want to make a "time out variable" for a survival analysis.
I have a variable of date of diagnosis - "timein" which is formatted as a date %dM_d,_CY,
I have Survival_months - which is numbers between 1 and 900
I want to create a new variable adding the number of survived months onto the timein variable to get a timeout.
I tried the following:
format Survival_months %tm
generate timeout = timein + Survival_months
But this just gives me the time in + the number of days in the survival months variable - ie if the survival was 12 months it adds on 12 days.
Any ideas of how I can do this?
Thank you!
I want to make a "time out variable" for a survival analysis.
I have a variable of date of diagnosis - "timein" which is formatted as a date %dM_d,_CY,
I have Survival_months - which is numbers between 1 and 900
I want to create a new variable adding the number of survived months onto the timein variable to get a timeout.
I tried the following:
format Survival_months %tm
generate timeout = timein + Survival_months
But this just gives me the time in + the number of days in the survival months variable - ie if the survival was 12 months it adds on 12 days.
Any ideas of how I can do this?
Thank you!
Comment