0

Using the R-package rqpd, I'm getting results I don't trust.

For a quantile value of 0.5, the results should be close to the results from plm. But that's not what I see:

set.seed(10)
m <- 3
n <- 10
s <- as.factor(rep(1:n,rep(m,n)))
x <- exp(rnorm(n*m))
u <- x*rnorm(m*n) + (1-x)*rf(m*n,3,3)
a <- rep(rnorm(n),rep(m,n))
y <- a + u
df <- as.data.frame(cbind(s, x, y))

fitrqpd <- rqpd(y ~ x | s, panel(lambda = 1), data=df)
summary(fitrqpd)

fitplm <- plm(y ~ x, model="within", index="s", data=df)
summary(fitplm)

Using rqpd, the 'effect' of x at q(0.5) is -3.1 Using plm, the 'effect' of x is -2.7

It's not a huge difference -- but it's not nothing. And: when I apply it to the data I'm actually working with, it's a much larger difference. (Effect of becoming unemployed on life satisfaction, using data from 'Understanding Society', UK: with plm, -0.31, with rqpd, -0.87)

If I use Stata and run xtqreg using the same data, the result for q(0.5) is -0.29 -- much closer to the R/plm result.

So, I'm not inclined to trust whatever it is that rqpd is doing. Should I?

dbartram
  • 33
  • 5
  • Hard to say. On the one hand, `rqpd` is on R-forge https://r-forge.r-project.org/R/?group_id=1082 and is listed as a *development* package (despite not having changed since 2014). On the other hand, it's written by Roger Koenker, who is a very well-respected researcher in quantile regression. Have you looked at the detailed description of the fitting methods in rqpd and xtqreg to see how they compare??? – Ben Bolker Apr 14 '23 at 13:19

0 Answers0