Library: | hazreg |
See also: | hazdat hazrisk |
Macro: | haznar | |
Description: | calculates the size of the risk set at each points of the censord survival time data. |
Usage: | nar = haznar(data) | |
Input: | ||
data | n x (p+4) matrix, the first column is the sorted survival time, followed by the sorted censoring indicator, labels l, a column containing the number of ties, and lastly, the sorted covariate matrix z. This data is produced by hazdat.xpl. | |
Output: | ||
nar | n x 1 vector, the ith entry is the size of the risk set at time t_i. |
library("hazreg") y = -log(1-uniform(20)) ; exponential survival c = 2*uniform(20) ; uniform censoring t = min(y~c,2) ; censored time delta = (y<=c) ; censoring indicator {data,ties} = hazdat(t,delta) ; preparing data nar = haznar(data) ; calculating the number at risk
The size of each risk set is listed as a vector in same order of the sorted 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 nar = haznar(data) ; calculating the number at risk
The same risk set size vector, but this time there are ties in the vector: three 9's, three 6's, two 3's.
Library: | hazreg |
See also: | hazdat hazrisk |