如何在quantreg';s cqr(删失分位数回归)函数?
在使用如何在quantreg';s cqr(删失分位数回归)函数?,r,quantreg,R,Quantreg,在使用qr的普通分位数回归中,我们可以通过选项tau指定自定义分位数 library("quantreg") 在使用crq的删失分位数回归中,帮助页面声称我们还可以通过选项taus指定自定义分位数,但这似乎没有任何效果 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=
qr
的普通分位数回归中,我们可以通过选项tau
指定自定义分位数
library("quantreg")
在使用crq
的删失分位数回归中,帮助页面声称我们还可以通过选项taus
指定自定义分位数,但这似乎没有任何效果
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
中指定自定义分位数吗
资料
#带左删失的crq示例
种子集(1968年)
n根据作者的说法,我们可以做以下几点
# 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)
# 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