Qcoxph {Qest} | R Documentation |
Q-Estimation of Proportional Hazards Regression Models
Description
Fit proportional hazards regression models using Q-estimation.
Usage
Qcoxph(formula, weights, start, data, knots, wtau = NULL,
control = Qcoxph.control(), ...)
Arguments
formula |
an object of class “formula” (or one that can be coerced to that class): a symbolic description of the model to be fitted. Use |
weights |
an optional vector of weights to be used in the fitting process. The weights will always be normalized to sum to the sample size. This implies that, for example, using double weights will not halve the standard errors. |
start |
optional starting values for the coefficients of the linear predictor. |
data |
an optional data frame, list or environment (or object coercible by |
knots |
knots to create the basis of a piecewise linear function. If |
wtau |
an optional function that assigns a different weight to each quantile. By default, all quantiles in (0,1) have the same weight. Please check the documentation of |
control |
a list of operational parameters. This is usually passed through |
... |
additional arguments for |
Details
This function estimates a proportional hazards model, allowing for right-censored and left-truncated data. The syntax and output of Qcoxph
are almost identical to those of coxph
, but the parameters are estimated using Q-estimation (Sottile and Frumento, 2020). This method can be used to obtain outlier-robust estimators of the regression coefficients.
The quantile function of a proportional hazards model is given by
where is the baseline cumulative hazard function. In
Qcoxph
, is parametrized by a piecewise linear function identified by the provided
knots
. As the number of knots increases, the baseline hazard becomes arbitrarily flexible.
Estimation is carried out by finding the zeroes of a set of integrals equation. The optional argument wtau
permits assigning a different weight to each quantile in (0,1). It is possible to choose wtau
to be a discontinuous function (e.g., wtau = function(tau){tau < 0.95}
). However, this may occasionally result in poorly estimated of the standard errors.
The estimation algorithm is briefly described in the documentation of Qcoxph.control
.
Value
an object of classes “Qcoxph”, “coxph”, and “Qest”. See coxph.object
for details. All the S3 methods that are available for “coxph” objects will also work with a “Qcoxph” object.
An object of class “Qcoxph” is a list containing at least the following components:
coefficients |
a named vector of coefficients. |
var |
the covariance matrix of the coefficients. |
iter |
number of iterations used. |
linear.predictors |
the vector of linear predictors, one per subject. Note that this vector has not been centered, see |
residuals |
the martingale residuals. |
means |
vector of column means of the X matrix. Subsequent survival curves are adjusted to this value. |
n |
the number of observations used in the fit. |
nevent |
the number of events used in the fit. |
concordance |
a vector of length 6, containing the number of pairs that are concordant, discordant, tied on x, tied on y, and tied on both, followed by the standard error of the concordance statistic. |
terms , assign , formula , call , y |
other objects used for prediction. |
obj.function |
the objective function of the model. Please, interpret with care: read the note in the documentation of |
internal |
internal objects. |
Author(s)
Paolo Frumento <paolo.frumento@unipi.it>, Gianluca Sottile <gianluca.sottile@unipa.it>
References
Sottile G, and Frumento P (2022). Robust estimation and regression with parametric quantile functions. Computational Statistics and Data Analysis. <doi:10.1016/j.csda.2022.107471>
Muggeo VMR (2008). Segmented: an R package to fit regression models with broken-line relationships. R News 8/1, 20–25.
See Also
Qest
, for general Q-estimation, and Qlm
, for Q-estimation of linear models.
Examples
# A proportional-hazards Weibull model
n <- 100
x <- runif(n,0,3)
shape <- 2
t <- rweibull(n, shape = shape, scale = (1/exp(2 + 2*x))^(1/shape)) # time-to-event
c <- runif(n,0,1) # censoring variable
y <- pmin(t,c) # observed response
d <- (t <= c) # event indicator
require(survival)
m1 <- coxph(Surv(y,d) ~ x) # standard Cox model
m2 <- Qcoxph(Surv(y,d) ~ x) # Q-estimator