Survival and Factor Variables (KM command)
You must identify the survival and factor variables for the analysis.
- The minimum specification is one, and only one, survival variable.
- Only one factor variable can be specified using the
BY
keyword. If you have more than one factor, create a new variable combining all factors. There is no limit to the factor levels.
Example
DO IF SEX = 1.
+ COMPUTE SEXRACE = RACE.
ELSE.
+ COMPUTE SEXRACE = RACE + SEX.
END IF.
KM LENGTH BY SEXRACE
/STATUS=EMPLOY EVENT (1) LOST (2).
- The two control variables, SEX and RACE, each with two values, 1 and 2, are combined into one factor variable, SEXRACE, with four values, 1 to 4.
-
KM
specifies LENGTH as the survival variable and SEXRACE as the factor variable. - One KM table is produced for each factor level.