Hi, we have this dataset: data have;
input ID Lastage group1 group2 Age_trt Event_age;
datalines;
1 12 0 1 2 4
2 13 0 1 4 6
3 11 1 0 3 7
4 12 1 0 2 .
5 14 0 1 2 .
6 12 1 0 7 9
7 11 1 0 1 6nn
8 14 0 1 3 .
9 13 1 0 3 .
10 13 0 1 5 8
;
run;
data sample;
set have;
time2event = coalesce(event_age, lastage) - age_trt;
censor = missing(event_age);
if group1=1 then group=1;
else group=2;
run; Kindly @Reeza advised with coding to obtain KM failure plots. We are not interested in survival but in time to first event. This is the code: ods trace on;
ods output failureplot=sp;
proc lifetest data=sample plots=survival(f)
outsurv=survival_data timelist=(0 to 24 by 2) reduceout;
strata group;
time time2event*censor(1);
run;
proc sgplot data=sp;
step x=time y=_1_survival_/group=stratum name="Percentage of patients reporting the first event";
xaxis values=(0 to 24 by 2) valueshint label="Time to event (Months)";
yaxis offsetmin=0.02 min=0 offsetmax=0.1 max=1.0 label="Percentage of patients reporting the First Event";
scatter x=time y=_1_censored_ / markerattrs=(symbol=plus) name='censored';
scatter x=time y=_1_censored_ / markerattrs=(symbol=plus) GROUP=stratum;
run; Now, we need Cox models. I've used the following: proc phreg data=sample plots=(cumhaz);
class group;
model time2event*censor(1)=group;
baseline /rowid=cohort;
run; I used cumhaz since we are plotting a failure plot. Please correct me if this is wrong. My main problem is that this code only plots group 2. I checked the output data generated from this code and it also only shows data for group 2. How can the groups be showed in the same graph? Thank you.
... View more