library("quantreg")
In ordinary quantile regression with qr
we can specify custom quantiles by option tau
.
rq(y ~ x, tau=c(.1, .5, .9))
# Call:
# rq(formula = y ~ x, tau=c(0.1, 0.5, 0.9))
#
# Coefficients:
# tau= 0.1 tau= 0.5 tau= 0.9
# (Intercept) 3.853102 5.0167138 6.114065
# x 1.001021 0.9788141 1.057501
#
# Degrees of freedom: 200 total; 198 residual
In censored quantile regression with crq
, the help page claims we also can specify custom quantiles by option taus
, but that doesn't seem to have any effect.
crq(survival::Surv(pmax(y,c), d, type="left") ~ x, taus=c(.1, .5, .9),
method="Portnoy")
# Call:
# crq(formula = survival::Surv(pmax(y, c), d, type = "left") ~
# x, taus = c(0.1, 0.5, 0.9), method = "Portnoy")
#
# Coefficients:
# tau= 0.2 tau= 0.4 tau= 0.6 tau= 0.8
# (Intercept) 4.372369 4.759209 5.2595952 5.802093
# x 1.003349 1.023991 0.9801221 1.133222
Does somebody know how to specify custom quantiles in crq
?
# crq example with left censoring
set.seed(1968)
n <- 200
x <-rnorm(n)
y <- 5 + x + rnorm(n)
c <- 4 + x + rnorm(n)
d <- (y > c)
According to the author, we may do the following.
summary(fit, taus = 1:3/4)
# tau: [1] 0.25
#
# Coefficients:
# Value Lower Bd Upper Bd Std Error T Value Pr(>|t|)
# (Intercept) 4.50015 4.35326 4.64870 0.07537 59.71014 0.00000
# x 1.04453 0.83865 1.19235 0.09023 11.57587 0.00000
#
# tau: [1] 0.5
#
# Coefficients:
# Value Lower Bd Upper Bd Std Error T Value Pr(>|t|)
# (Intercept) 5.03413 4.81139 5.22260 0.10490 47.98888 0.00000
# x 0.96425 0.69583 1.29422 0.15265 6.31666 0.00000
#
# tau: [1] 0.75
#
# Coefficients:
# Value Lower Bd Upper Bd Std Error T Value Pr(>|t|)
# (Intercept) 5.64074 5.49299 5.79787 0.07778 72.52292 0.00000
# x 1.06532 0.89441 1.27911 0.09814 10.85540 0.00000