I am using quantile regression to estimate the effect of a categorical variable AG_SEP2 on a response outcome ScoreGSA according to the distribution of this outcome variable, while adjusting on other variables.

quantreg <- rq(ScoreGSA ~ AG_SEP2 + Sexe + Jumeau + ZS_POIDS_NAIS_Cat + CMU + CSPTOT, method="fn", c(0.2,0.5,0.8), data=SepGSA)
a <- summary(quantreg, se="boot", R=500, cov=TRUE)

AG_SEP2 is a 4-class categorical variable, so I get the following output:

                          tau= 0.2      tau= 0.5      tau= 0.8
(Intercept)           4.800000e+01  5.400000e+01  5.800000e+01
AG_SEP2AG3234_SEP1    9.907373e-11  1.000000e+00  1.000000e+00
AG_SEP2AG2431_SEP0   -2.000000e+00 -2.000000e+00 -1.000000e+00
AG_SEP2AG2431_SEP1   -7.000000e+00 -5.000000e+00 -2.000000e+00

Now, I would like to test whether two coefficients within a class of AG_SEP2 variable are different or not using Wald test. For example, within the class "AG2431_SEP1", does -7 at tau=0.2 is different from -2 at tau=0.8 ? To do so, I use the following formula: W = (beta1 - beta2) / (var(beta1) + var(beta2) - 2*cov(beta1,beta2))

My question is: I can get the covariance between coefficients for a given tau with the following code:


but how can I get the covariance between coefficients within different tau, for example between tau=0.2 and tau =0.8?


I know this question is very old but I will answer it for the lost souls' sake. You can't get the covariance within a coefficient for different pribabilities (i.e., taus), quantreg does not provide this functionality.

That said, you can test what you want to test using anova.rq, at least according to "Section 6. More on Testing" in vignette(rq). Obviously, this should internally use an estimate for the covariance matrix, which, according to the vignette, is detailed in W. Hendricks and R. Koenker, "Hierarchical spline models for conditional quantiles and the demand for electricity". J. of Am. Stat. Assoc., 87:58–68, 1991. Nonetheless, in Section 3 there, i.e. "Wald Tests for Regression Quantile Models", one can only find asymptotic statements for the covariance function of one regression vector $\beta_\theta$ for a specific $\theta$, and so, the package is, to say the least, poorly documented.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.