Graphical 'Check' of the proportional hazards assumption.

^stcumh^ stratavar baseh [^in^ range] [^if^ exp], [^strc^ode^(^x,y^)^] [^save(^outsheet^)^] [^noc^urtail] [^k^eep^(^n^)^] [graph_options]

Description -----------

Before ^stcumh^ can be effectuated, the dataset must be 1) @^stset^@, and 2) a stratified Cox regression analysis must have been performed; where 2a) ^stratavar^ was the (nominal or ordinal) stratifying variable (by specifying the ^st^rata(stratavar)-option of the @^stcox^@ command) > , and where 2b) ^baseh^ was the newvar specified to hold the thereby saved baseline hazards (by use of the ^baseh^azard^(^newvar^)^-option of the @^stcox^@ command).

^stcumh^ plots estimates of the cumulative baseline hazards for two strata in ^stratavar^ against each other. The slope of the plotted graph will (at any time point) approximately be the relative risk between the two strata. If the proportional hazards assumption between the two strata (in the equivalent unstratified Cox regression analysis) is fulfilled, the plot should be a straight line through (0,0).

The failure time range of the two strata plotted might not be the same, and in default of specifying the ^noc^urtail-option (see options below), only the common failure time range is plotted. Therefore, information of the failure time range in each strata and the common range plotted is issued to the 'Results'-window. Also, the plotted common failure time range is indicated on the plot (as the t2title)!

Caution: Whereas ^stcox^'s ^st^rata()-option allows for a list of variables, ^stcumh^ assumes that only one stratifying variable is specified at a time. This is a limitation which can not be circumvented.

Options ------- [^strc^ode^(^x,y^)^] is not optional if ^stratavar^ has more than two strata!! If there is more than two strata in the stratifying variable (^stratavar^), the proportional hazards assumption between any two strata in ^stratavar^ can be 'checked' by specifying the code (integer) for the two strata x and y to be plotted.

[^save(^outsheet^)^] Saves the failure time variable (time), the cumulative hazards for stratum 'x' (cumh0) and the cumulative hazards for stratum 'y' (cumh1) in the the outsheet file specified. (See help ^@outsheet@^). This option is needed when the time corresponding to specific points of the graph is of interest!! (typically when the proportional hazards assumption can be seen to be violated, and the when the plotted graph can be described as a piece by piece linear function. In this case, the time for the knots of the lines can be used to specify a specific alternative model, which includes the stratifying variable as a time dependent variable. This alternative model should then be tested formally against the more restricted model with the stratifying variable as a time independent variable (by use of the @^lrtest^@, see also @^stlexis^@, @stegen@)). To get the time for the corresponding to the knots, the outfile can be entered into (for example) Excel, where the plot can be repeated. The cumulative hazard for the knots must then be determined visually, and the corresponding time be found in the spreedsheet.

Graph-options ------------- [^noc^urtail] The cumulative hazards cumulates with time (the failure time ^(ftimevar)^ specified in the ^stset^ command). The time range for the two strata to be plotted might not be the same, resulting in straight vertical or horizontal (heading or tailing) lines! In default of specifying the ^noc^urtail-option, only the common failure time range is plotted!

[^k^eep^(^n^)^] In default of ^noc^urtail, possible a lot of non-censored observations is dropped (due to non overlapping ranges of failure times). If this is occurring only in the high end of the time range, a long tailing line results. To improve readability of the plot, this tailing line can be reduced in length by specifying the number of ^n^ observations to be kept. If the number of observations in the tail is higher than ^n^, only ^n^ observations is plotted. The number of kept and dropped observations is issued in the 'Results'-window. To effectuate the ^k^eep^(^n^)^-option, the ^noc^urtile-option must be specified.

^@graph@_options^ are allowed. Default labelling is supplied when graph_options are absent, but the x-axis may be relabelled using the ^b2^ graphics option, the y-axis may be relabelled using the ^l1^ option, and the top title may be relabelled using the ^t1^ option. The second top title (t2titel) is used to specify the plotted failure time range, and can not be changed!

Example ------- 1) If only two strata in stratavar:

^stset^ ftimevar ^stcox^ varlist, st(stratavar) baseh(baseh) ^stcumh stratavar baseh, save(myout)^

2) If six strata in stratavar, left and right censoring in Cox:

^stset^ ftimevar status, t0(entry_timevar) ^stcox^ varlist, st(stratavar) baseh(baseh) ^stcumh strata baseh, strc(1,6) l1(Stratum-'6'-name) b2(Stratum-'1'-name) save(myout)^

(^strc(1,6)^ checks the proportional hazards assumption between stratum 1 and stratum 6).

In both examples above, the time, and the cumulative hazards for the two strata is saved in the ascii outfile 'myout.raw'. This file can be read by other programs, for example, Excel, where the hazards and the corresponding time can be inspected (see save-options above).

3) If display of non overlapping ranges of failure times is wonted:

^stcumh strata baseh, nocurtail keep(200)^

keeps up to 200 non-censored observation after the common failure time on display.

Author ------

Kim Lyngby Mikkelsen MD, Ph.D.-student Institute of preventive Medicine Denmark or

Also see --------

Manual: ^[R] st, stset, stcox

On-line: help for @stset@; @stcox@, @graph@, @outsheet@, @^lrtest^@

STB: STB-41, ssa10.1: @staalen@, @stlexis@, and others. STB: STB-41, ssa11: @stegen@, and others.