I tried to uses PROC PHREG to conduct competing risk model and examine the effect of event occur after intervention. I used these variables in the model:
I would like to ask why there were only 3,601 subjects included in the model. I have checked that no one had missing or negative value in these variables, so I am wondering is that due to too many people in censor status.
Below is my code:
proc phreg data=data;
class group;
model(time,event)=group/evencode=1
run;
I would appreciate all the suggestions and help!
The distribution of event and group:
event * groupevent group0 1 Total0123Total
|
Could you share the PHREG output, especially the Model Information and Summary of Failure Outcomes tables? The LOG would be helpful too.
|
1 |
0 |
3598 | 3598 | 0 | 0 |
55897.779 | 55897.316 |
55897.779 | 55899.316 |
55897.779 | 55905.504 |
1 | 3.2421 | 0.0718 |
1 | 0.09463 | 0.05255 | 3.2421 | 0.0718 | 1.099 | group 0 |
And here is the log:
497 proc phreg data=data;
498 class group;
499 model (time, event) = group /eventcode=1 ;
500 run;
NOTE: 461950 observations were deleted due either to missing or invalid values for the time, censoring, frequency or
explanatory variables or to invalid operations in generating the values for some of the explanatory variables.
NOTE: (GCONV=1E-8)。
NOTE: PROCEDURE PHREG used (Total process time):
real time 0.83
cpu time 0.78
The NOTE explains what happened with the omitted observations. If you checked for missing values, then the likely issue is that you have numerous observations in which the stop time<= the start time in the (time,event) coding.
I checked the time for subjects in event 1, there was no one's time lower than zero.
And 61715 subjects are in event 1 (group 0: 59802, group 1: 1913)
143.4673661 | 86.0000000 | 199.2859371 | 2665.00 | 1.0000000 |
The problem I am suggesting is that the event is less than or equal to time. The stop time must be later than the start time or else PHREG will drop the observation. You can try something like this to see if this is the case:
data testdata; set data;
check=(time-event>=0);
run;
proc freq data=testdata;
tables check;
run;
Thank you for reply. If I did not misunderstand what you meaning.
Yes, I did. In my dataset, time is equal to the date of event occur (stop time) - the date of intervention (start time), and the variable time is higher or equal to zero among all of the subjects. Specifically, subjects in event 1 have the time over than zero.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.