I am trying to run an unadjusted model with a categorical variable. The survival model is a shared frailty model with recurrent events. What I need is an overall hazard ratio and 95% CI for the categorical variable (across all individuals), however I am getting a hazard ratio for each individual.
The categorical variables I am interested in are all binary (0=no history disease, 1=yes history of disease), can I just remove the CLASS statement and add them as a continuous variable in the model?
My code:
proc phreg data=final_survival_export covs(aggregate) covm;
class pt_id /*need this to specify ID variable for random effect*/
prev_corticosteroids (ref='0'); /*character variable of interest*/
model (visit0 visit1)*rs(0)= prev_corticosteroids/rl;
random pt_id /NOCLPRINT ;
run;
My output for prev_corticosteroids is per individual, however I would like an aggregate estimate. Any help would be greatly appreciated!!
SAS Output
Parameter | DF | Parameter Estimate |
Standard Error |
Chi-Square | Pr > ChiSq | Hazard Ratio |
Label | |
---|---|---|---|---|---|---|---|---|
prev_corticosteroids | 1 | 1 | 0.13427 | 0.08226 | 2.6640 | 0.1026 | 1.144 | prev_corticosteroids 1 |
prev_corticosteroids | 2 | 1 | 0.57236 | 0.37623 | 2.3144 | 0.1282 | 1.772 | prev_corticosteroids 2 |
prev_corticosteroids | 3 | 1 | 0.75211 | 0.29420 | 6.5356 | 0.0106 | 2.121 | prev_corticosteroids 3 |
prev_corticosteroids | 4 | 1 | 0.70392 | 0.45005 | 2.4464 | 0.1178 | 2.022 | prev_corticosteroids 4 |
prev_corticosteroids | 5 | 1 | 0.68733 | 0.42074 | 2.6688 | 0.1023 | 1.988 | prev_corticosteroids 5 |
prev_corticosteroids | 6 | 1 | 0.65960 | 0.54052 | 1.4891 | 0.2224 | 1.934 | prev_corticosteroids 6 |
prev_corticosteroids | 7 | 1 | 0.64128 | 0.76435 | 0.7039 | 0.4015 | 1.899 | prev_corticosteroids 7 |
prev_corticosteroids | 8 | 1 | 0.62440 | 1.06027 | 0.3468 | 0.5559 | 1.867 | prev_corticosteroids 8 |
prev_corticosteroids | 9 | 1 | 0.66906 | 0.74098 | 0.8153 | 0.3666 | 1.952 | prev_corticosteroids 9 |
prev_corticosteroids | 11 | 1 | 0.60798 | 0.73777 | 0.6791 | 0.4099 | 1.837 | prev_corticosteroids 11 |
prev_corticosteroids | 12 | 1 | 0.59177 | 0.73702 | 0.6447 | 0.4220 | 1.807 | prev_corticosteroids 12 |
prev_corticosteroids | 13 | 1 | 0.69821 | 0.73636 | 0.8991 | 0.3430 | 2.010 | prev_corticosteroids 13 |
prev_corticosteroids | 14 | 1 | 0.61152 | 0.60854 | 1.0098 | 0.3149 | 1.843 | prev_corticosteroids 14 |
prev_corticosteroids | 15 | 1 | 0.61313 | 1.03611 | 0.3502 | 0.5540 | 1.846 | prev_corticosteroids 15 |
prev_corticosteroids | 18 | 1 | 0.62734 | 1.03652 | 0.3663 | 0.5450 | 1.873 | prev_corticosteroids 18 |
prev_corticosteroids | 19 | 1 | 0.62636 | 1.04223 | 0.3612 | 0.5479 | 1.871 | prev_corticosteroids 19 |
prev_corticosteroids | 24 | 1 | 0.64995 | 1.02797 | 0.3998 | 0.5272 | 1.915 | prev_corticosteroids 24 |
prev_corticosteroids | 29 | 1 | 0.66863 | 1.02493 | 0.4256 | 0.5142 | 1.952 | prev_corticosteroids 29 |
when all your covariates are binary (0,1) variables, then you can add them as continous variables. The estimates will show diffrence between the "1" and "0".
You can also use the class variable, as you already did. So cant see what you do wrong. Are yo sure that the prev_corticosteroids is binary. For me it looks like it contains the number of previous events in the recurrent event model.
when all your covariates are binary (0,1) variables, then you can add them as continous variables. The estimates will show diffrence between the "1" and "0".
You can also use the class variable, as you already did. So cant see what you do wrong. Are yo sure that the prev_corticosteroids is binary. For me it looks like it contains the number of previous events in the recurrent event model.
Can't believe I missed that! You are absolutely correct - I had two continuous variables that should not have been classified as categorical variables. Thanks for your help!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.