0

I have noticed that whenever I try to plot the coefficient graphs with their confidence intervals (CI) with the normal OLS coefficients and their CI, I get an error whenever I force the regression through the origin.

So if I use this code (engel is data for an quantile regression example in R):

data(engel)
fit1 <- rq(foodexp ~ income, tau = c(0.1,0.25,0.5,0.75,0.9), data = engel)
plot(summary(fit1))

I have no problem and my coefficeint graphs are drawn. But if I use this:

data(engel)
fit1 <- rq(foodexp ~ 0+income, tau = c(0.1,0.25,0.5,0.75,0.9), data = engel)
plot(summary(fit1))

I have a problem because the intercept goes through the origin. How can I get the plots as in the first code for the quantile regression without the intercept.

G5W
  • 36,531
  • 10
  • 47
  • 80
Jason Samuels
  • 951
  • 6
  • 22
  • 40
  • This runs, but I'm not sure that it's actually working... `fit1 <- rq(foodexp ~ income, tau = c(0.1,0.25,0.5,0.75,0.9), data = engel, int = FALSE) plot(summary(fit1))` can you try it? Note also that the bottom of page 6 in the Vignette has an interesting comment on recentering the intercept into a "centercept" which may be what you really want – Hack-R Aug 08 '14 at 19:26
  • http://cran.r-project.org/web/packages/quantreg/vignettes/rq.pdf <- that's the Vignette I mean. There's also comments on how to avoid intercept effects in http://cran.r-project.org/web/packages/quantreg/quantreg.pdf – Hack-R Aug 08 '14 at 19:32
  • @NerdLife: Does the `int = FALSE` in your code have any effect? – Henry Aug 08 '14 at 19:52
  • `int =FALSE` has no effect i get the same result with the intercept. – Jason Samuels Aug 08 '14 at 20:01
  • Right, it did accept it as a valid option and `int = FALSE` removes the intercept within that package in other contexts, so I asked @JasonSmanuels to try it, but it doesn't seem to do anything. – Hack-R Aug 08 '14 at 20:05

0 Answers0