BookmarkSubscribeRSS Feed
LarissaW
Obsidian | Level 7
Hi guys, I would like to calculate p trends for my main exposures: cig, pipe and nass. They were originally numeric variables. I tried to use the numeric version in the Cox model but the result is either blank or "0". Then I tried to categorize these exposures into 4 levels, and I used the code below to calculate the trend, but SAS gave me this feedback. The instruction I used said there is a "ptrend" option in the Phreg function but when I entered it didn't turn blue as a valid option. Did anyone know how to fix the problem or how to calculate the p trend in the multivariable Cox model? Thank you.

 73         proc phreg data=liverfp;
 74         class cigd(ref='0') nassd(ref='0') piped(ref='0') everopi(ref='0')
 75                Aspirin(ref='2') HCVAb(ref='0')
 76          HBSAg(ref='0')  DLiver(ref='2') Diab(ref='2') ALC(ref='2')
 77           / param=ref;
 78         model length*caseco(0,2)= cigd piped nassd everopi HBSAg HCVAb
 79               DLiver Aspirin Diab Alc
 80              / risklimits ties=efron ptrend;
                                         ______
                                         22
                                         202
 ERROR 22-322: Syntax error, expecting one of the following: ;, ABSFCONV, ALPHA, BEST, CORRB, COVB, DETAILS, ENTRYTIME, FAILCODE, 
               FCONV, FIRTH, GCONV, HIERARCHY, INCLUDE, INITIAL, ITPRINT, MAXITER, MAXSTEP, NODESIGNPRINT, NODP, NODUMMY, 
               NODUMMYPRINT, NOFIT, OFFSET, PLCONV, RIDGING, RISKLIMITS, ROCLABEL, SELECTION, SEQUENTIAL, SINGULAR, SLENTRY, SLSTAY, 
               START, STOP, STOPRES, TIES, TYPE3, XCONV.  
 ERROR 202-322: The option or parameter is not recognized and will be ignored.
 81         strata age1 gender ethnicity;
 82         run;

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 0 replies
  • 596 views
  • 0 likes
  • 1 in conversation