BookmarkSubscribeRSS Feed
Emily_Chi
Obsidian | Level 7

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:

  • Group: case(1), control (0)
  • Time: the date of event occur - the date of intervention
  • Event: censor (0), event1 (1), event2 (2), event 3 (3)

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!

 

 

8 REPLIES 8
Emily_Chi
Obsidian | Level 7

The distribution of event and group:

event * groupevent group0 1 Total0123Total
284529
61.12
97.80
62.66
6396
1.37
2.20
55.81
290925
62.49
 
 
59802
12.85
96.90
13.17
1913
0.41
3.10
16.69
61715
13.26
 
 
101830
21.87
97.26
22.43
2870
0.62
2.74
25.04
104700
22.49
 
 
7926
1.70
96.56
1.75
282
0.06
3.44
2.46
8208
1.76
 
 
454087
97.54
11461
2.46
465548
100.00
SAS_Rob
SAS Employee

Could you share the PHREG output, especially the Model Information and Summary of Failure Outcomes tables?  The LOG would be helpful too.

Emily_Chi
Obsidian | Level 7
 
 
465548
3598


1
0


3598359800

 


55897.77955897.316
55897.77955899.316
55897.77955905.504

 

 Effect DF Wald  Pr > ChiSqgroup
13.24210.0718

     DF estimate SE Chi's square Pr > ChiSq HR  group 0
10.094630.052553.24210.07181.099group 0
Emily_Chi
Obsidian | Level 7

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

SAS_Rob
SAS Employee

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.

Emily_Chi
Obsidian | Level 7

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)

 

 timeMean Median Std Max Min
143.467366186.0000000199.28593712665.001.0000000
SAS_Rob
SAS Employee

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;
Emily_Chi
Obsidian | Level 7

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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

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.

Discussion stats
  • 8 replies
  • 120 views
  • 0 likes
  • 2 in conversation