Title: | Analysis of Competing Risks Using Quantile Regressions |
---|---|
Description: | Estimation, testing and regression modeling of subdistribution functions in competing risks using quantile regressions, as described in Peng and Fine (2009) <DOI:10.1198/jasa.2009.tm08228>. |
Authors: | Stephan Dlugosz [aut, cre], Limin Peng [aut], Ruosha Li [aut], Shuolin Shi [ctb] |
Maintainer: | Stephan Dlugosz <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.9.2 |
Built: | 2025-02-28 04:16:10 UTC |
Source: | https://bitbucket.org/sdlugosz/cmprskqr |
quantile regression modeling of subdistribution functions in competing risks
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, ...)
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, ...)
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. |
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.
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) |
Peng L and Fine JP (2009) Competing risks quantile regression. JASA 104:1440-1453.
predict.crrQR
plot.predict.crrQR
summary.crrQR
rq.fit
# 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)
# 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)
plot method for crrQR
## S3 method for class 'crrQR' plot(x, subset=NULL, main=NULL, ...)
## S3 method for class 'crrQR' plot(x, subset=NULL, main=NULL, ...)
x |
output from |
subset |
plot a subset of coefficients |
main |
main title of the plot |
... |
other arguments to plot |
plots the variable profiles for each curve
plot method for predict.crrQR
## S3 method for class 'predict.crrQR' plot(x, lty=1:(ncol(x)-1), color=1, ylim=c(0, max(x[, -1])), xmin=0, xmax=max(x[, 1]), ...)
## S3 method for class 'predict.crrQR' plot(x, lty=1:(ncol(x)-1), color=1, ylim=c(0, max(x[, -1])), xmin=0, xmax=max(x[, 1]), ...)
x |
output from |
lty |
vector of line types. If length is |
color |
vector of line colors. If length is |
ylim |
range of y-axis (vector of length two) |
xmin |
lower limit of x-axis (often 0, the default) |
xmax |
upper limit of x-axis |
... |
other arguments to plot |
plots the subdistribution functions estimated by predict.crrQR
, by
default using a different line type for each curve
predict method for crrQR
## S3 method for class 'crrQR' predict(object, x, rearrangement, ...)
## S3 method for class 'crrQR' predict(object, x, rearrangement, ...)
object |
output from crrQR |
x |
vector of covariate values for which the conditional distribution function is to be estimated. The columns of x must be named the same as in the original call to crrQR. Each must be given if present in the original call to crrQR. |
rearrangement |
set rearrangement=TRUE to perform a rearrangement of the predicted probabilities as suggested in Chernozhukov V, Fernández-Val I and Galichon A (2010). |
... |
additional parameters (currently ignored). |
Computes the conditional estimate given values of covariates from
,
for
(see Dlugosz S, Lo S and Wilke RA (2014) for details)
Returns a matrix with the unique type 1 failure times in the first column, and the other columns giving the estimated subdistribution function corresponding to the covariate combinations in the rows of x, at each failure time (the value that the estimate jumps to at that failure time).
Chernozhukov V, Fernández-Val I and Galichon A (2010) Quantile and probability curves without crossing. Econometrica 78, 1093-1125.
Dlugosz S, Lo S, Wilke RA (2014) Competing risks quantile regression at work: In-depth exploration of the role of public child support for the duration of maternity leave. unpublished.
generate and print summaries of crrQR output
## S3 method for class 'crrQR' summary(object, conf.int = 0.95, digits = max(options()$digits - 5, 2), ...) ## S3 method for class 'summary.crrQR' print(x, digits=max(options()$digits - 4, 3), ...)
## S3 method for class 'crrQR' summary(object, conf.int = 0.95, digits = max(options()$digits - 5, 2), ...) ## S3 method for class 'summary.crrQR' print(x, digits=max(options()$digits - 4, 3), ...)
object |
an object of class crrQR (output from the crrQR function) |
conf.int |
the level for a two-sided confidence interval on the coefficients. Default is 0.95. |
digits |
in |
... |
included for compatibility with the generic functions. Not currently used. |
x |
an object of class summary.crrQR (output from the summary method for crrQR) |
The summary method calculates the average effects, the variances and p-values of the test on the effect beeing 0. Furthermore it performs a test for constant coefficients. The print method prints a fairly standard format tabular summary of the results.
summary.crrQR
returns a list of class summary.crrQR, which
contains components
call |
the call to crr |
n |
the number of observations used in fitting the model |
n.missing |
the number of observations removed by |
ave.eff |
vector of average effects of covariates |
var.ave.eff |
vector of corresponding variances |
p.signf.test |
p-values for testing average effect=0 |
cnst.test |
scores of test on constant effect |
var.cnst.test |
variances of the score |
p.cnst.test |
p-values for the test |
## see examples in the crrQR help file
## see examples in the crrQR help file