Library: | hazreg |
See also: | hazdat hazregll hazcoxb hazsurv |
Quantlet: | hazbeta | |
Description: | calculates the maximum likelihood estimate of the regression parameter beta in the Cox Proportional hazard model, by Newton-Raphson method. |
Usage: | {betahat, betak, ck} = hazbeta(data, {maxit}) | |
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. | |
maxit | scalar, maximum number of iteration for the Newton-Raphson procedure, default = 40. | |
Output: | ||
betahat | p x 1 vector, estimate of the regression parameter beta | |
betak | maxit x p matrix, parameter values through the Newton-Raphson procedure | |
ck | maxit x 1 vector, convergence criteria values through the Newton-Raphson procedure |
library("hazreg") n = 20 p = 2 beta = 1|2 ; regression parameter z = 1 + uniform(n,p) ; covariates y = -log(1-uniform(n)) ; exponential survival y = y./exp(z*beta) ; covariate effects c = 4*uniform(n) ; uniform censoring t = min(y~c,2) ; censored time delta =(y<=c) ; censoring indicator {data,ties} = hazdat(t,delta, z) ; preparing data {betahat,betak,ck} = hazbeta(data) ; parameter estimation
The parameter beta is estimated and the Newton-Raphson procedure recorded.