8

我正在使用该quantreg包在 R 中运行以下分位数回归:

bank <-rq(gekX~laggekVIXclose+laggekliquidityspread+lagdiffthreeMTBILL+
lagdiffslopeyieldcurve+lagdiffcreditspread+laggekSPret, tau=0.99)

并通过以下方式提取系数和汇总统计量

bank$coefficients
summary(bank)

我得到的结果是

Call: rq(formula = gekX ~ laggekVIXclose + laggekliquidityspread + 
lagdiffthreeMTBILL + lagdiffslopeyieldcurve + lagdiffcreditspread + 
laggekSPret, tau = 0.99)

tau: [1] 0.99

Coefficients:
                       Value    Std. Error t value  Pr(>|t|)
(Intercept)            -0.03005  0.01018   -2.95124  0.00319
laggekVIXclose          0.00471  0.00069    6.81515  0.00000
laggekliquidityspread  -0.01295  0.01619   -0.79976  0.42392
lagdiffthreeMTBILL     -0.12273  0.12016   -1.02136  0.30717
lagdiffslopeyieldcurve -0.13100  0.06457   -2.02876  0.04258
lagdiffcreditspread    -0.21198  0.15659   -1.35377  0.17592
laggekSPret            -0.01205  0.46559   -0.02588  0.97936

但是,我想知道 R^2/调整后的 R^2 -summary()命令似乎为简单的 OLS 回归提供了它,但在分位数回归的情况下却没有。

有谁知道,如何提取它们?

4

2 回答 2

10

在分位数回归中,您没有 R 平方或调整后的 R 平方。它只是伪 R 平方,不会像您在使用inrq时所期望的那样报告,但您可以在估计模型库后按如下方式计算它。summarylm

rho <- function(u,tau=.5)u*(tau - (u < 0))
V <- sum(rho(bank$resid, bank$tau))

这是包“quantreg”的作者在这里提供的答案

于 2013-11-08T15:19:30.190 回答
10

The pseudo-R^2 measure suggested by Koenker and Machado's 1999 JASA paper measures goodness of fit by comparing the sum of weighted deviations for the model of interest with the same sum from a model in which only the intercept appears.

Here's an example in R:

library(quantreg)
data(engel)

fit0 <- rq(foodexp~1,tau=0.9,data=engel)
fit1 <- rq(foodexp~income,tau=0.9,data=engel)

rho <- function(u,tau=.5)u*(tau - (u < 0))
R1 <- 1 - fit1$rho/fit0$rho

The code in the other answer only gives you the numerator of that fraction.

于 2014-12-16T17:10:03.150 回答