Programming the statistical procedures from SAS

PH assumption in cox model by including interaction term

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

PH assumption in cox model by including interaction term

Hi all,

 

 

I have a question regarding evaluating the PH assumption in a Cox model. I did this by introducing an interaction term for my exposure variable. My exposure variable is a categorical variable.

 

proc phreg data=mydata;

model time*censor(0)=exposure exposureT;

exposureT=exposure*(log(time));

RUN;

 

However, I get output but also an error in the log-window with:

An illegal argument is used in the function call in statement number 1 at line 1331 column 1.

 

What does this mean and does it influence my output?

 

Thanks!

 


Accepted Solutions
Solution
‎11-07-2016 07:57 AM
Super Contributor
Posts: 287

Re: PH assumption in cox model by including interaction term

[ Edited ]

I dont think it has to do with missing in covariates.

Try this variant:

proc phreg data=mydata(where=(time>0));

model time*censor(0)=exposure exposureT;

exposureT=exposure*(log(time));

RUN;

 

 

I made a typing mistake and have corrected this: it should be ">", not ">=", in the where statement. 

View solution in original post


All Replies
Super User
Posts: 18,603

Re: PH assumption in cox model by including interaction term

Please post your log including code submitted.  

Super Contributor
Posts: 287

Re: PH assumption in cox model by including interaction term

The code is correct. The error message must be because you have time values that are either zero or negative.

Contributor
Posts: 23

Re: PH assumption in cox model by including interaction term

There was one, and I took it out, but the error still persisted!

Is it maybe because it cannot handle missings in the other covariates? Or should that not matter?

Solution
‎11-07-2016 07:57 AM
Super Contributor
Posts: 287

Re: PH assumption in cox model by including interaction term

[ Edited ]

I dont think it has to do with missing in covariates.

Try this variant:

proc phreg data=mydata(where=(time>0));

model time*censor(0)=exposure exposureT;

exposureT=exposure*(log(time));

RUN;

 

 

I made a typing mistake and have corrected this: it should be ">", not ">=", in the where statement. 

Contributor
Posts: 23

Re: PH assumption in cox model by including interaction term

Yes, now it runs! Perfect! Thanks a lot! Smiley Very Happy

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 178 views
  • 1 like
  • 3 in conversation