BookmarkSubscribeRSS Feed
jb915
Calcite | Level 5

PROC PHREG data=XXX covs(aggregate);

CLASS [all categorical variables]

MODEL (exact age, exact age at hysterectomy)*cancer_event(0)=exposure v1 v2 v3 v4 v5;

ID [observation identifier];

HAZARDRATIO exposure / UNITS=10;

RUN;

 

Based on this model, I am trying to calculate person-time. When I run this model, I am able to see the the number of events in the 'Summary of the Number of Event and Censored Values' table, but I am not quite sure about how to identify which observations were considered to be events.

 

I think that if I was able to identify which observations are events that I would be able to calculate person time with a DATA step to subset the data and create a person-time variable before running PROC MEANS to sum all the observations for person-time. Any ideas about how to best calculate person time based on this model would be greatly appreciate. 

3 REPLIES 3
ballardw
Super User

I think that if you add an OUTPUT statement you will see that the number of Cancer_event (censoring variable) values = 1 may match the number of events and 0 the number censored in the output set.

 

At least it is easy to test. Add

 

output out=work.somedatasetname;

 

 

jb915
Calcite | Level 5
I'm not able to get the person-time calculations for the events only included in PROC PHREG. There are 403 events used in the PROC PHREG statement but I am getting the person-time calculation for all 404 cases.
jb915
Calcite | Level 5
Is there a better way to display which observations were censored vs. which observations were events?

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 932 views
  • 0 likes
  • 2 in conversation