本文介绍了R软件包quantreg:提取p值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大约250个年度最大降雨量测量值的数据系列, maxima [,] ,并且希望一次对所有系列应用分位数回归,并获得R中每个回归模型的意义./p>

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,]

}

我尝试过

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

和其他类似的变体,但获得NULL值.实际上是否可以自动将Quantreg中的p值提取到表中,而不是仅针对每个模型在summary()中单独查看它们?

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?

推荐答案

看看运行summary -object的str()所产生的结构:

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]

这篇关于R软件包quantreg:提取p值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 03:27