Categorical Variables and the CLASS Statement

In the recidivism example, several of the covariates—race, marital status, work experience, and parole status—are dichotomous variables that are coded as indicator (dummy) variables. For categorical covariates with more than two categories, the standard approach is to create a set of indicator variables, one for each category (except for one). You can do this in the DATA step, but PROC LIFEREG does it automatically if the variable (or variables) is listed in a CLASS statement. Here’s an example. Another covariate in the recidivism data set is education, which was originally coded like this:

2 = 6th grade or less24 cases
3 = 7th to 9th grade239 cases
4 = 10th to 11th grade119 cases
5 = 12th grade39 cases ...

Get Survival Analysis Using SAS®: A Practical Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.