The LIFETEST Procedure

Plot Options Superseded by ODS Graphics

You can select one of the following three types of graphics in PROC LIFETEST: ODS, traditional, and line printer. ODS Graphics is the preferred method of creating graphs, superseding the other two.

When ODS Graphics is enabled, you can use the PLOTS= option in the PROC LIFETEST statement to create plots by using ODS Graphics. For more information about ODS Graphics options see the PLOTS= option in the section PROC LIFETEST Statement.

If ODS Graphics is not enabled and you specify the LINEPRINTER option, line printer plots are produced; otherwise traditional graphics are produced.

Table 56.4 summarizes the ways in which you can request graphics.

Table 56.4: Ways of Displaying Graphics

   

PLOTS=

LINEPRINTER

Graphics Result

ODS Graphics

Option Specified?

Option Specified?

ODS Graphics

Enabled

Yes

No

ODS Graphics survival plot

Enabled

No

No

Traditional graphics

Disabled

Yes

No

Line printer plot

Enabled

Yes

Yes

Line printer plot

Disabled

Yes

Yes

No graphics

Disabled

No

No

No graphics

Disabled

No

Yes

No graphics

Enabled

No

Yes


Table 56.5 summarizes the options available in the PROC LIFETEST statement for line printer and traditional graphics.

Table 56.5: Line Printer and Traditional Graphics Options Available in the PROC LIFETEST Statement

Option

Description

Line Printer Plots

FORMCHAR(1,2,7,9)=

Defines the characters to be used for line printer plot axes

LINEPRINTER

Specifies that plots be produced by a line printer

MAXTIME=

Specifies the maximum time value for plotting

NOCENSPLOT

Suppresses the plot of censored observations

PLOTS=

Specifies the plots to display

Traditional Graphics

ANNOTATE=

Specifies an Annotate data set that adds features to plots

CENSOREDSYMBOL=

Defines the symbol to be used for censored observations in plots

DESCRIPTION=

Specifies the string that appears in the description field of the PROC GREPLAY master menu for the plots

EVENTSYMBOL=

Specifies the symbol to be used for event observations in plots

GOUT=

Specifies the graphics catalog name for saving graphics output

LANNOTATE=

Specifies an input data set that contains variables for local annotation

MAXTIME=

Specifies the maximum time value for plotting

PLOTS=

Specifies the plots to display


The following options are used to produce line printer and traditional graphics:

ANNOTATE=SAS-data-set
ANNO=SAS-data-set

specifies an input data set that contains appropriate variables for annotation of the traditional graphics. The ANNOTATE= option enables you to add features (for example, labels that explain extreme observations) to plots produced on graphics devices. The ANNOTATE= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled. The data set specified must be an ANNOTATE= type data set, as described in SAS/GRAPH: Reference.

The data set specified with the ANNOTATE= option in the PROC LIFETEST statement is global in the sense that the information in this data set is displayed in every plot produced by a single invocation of PROC LIFETEST.

CENSOREDSYMBOL=name | ’string’
CS=name | ’string’

specifies the symbol value for the censored observations in traditional graphics. The value, name or ’string’, is the symbol value specification allowed in SAS/GRAPH software. The default is CS=CIRCLE. If you want to omit plotting the censored observations, specify CS=NONE. The CENSOREDSYMBOL= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled.

DESCRIPTION='string'
DES='string'

specifies a descriptive string of up to 256 characters that appears in the Description field of the traditional graphics catalog. The description does not appear in the plots. By default, PROC LIFETEST assigns a description of the form PLOT OF vname versus hname, where vname and hname are the names of the y variable and the x variable, respectively. The DESCRIPTION= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled.

EVENTSYMBOL=name | 'string'
ES=name | 'string'

specifies the symbol value for the event observations in traditional graphics. The value, name or ’string’, is the symbol value specification allowed in SAS/GRAPH software. The default is ES=NONE. The EVENTSYMBOL= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled.

FORMCHAR(1,2,7,9)=’string’

defines the characters to be used for constructing the vertical and horizontal axes of the line printer plots. The string should be four characters. The first and second characters define the vertical and horizontal bars, respectively, which are also used in drawing the steps of the Kaplan-Meier, Breslow, or Fleming-Harrington survival curve. The third character defines the tick mark for the axes, and the fourth character defines the lower left corner of the plot. The default is FORMCHAR(1,2,7,9)='|-+-'. Any character or hexadecimal string can be used to customize the plot appearance. If you use hexadecimals, you must put an x after the closing quote. For example, to send the plot output to a printer with the IBM graphics character set (1 or 2), specify the following:

formchar(1,2,7,9)='B3C4C5C0'x

See the chapter titled The PLOT Procedure in the Base SAS Procedures Guide for further information.

GOUT=graphics-catalog

specifies the graphics catalog for saving traditional graphics output from PROC LIFETEST. The default is Work.Gseg. The GOUT= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled. For more information, see the chapter titled The GREPLAY Procedure in SAS/GRAPH: Reference.

LANNOTATE=SAS-data-set
LANN=SAS-data-set

specifies an input data set that contains variables for local annotation of traditional graphics. You can use the LANNOTATE= option to specify a different annotation for each BY group, in which case the BY variables must be included in the LANNOTATE= data set. The LANNOTATE= option cannot be used if the LINEPRINTER option is specified or if ODS Graphics is enabled. The data set specified must be an ANNOTATE= type data set, as described in SAS/GRAPH: Reference.

If there is no BY-group processing, the ANNOTATE= and LANNOTATE= options have the same effects.

LINEPRINTER
LS

specifies that plots are produced by a line printer instead of by a graphical device.

MAXTIME=value

specifies the maximum value of the time variable allowed on the plots so that outlying points do not determine the scale of the time axis of the plots. This option affects only the displayed plots and has no effect on any calculations.

NOCENSPLOT
NOCENS

requests that the plot of censored observations be suppressed when the LINEPRINTER and PLOTS= options are specified. This option is not needed when the life-table method is used to compute the survival estimates, because the plot of censored observations is not produced.

Line Printer PLOTS= Option

PLOTS=plot-request
PLOTS=(plot-requests)

controls the line printer plots produced. You must also specify the LINEPRINTER option to obtain line printer plots. When you specify only one plot-request, you can omit the parentheses around the plot-request. Here are some examples:

 plots=s
 plots=(s ls lls)

The plot-requests include the following:

CENSORED
C

specifies a plot of censored observations. This option is available for METHOD=KM, METHOD=BRESLOW, or METHOD=FH only.

SURVIVAL
S

specifies a plot of the estimated SDF versus time.

LOGSURV
LS

specifies a plot of the negative log of the estimated SDF versus time.

LOGLOGS
LLS

specifies a plot of the log of the negative log of the estimated SDF versus the log of time.

HAZARD
H

specifies a plot of the estimated hazard function versus time (life-table method only).

PDF
P

specifies a plot of the estimated probability density function versus time (life-table method only).

Traditional Graphics PLOTS= Option

PLOTS=plot-request <(NAME=name | ’string’)>
PLOTS=(plot-request <(NAME=name | ’string’)> <, …, plot-request <(NAME=name | ’string’)> >)

controls plots produced in traditional graphics. To obtain traditional graphics, you must neither enable ODS Graphics nor specify the LINEPRINTER option. For each plot-request, you can use the NAME= option to specify a name to identify the plot. The name can be specified as a SAS name or as a quoted string of up to 256 characters. Only the first eight characters are used as the entry name in the GOUT= catalog. The plot-requests include the following:

SURVIVAL
S

plots the estimated survivor functions versus time.

LOGSURV
LS

plots the negative log of estimated survivor functions versus time.

LOGLOGS
LLS

plots the log of negative log of estimated survivor functions versus the log of time.

HAZARD
H

plots estimated hazard function versus time (life-table method only).

PDF
P

plots the estimated probability density function versus time (life-table method only).

When you specify only one plot-request, you can omit the parentheses around the plot-request. Here are some examples:

 plots=s
 plots=(s(name=Surv2), h(name=Haz2))

The latter requests a plot of the estimated survivor function versus time and a plot of the estimated hazard function versus time, with Surv2 and Haz2 as their names in the GOUT= catalog, respectively.