Library: | stats |
See also: | hazard |
Macro: | kaplanmeier | |
Description: | Calculation of the Kaplan-Meir (product limit) estimator of the hazard rate and the survivor function for a set of durations. The first column of the input is a censorship indicator variable, (equal to zero if the duration is censored, and to one otherwise); the second column is the duration. |
Usage: | h = kaplanmeier(y {,intervals {,disp}}) | |
Input: | ||
y | n x 2 matrix | |
intervals | vector | |
disp | constant | |
Output: | ||
h | vector |
;Nonparametric estimator of the hazard rate for the leukaemia ; data library("stats") x = read("leukaemia.dat") h = kaplanmeier(x) h
Contents of h [1,] 6 0.14286 0.85714 [3,] 10 0.066667 0.75294 [4,] 13 0.083333 0.6902 [5,] 16 0.090909 0.62745 [6,] 22 0.14286 0.53782 [7,] 23 0.16667 0.44818
;Nonparametric estimator of the hazard rate for the leukaemia ; data. library("stats") x = read("leukaemia.dat") h = kaplanmeier(x,1) h
Same as above. The estimated hazard rate and survivor functions are displayed, as a constant appears as last argument.
; Nonparametric estimator of the hazard rate for the leukaemia ; data, on a grid interval. library("stats") x = read("leukaemia.dat") k = #(4,8,12,16,20,30); The grid intervals h = kaplanmeier(x,k) h
Contents of h [1,] 4 0.42857 0.57143 [2,] 8 0.3125 0.39286 [3,] 12 0.33333 0.2619 [4,] 16 0.27273 0.19048 [5,] 20 0.25 0.14286
; Nonparametric estimator of the hazard rate for the leukaemia ; data, on a grid interval. library("stats") x = read("leukaemia.dat") k = #(4,8,12,16,20) h = kaplanmeier(x,k,2) h
Same as above. The estimated hazard rate and survivor functions are displayed, as a constant appears as last argument.
Library: | stats |
See also: | hazard |