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 hazrisk

Quantlet: 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.

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

nar = haznar(data)              ; calculating the 

number at risk                                

Result:

The size of each risk set is listed as a vector in   

same order of the sorted data. 

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 

nar = haznar(data)           ; calculating the number

at risk             

Result:

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

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, 21.9.2000