BookmarkSubscribeRSS Feed
Lindy
Calcite | Level 5

Hi folks,

I found myself lost in setting a baseline reference group for a categorical variable in my model of parametric survival analysis.

There are 6 categories in priorarrests variable, coded in value 1 to 6. I want to use 2, the second group as my baseline. 

This is my code

proc lifereg data= roads.onlyrecordslessthan12 outest=weiboutest;
class race_group gender_group marital_group famprb0new priorarrests (ref="2");
model survivaltime*censor_1(1) =priorarrests impulsivetemperment school0 age
gender_group race_group famprb0new marital_group/distribution=lnormal;
title 'Weibull regression for the data';
output out=weibsurv xbeta=weib_xb;
run;

The log shows

10 proc lifereg data= roads.onlyrecordslessthan12 outest=weiboutest;
11 class race_group gender_group marital_group famprb0new priorarrests (ref="2");
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_,
_CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 200-322: The symbol is not recognized and will be ignored.
12 model survivaltime*censor_1(1) =priorarrests impulsivetemperment school0 age
13 gender_group race_group famprb0new marital_group/distribution=lnormal;
14 title 'Weibull regression for the data';
15 output out=weibsurv xbeta=weib_xb;
16 run;

 

I tried using no quotation marks as this

priorarrests (ref=2);

But the log still gives error message.

17 proc lifereg data= roads.onlyrecordslessthan12 outest=weiboutest;
18 class race_group gender_group marital_group famprb0new priorarrests (ref=2);
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_,
_CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 200-322: The symbol is not recognized and will be ignored.
19 model survivaltime*censor_1(1) =priorarrests impulsivetemperment school0 age
20 gender_group race_group famprb0new marital_group/distribution=lnormal;
21 title 'Weibull regression for the data';
22 output out=weibsurv xbeta=weib_xb;
23 run;

 

Anyone could help me?

Thank you!

 

 

1 REPLY 1
Rick_SAS
SAS Super FREQ

If you read the PROC LIFEREG documentation, you will see that PROC LIFEREG does not support that syntax. The doc says that you can use PROC FORMAT to determine the reference level in conjunction with the ORDER= option on the PROC LIFEREG statement. For examples and further discussion of how to set the reference level, see the last two examples in the Usage Note "Setting the reference levels for the CLASS predictor variables."

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1744 views
  • 0 likes
  • 2 in conversation