问题
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