SAVE Subcommand (KM command)

SAVE saves the temporary variables created by KM. The following temporary variables can be saved:

SURVIVAL. Survival function evaluated at current case.

SE. Standard error of the survival function.

HAZARD. Cumulative hazard function evaluated at current case.

CUMEVENT. Cumulative number of events.

  • To specify variable names for the new variables, assign the new names in parentheses following each temporary variable name.
  • Assigned variable names must be unique in the active dataset. Scratch or system variable names cannot be used (that is, variable names cannot begin with # or $).
  • If new variable names are not specified, KM generates default names. The default name is composed of the first three characters of the name of the temporary variable (two for SE), followed by an underscore and a number to make it unique.
  • A temporary variable can be saved only once on the same SAVE subcommand.

Example

KM LENGTH BY SEXRACE
 /STATUS=EMPLOY EVENT (1) LOST (3,5 THRU 8)
 /STRATA=LOCATION
 /SAVE SURVIVAL HAZARD.
  • KM saves cumulative survival and cumulative hazard rates in two new variables, SUR_1 and HAZ_1, provided that neither name exists in the active dataset. If one does, the numeric suffixes will be incremented to make a distinction.