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: haznar hazrisk

Macro: hazdat
Description: sorts the right-censored data to prepare it for hazard regression analysis.

Usage: {data,ties} = hazdat(t, delta {,z})
Input:
t n x 1 vector, the censored survival time.
delta n x 1 vector, the censoring indicator, showing if censoring occured (0) or not (1).
z n x p matrix of covariates.
Output:
data n x (p+4) matrix, the first column is the sorted t, followed by the sorted delta, labels l, a column containing the number of ties, and lastly, the sorted covariate matrix z.
ties a scalar equaling either 0 (there are ties) or 1 (there are no ties)

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                          
Result:
The censored data is sorted and information about   
ties in the data presented. 
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                          
Result:
The censored data is sorted and this time there are   
ties in the data: three 1's, three 2's, two 3's. 

Library: hazreg
See also: haznar 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, 17.8.2000