Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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.

Reference(s):

Usage: h = kaplanmeier(y {,intervals {,disp}})
Input:
y n x 2 matrix
intervals vector
disp constant
Output:
h vector

Note:

Example:
;Nonparametric estimator of the hazard rate for the leukaemia 
; data
library("stats") 
x = read("leukaemia.dat")
h = kaplanmeier(x)
h
Result:

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 
Example:
;Nonparametric estimator of the hazard rate for the leukaemia 
; data.
library("stats")
x = read("leukaemia.dat")
h = kaplanmeier(x,1) 
h
Result:

Same as above. The estimated hazard rate and survivor 
functions are displayed, as a constant appears as last argument.
Example:
; 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
Result:

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 
Example:
; 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
Result:

Same as above. The estimated hazard rate and survivor 
functions are displayed, as a constant appears as last argument.

Library: stats
See also: hazard

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Gilles Teyssiere, 980530
(C) MD*TECH Method and Data Technologies, 17.8.2000