To wit: > y <- rnorm(100, 10) > x <- 1:100 > sum(resid(lm(y~x))) [1] 1.047773e-15 > sum(resid(lm(y~x-1))) [1] 243.0583
and replicating this should convince you that the mean residual really is not zero in the severely misspecified model with no intercept. (This has to do with the fact that residuals for small x will be positive but have little leverage on the slope of the regression line.) With a correctly specified model, the theoretical mean residual is in fact zero, but it won't be exactly zero for any individual fit. Try e.g. > x <- 1:100 > r <- replicate(10000, {y <- rnorm(100, x); mean(resid(lm(y~x-1)))}) > hist(r) -pd On 06 Oct 2015, at 15:38 , Roger Koenker <rkoen...@illinois.edu> wrote: > >> On Oct 6, 2015, at 8:32 AM, Lorenz, David <lor...@usgs.gov> wrote: >> >> Thanks for the details, I suspected something like that. >> I think that begs the question: what is the meaning of quantile regression >> through the origin? If the tau=.5 line does not pass through 1/2 the data >> how do I interpret the line? > > As an estimate of the conditional median (quantile) function when constrained > to pass through > the origin… as with least squares fitting without an intercept, you do this > at your peril. >> >> >> On Tue, Oct 6, 2015 at 8:03 AM, Roger Koenker <rkoen...@illinois.edu> wrote: >> >>> On Oct 6, 2015, at 7:58 AM, Lorenz, David <lor...@usgs.gov> wrote: >>> >>> Did you verify that the correct percentages were above/below the regression >>> lines? I did a quick check and for example did not consistently get 50% of >>> the observed response values greater than the tau=.5 line. I did when I >>> included the nonzero intercept term. >> >> Your "correct percentages" are only correct when you have an intercept in >> the model, >> without an intercept there is no gradient condition to ensure that. [snip] -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd....@cbs.dk Priv: pda...@gmail.com ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.