Display single coefficient plots in quantile regressions?

358 views Asked by At

I am plotting regression summaries for a quantile regression I did with quantreg. Obviously the method plot.summary.rqs is in use here. The problem is that is use quite a few explanatory variables each of which are displayed in the plot. Most of the coefficients behave not significantly different from OLS, so I just want to pick out and display a few of them.

How can I select the plots that I need to show? I am using knitr for my reports but do not want to show dozens of variables (and you get there quickly using dummies). Is there a way to cherry pick?

1

There are 1 answers

0
CL. On

By default, plot.summary.rqs plots all coefficients:

library(quantreg)
data(stackloss)

myrq <- rq(stack.loss ~ Air.Flow + Water.Temp + Acid.Conc., tau = seq(0.35, 0.65, 0.1), data=stackloss)
plot(summary(myrq)) # Plots all 4 coefficients

To cherry pick coefficients, the parm argument can be used:

plot(summary(myrq), parm = 2) # Plot only second regressor (Air.Flow)
plot(summary(myrq), parm = "Water.Temp") # Plot only Water.Temp
plot(summary(myrq), parm = 3:4) # Plot third and fourth regressor