R Package quantreg: Extract p-values

风格不统一 提交于 2019-12-19 20:36:29

问题


I have a data series of around 250 annual maximum rainfall measurements, maxima[,] and want to apply quantile regression to all series at once and obtain the significance of each regression model in R.

library(quantreg)


qmag <- array(NA, c(250,4))
taus <- c(0.05, 0.1, 0.95, 0.975)

for(igau in 1:250){
qure <- rq(maxima[,igau+1]~maxima[,1], tau=taus)
qmag[igau,] <- coef(qure)[2,]

}

I've tried

summary(qure, se="boot")$p.value
ci(qure)

and other similar variations but get NULL values. Is it actually possible to automatically extract the p-values from quantreg to a table, rather than just viewing them individually in summary() for each model?


回答1:


have a look at the structure produced by running str() of the summary-object:

require(quantreg)
data(engel)
mod <- rq(foodexp ~ income, data = engel)
summ <- summary(mod, se = "boot")
summ
str(summ)
summ$coefficients[,4]


来源:https://stackoverflow.com/questions/7914192/r-package-quantreg-extract-p-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!