crq(formula, taus, data, subset, weights, na.action,
method = c("Powell", "Portnoy", "PengHuang"), contrasts = NULL, ...)
crq.fit.pow(x, y, yc, tau=0.5, weights=NULL, start, left=TRUE, maxit = 500)
crq.fit.pen(x, y, cen, weights=NULL, grid, ctype = "right")
crq.fit.por(x, y, cen, weights=NULL, grid, ctype = "right")
Curv(y, yc, ctype=c("left","right"))
## S3 method for class 'crq':
print(x, ...)
## S3 method for class 'crq':
print(x, ...)
## S3 method for class 'crq':
predict(object, newdata, ...)
## S3 method for class 'crqs':
predict(object, newdata, type = NULL, ...)
## S3 method for class 'crq':
coef(object,taus = 1:4/5,...)Surv object as returned by either the Curv or Surv
function. For the Powell mcrq or crq.crq or crq.Curv, by
default "left". If you don't like "left", maybe you will like "right".
Note that for fixed censoring assumed in the "Powell" method, censoring
times yc must be providSurv function for the "Portnoy" and "PengHuang" methods.crq.rq solution ignoring the censoring; this has the (slight)
advantage that the estimator is consequently equivariant to canonical
transformations of the data. Since the objective function is no longer convex
there can be no guarantee that this produces a global minimum estimate.
In small problems exhaustive search over solutions defined by p-element
subsets of the n observations can be used, but this quickly becomes
impractical for large p and n. This global version of the Powell
estimator can be invoked by specifying start = "global". Users
interested in this option would be well advised to compute choose(n,p)
for their problems before trying it. The method operates by pivoting
through this many distinct solutions and choosing the one that gives the
minimal Powell objective. The algorithm used for the Portnoy
method is described in considerable detail in Portnoy (2003).
Both the Portnoy and Peng-Huang estimators may be unable to compute
estimates of the conditional quantile parameters in the upper tail of
distribution. Like the Kaplan-Meier estimator, when censoring is heavy
in the upper tail the estimated distribution is defective and quantiles
are only estimable on a sub-interval of (0,1).
The Peng and Huang estimator can be
viewed as a generalization of the Nelson Aalen estimator of the cumulative
hazard function, and can be formulated as a variant of the conventional
quantile regression dual problem. See Koenker (2008) for further details.
This paper is available from the package with vignette("crq").Fitzenberger, B. and P. Winker (2007): ``Improving the Computation of Censored Quantile Regression Estimators,'' CSDA, 52, 88-108.
Koenker, R. (2008): ``Censored Quantile Regression Redux,'' J.
Statistical Software, 27,
Peng, L and Y Huang, (2008) Survival Analysis with Quantile Regression Models, J. Am. Stat. Assoc., 103, 637-649.
Portnoy, S. (2003) ``Censored Quantile Regression,'' JASA, 98,1001-1012.
Powell, J. (1986) ``Censored Regression Quantiles,'' J. Econometrics, 32, 143--155.
summary.crq# An artificial Powell example
set.seed(2345)
x <- sqrt(rnorm(100)^2)
y <- -0.5 + x +(.25 + .25*x)*rnorm(100)
plot(x,y, type="n")
s <- (y > 0)
points(x[s],y[s],cex=.9,pch=16)
points(x[!s],y[!s],cex=.9,pch=1)
yLatent <- y
y <- pmax(0,y)
yc <- rep(0,100)
for(tau in (1:4)/5){
f <- crq(Curv(y,yc) ~ x, tau = tau, method = "Pow")
xs <- sort(x)
lines(xs,pmax(0,cbind(1,xs)%*%f$coef),col="red")
abline(rq(y ~ x, tau = tau), col="blue")
abline(rq(yLatent ~ x, tau = tau), col="green")
}
legend(.15,2.5,c("Naive QR","Censored QR","Omniscient QR"),
lty=rep(1,3),col=c("blue","red","green"))
# crq example with left censoring
set.seed(1968)
n <- 200
x <-rnorm(n)
y <- 5 + x + rnorm(n)
plot(x,y,cex = .5)
c <- 4 + x + rnorm(n)
d <- (y > c)
points(x[!d],y[!d],cex = .5, col = 2)
f <- crq(Surv(y,d,type = "left") ~ x, method = "Portnoy")
g <- summary(f)Run the code above in your browser using DataLab