1

我正在尝试获取分位数回归的引导置信区间。我的回归响应因子主要是分类变量。当我运行代码 boot.rq 时,出现以下错误;

boot.rq.xy(x, y, U, tau) 中 coercionError 引入的 NA:外部函数调用中的 NA/NaN/Inf (arg 7)

下面是一个例子,我想计算类型的置信区间;

library(car)
library(quantreg)
library(boot)
newdata<-Prestige
mod2 = rq(income ~ education+ prestige + women + type, data=newdata)
dat2 <- newdata[,c("education","women","prestige","census","type")]
mod3=boot.rq(cbind(1,dat2),newdata$income,tau=0.5, R=10000)

插图来自该论坛之前的讨论;

使用 bootstrap 进行分位数回归的置信区间

4

0 回答 0