BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
marina_esp
Obsidian | Level 7

Dear SAS users,

 

I would like to ask a question on the PHREG procedure. In my question, I will use an open dataset on bladder cancer (attached), where patients got recurrent events of cancer, and time from entry to the study to each of the cancers is known.

 

I apply marginal type of multiple events models to these data, that is, in the PHREG, I stratify the model by events type (enum variable). As usual for these type of models, I use robust variance estimation by adding ID statement (correlation within patient id).

 

proc phreg data=survival.bladder2 covs(aggregate);
model futime*status(0)=rx size number / ties=efron;
strata enum;
id id;
run;

 

With that code, the PHREG procedure provides an overall hazard ratio for treatment groups, but I would like to know how treatment affects the hazard of each of the events. I understand that I simply need to add an interaction term between rx (treatment) and enum (event type), but not sure how to do that. I tried just add rx*enum in the MODEL statement, but that isn’t correct (enum was treated as numerical, I think).

 

Would anyone be so kind to share how they would add a treatment by event interaction in this PHREG procedure?

 

Thank you!

 

Marina

Marina Espinasse,
statistician at the University hospital in Northern Norway
1 ACCEPTED SOLUTION

Accepted Solutions
JacobSimonsen
Barite | Level 11

You can indeed add an interaction term. This is also possible even when one of the terms is used as a stratification variable as it is in your case.

 

You should just specify that enum variable is a class variable. Otherwise, phreg will just make regression on the product.

 

proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;

And you can test the rx-effect is the same across the enum's by keeping in the main effect of rx. The test will come as in the table with type 3 tests.

proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;

 

Good luck

View solution in original post

5 REPLIES 5
SteveDenham
Jade | Level 19

Put enum in a CLASS statement. If the only issue before was PHREG trying to fit enum as continuous, that should address the issue. The issue then becomes whether you get an appropriate analysis when enum is still considered as a stratification variable.

 

A shout out to @StatDave @JacobSimonsen or @FreelanceReinh for additional help in this area, since the above paragraph exhausts what I know about PHREG.

 

SteveDenham

OsoGris
SAS Employee
You may need to put your interaction terms in programming statements inside the procedure if they involve the time variable. Then you can list them in the MODEL statement as well. This would be for so-called "time-dependent interactions with time" variables.
JacobSimonsen
Barite | Level 11

You can indeed add an interaction term. This is also possible even when one of the terms is used as a stratification variable as it is in your case.

 

You should just specify that enum variable is a class variable. Otherwise, phreg will just make regression on the product.

 

proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;

And you can test the rx-effect is the same across the enum's by keeping in the main effect of rx. The test will come as in the table with type 3 tests.

proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;

 

Good luck

marina_esp
Obsidian | Level 7

Dear @JacobSimonsen ,

 

Thank you for the answer! I see that my mistake was not including enum in the CLASS statement. I am going to try your solution!

 

I was only not sure why you add an option param=glm in the CLASS statement? Does it make a difference for an interaciton model?

 

Marina

Marina Espinasse,
statistician at the University hospital in Northern Norway
JacobSimonsen
Barite | Level 11

Hi Maria,

 

It is not necessary to have the "param=glm" as an option in the class statement. You will get the same estimates whether or not you use that option.

I though think it is easier to see what the reference group is then the option is used, as that will give a row with 0s.

 

Btw, I made a typo. It was the intention not to include the main effect of rx in the first program.

 

Jacob

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 5 replies
  • 939 views
  • 3 likes
  • 4 in conversation