Programming the statistical procedures from SAS

Class and order in proc lifereg

Posts: 1

Class and order in proc lifereg

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  ;


Posts: 3,842

Re: Class and order in proc lifereg

Posted in reply to Thomas2012

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:

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:

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. 

Senior User
Posts: 1

Re: Class and order in proc lifereg

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.




Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation