07-18-2012 09:35 PM
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 ;
07-19-2012 07:02 AM
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.
08-29-2017 08:04 PM
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.