Programming the statistical procedures from SAS

Class and order in proc lifereg

Reply
N/A
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  ;

  run;

SAS Super FREQ
Posts: 3,546

Re: Class and order in proc lifereg

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. 

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.

 

Best,

Sara

Ask a Question
Discussion stats
  • 2 replies
  • 779 views
  • 0 likes
  • 3 in conversation