Programming the statistical procedures from SAS

Categorical variables in Proc PHREG?

Reply
Occasional Contributor
Posts: 11

Categorical variables in Proc PHREG?

Hi, 

 

I am using PROC PHREG for time to event analysis.  I have a mix of continous and categorical variables to put into the model.  Can I put the categorical variables in the class statement of the model, and be OK or do I need to create dummy variables for each of them? 

 

Example:

 

proc phreg data=Tx1 outest=coxOutput covout plots=survival;
class DIAG_US product2 (ref='HMO') PlanGen (ref='Least Generous') rx_list4 (ref='mono') GDR_CD2 US_Cat(ref='no US') INDYR (ref='2004') ;
model bDMARDtm2*BLGC(0)=
rx_list4
US_Cat
DIAG_US
PlanGen
CIRASScore
OOP
ageonset
QCMI
QCMI6
Product2
INDYR
GDR_CD2
/ties=exact risklimits;
Format DIAG_US Diag_US_txt. product2 product2_txt. Fmastatus2 fmastatus2_txt. GDR_CD3 gdr_cd_txt. plangen plangen_txt. US_Cat US_Cat_txt. rx_list4 rx_List4_txt.;
run;

 

Thanks!
Chris

 

Grand Advisor
Posts: 16,908

Re: Categorical variables in Proc PHREG?

Yes, you can use CLASS variables, but you should verify the parameterization method. Typically, PARAM=REF is the one used.

 

 

Super Contributor
Posts: 271

Re: Categorical variables in Proc PHREG?

I agree with Reeza. Most likely, you should use the param=glm option in the class statement.

Ask a Question
Discussion stats
  • 2 replies
  • 91 views
  • 0 likes
  • 3 in conversation