如何在 quantreg 的 cqr(删失分位数回归)函数中指定自定义分位数?

How to specify custom quantiles in quantreg's cqr (censored quantile regression) function?

library("quantreg")

qr 的普通分位数回归中,我们可以通过选项 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

在使用 crq 的截尾分位数回归中,帮助页面声称我们也可以通过选项 taus 指定自定义分位数,但这似乎没有任何效果。

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

有人知道如何在 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)

根据作者的说法,我们可能会做以下事情。

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