Learn R Programming

cmprskQR (version 0.9.0)

crrQR: 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 rq.fit in package quantreg for details.)
variance
if FALSE, then suppresses computation of asymptotic variances
x
crrQR object (output from crrQR()) for method print
...
included for compatibility with the generic functions. Not currently used.

Value

  • Returns a list of class crrQR, with components
  • $beta.seqthe estimated regression coefficients
  • $tau.seqthe sequence of quantiles computed
  • $var.seqestimated variance covariance matrix of coef
  • $inf.funclist of estimated influence functions
  • $callthe call to crr
  • $nthe number of observations used in fitting the model
  • $n.missingthe number of observations removed from the input data due to missing values
  • $cvt.lengthnumber of covariates (columns of X)

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, thensome 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.

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

Run this code
# 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)

Run the code above in your browser using DataLab