Library: | hazreg |
See also: | hazdat haznar hazrisk |
Quantlet: | hazkpm | |
Description: | estimates the survival function at the sorted observations of a right-censored data together with the Greenwood pointwise confidence intervals. |
Usage: | {cil, kme, ciu} = hazkpm(data{,alpha}) | |
Input: | ||
data | n x (p+4) matrix, the first column is the sorted survival time t, followed by the sorted delta, inidcating if censoring has occured, labels l, a column containing the number of ties, and lastly, the sorted covariate matrix z. | |
alpha | scalar, the confidence level, optional, default = 0.05 | |
Output: | ||
cil | n x 2 matrix, the first column is the sorted t, followed by the Greenwood lower confidence bound for the survival function at the points of t. | |
kme | n x 2 matrix, the first column is the sorted t, followed by the Kaplan-Meier estimates of the survival function at the points of t. | |
ciu | n x 2 matrix, the first column is the sorted t, followed by the Greenwood upper confidence bound for the survival function at the points of t. |
library("hazreg") y = -log(1-uniform(20)) ; exponential survival c = 5*uniform(20) ; uniform censoring t = min(y~c,2) ; censored time delta =(y<=c) ; censoring indicator {data,ties} = hazdat(t,delta) ; preparing data {cil, kme, ciu} = hazkpm(data) ; the Kaplan-Meier ; estimates with the ; Greenwood ; confidence bounds
The Kaplan-Meier estimates and Greenwood confidence bounds are obtained for the sorted censored data.
library("hazreg") y = 2|1|3|2|4|7|1|3|2 ; hypothetical survival c = 3|1|5|6|1|6|2|4|5 ; hypothetical censoring t = min(y~c,2) ; censored time delta =(y<=c) ; censoring indicator {data,ties} = hazdat(t,delta) ; preparing data {cil, kme, ciu} = hazkpm(data) ; the Kaplan-Meier ; estimates with the ; Greenwood ; confidence bounds
The Kaplan-Meier estimates and Greenwood confidence bounds are obtained for the sorted censored data. There are ties in the data: three 1's, three 2's, two 3's.