crrQR {cmprskQR} | R Documentation |
Competing Risks Quantile Regression
Description
quantile regression modeling of subdistribution functions in competing risks
Usage
crrQR(ftime, fstatus, X, failcode=1, cencode=0,
tau.range=c(0.01,0.99), tau.step=0.01, subset,
na.action=na.omit, rq.method="br", variance=TRUE)
## S3 method for class 'crrQR'
print(x, ...)
Arguments
ftime |
vector of failure/censoring times |
fstatus |
vector with a unique code for each failure type and a separate code for censored observations |
X |
matrix (nobs x ncovs) of covariates |
failcode |
code of fstatus that denotes the failure type of interest |
cencode |
code of fstatus that denotes censored observations |
tau.range |
vector of length 2 denoting the range of quantiles |
tau.step |
grid size on tau.range (spacing between two grid points) |
subset |
a logical vector specifying a subset of cases to include in the analysis |
na.action |
a function specifying the action to take for any cases missing any of ftime, fstatus, cov1, cov2, cengroup, or subset. |
rq.method |
method of computation for quantile regressions. (cf. documentation of method
|
variance |
if |
x |
crrQR object (output from |
... |
included for compatibility with the generic functions. Not currently used. |
Details
Fits the competing risks quantile regression model described in Peng and Fine (2009).
While the use of model formulas is not supported, the
model.matrix
function can be used to generate suitable matrices
of covariates from factors, eg
model.matrix(~factor1+factor2)[,-1]
will generate the variables
for the factor coding of the factors factor1
and factor2
.
The final [,-1]
removes the constant term from the output of
model.matrix
.
If variance=FALSE
, then
some of the functionality in summary.crrQR
and print.crrQR
will be lost. This option can be useful in situations where crrQR is
called repeatedly for point estimates, but standard errors are not
required, such as in bootstrapping the cumulative incidence function for
confidence intervals.
The print method prints the estimated coefficients, the estimated standard errors, and the two-sided p-values for the test of the individual coefficients equal to 0.
A first implementation of the estimation procedure was prepared by Limin Peng and Ruosha Li.
Value
Returns a list of class crrQR, with components
$beta.seq |
the estimated regression coefficients |
$tau.seq |
the sequence of quantiles computed |
$var.seq |
estimated variance covariance matrix of coef |
$inf.func |
list of estimated influence functions |
$call |
the call to crr |
$n |
the number of observations used in fitting the model |
$n.missing |
the number of observations removed from the input data due to missing values |
$cvt.length |
number of covariates (columns of X) |
References
Peng L and Fine JP (2009) Competing risks quantile regression. JASA 104:1440-1453.
See Also
predict.crrQR
plot.predict.crrQR
summary.crrQR
rq.fit
Examples
# simulated data to test
set.seed(10)
ftime <- rexp(200)
fstatus <- sample(0:2,200,replace=TRUE)
X <- matrix(runif(600),nrow=200)
dimnames(X)[[2]] <- c('x1','x2','x3')
#compute model
print(z <- crrQR(ftime,fstatus,X))
summary(z)
# predict and plot cumulative incedences
reference <- as.matrix(rbind(c(.1,.5,.8),c(.1,.5,.2)))
dimnames(reference)[[2]] <- c('x1','x2','x3')
z.p <- predict(z,reference)
print(z.p)
plot(z.p,lty=1,color=2:3)
crrQR(ftime,fstatus,X,failcode=2)