BookmarkSubscribeRSS Feed
Thomas2012
Calcite | Level 5

I am a beginner in SAS.

I am trying to fit a parametric regression model. But while running this code, I am getting largest values in the categorical variables are being omitted. How do I set the lowest number as the reference category.

Also is it possible to get the hazard ratios from this procedure

proc lifereg data = v3   ;

  class  sex  costct  cpm  mt;

   model deadtime* dead(0) =  age sex ac6  costct mt cpm /dist=weibull  ;

  run;

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Hi, and welcome to SAS (and the discussion forums),

The CLASS statement for the LIFEREG procedure does not use a reference parameterization, it uses what is called a GLM (or "singular") parameterization. Parameterization of classification variables are explained here: http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_introcom_a00...

Some SAS procedures do support reference prameterizations (they are listed in the previous link).

Although the parameterization is fixed, you can change the order in which the class levels are sorted by using the ORDER= option on the PROC statement: http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_lifereg_sect...

One important thing to remember: The SAS default is to determine levels by the FORMATTED values of the variables.  That means that you can play games with PROC FORMAT to get all kind of versitility in how results are displayed. 

saghaee
Calcite | Level 5

Hi Rick,

 

I am familiar with how to manipulate formats in order to get the desired reference level. However, I am having another issue. I have a categorical variable with 16 levels and every time I run my model (lifereg), regardless of how the values are formatted, it outputs 4 of the levels as reference groups. I only want one level to be a reference group.

 

Any advice would be appreciated.

 

Best,

Sara

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 2645 views
  • 0 likes
  • 3 in conversation