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: hazreg
See also: hazdat haznar

Macro: hazrisk
Description: determines which observations are ar risk at the time point t_i.

Usage: inrisk = hazrisk(data,i)
Input:
data n x (p+4) matrix, column 1: the sorted observed survival time t, column 2: the cosorted censoring indicator delta, column 3: labels l, column 4: number of ties at time t[i], cosorted, columns 5 to p+4: the cosorted covariate matrix z. This data matrix may be obtained through hazdat.xpl.
i an integer between 1 and n.
Output:
inrisk n x 1 vector, the jth entry is 1 if the jth observation is at risk at time i, 0 otherwise.

Example:
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
inrisk = hazrisk(data,5)        ; the risk set at  observation 5
Result:
The risk set at observation 5 is listed as a vector   
where 1 indicating risk and 0 otherwise. 
Example:
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
inrisk = hazrisk(data,3)     ; the risk set at  observation 3 
Result:
The risk set at observation 3 is listed as a vector   
where 1 indicating risk and 0 otherwise. 

Library: hazreg
See also: hazdat haznar

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: Lijian Yang 990601
(C) MD*TECH Method and Data Technologies, 17.8.2000