ahaz.partial {ahaz} | R Documentation |
Partial calculation of the quantities used in the estimating equations for ahaz.
ahaz.partial(surv, X, weights, idx)
surv |
Response in the form of a survival object, as returned by the
function |
X |
Design matrix. Missing values are not supported. |
weights |
Optional vector of observation weights. Default is 1 for each observation. |
idx |
Vector of indices of covariates to use in the calculations. |
The function is intended mainly for programming use when a
very large number of covariates are considered and direct application of
ahaz
is unfeasible.
The estimating equations for the semiparametric additive hazards model
are of the form D\beta=d
with D
a quadratic matrix with
number of columns equal to the number of covariates. The present
function returns d[idx]
, D[idx,]
, and B[idx,]
;
the latter a matrix such that D^{-1} B
D^{-1}
estimates the
covariance matrix of the regression coefficients.
A list containing the following elements:
call |
The call that produced this object. |
idx |
A copy of the argument |
nobs |
Number of observations. |
nvars |
Number of covariates. |
d |
Vector of length |
D |
Matrix of size |
B |
Matrix of size |
data(sorlie)
# Break ties
set.seed(10101)
time <- sorlie$time+runif(nrow(sorlie))*1e-2
# Survival data + covariates
surv <- Surv(time,sorlie$status)
X <- as.matrix(sorlie[,3:ncol(sorlie)])
# Get D for the first 10 covariates only
a<-ahaz.partial(surv,X,idx=1:10)
pD1 <- a$D
# Equivalent to the (slower) solution
b <- ahaz(surv,X)
pD2 <- b$D[1:10,]
max(abs(pD1-pD2))