Extract R ^ 2 from quantile regression / summary ()

I use the package quantregto run the following quantile regression in R:

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

and extract the odds and summary statistics with

bank$coefficients
summary(bank)

Results

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

However, I would like to know the R ^ 2 / adjusted R ^ 2, which the team summary()seems to provide for simple OLS regressions, but not in the case of quantile regressions.

Does anyone know how to extract them?

+4
source share
3 answers

R- R-. R- rq, summary lm, .

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

, "quantreg"

+6

-R ^ 2, 1999 . JASA , , .

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

.

+5

An easy way in these cases is to first find the prediction and use the cor () function in R to find the value of the pseudo R ^ 2 to estimate the quality factor of the fit.

pred<-predict(fitmodel,df) cor(df$response, pred)^2

0
source

All Articles