# Weird fitted values/residuals plot

I am doing some regressions on real earnings as a function of some different variables and this came out:

Is this because earnings cannot be negative?

• It took me a while to realize you had residuals on the x-axis. As far as possible, try not to ask questions to which the answer might just be "yes". – Glen_b Dec 16 '14 at 19:21
• I tried to be as specific as possible regarding the problem and came with my best explanation, but I'd like to get some kind of confirmation of whether om right or not. – Torstein Dec 16 '14 at 19:34
• It's possible to phrase a question in such a way as to directly invite an explanation. For example "What might cause this?" You can always add your seeking of confirmation "Is this because earnings cannot be negative?" after that. – Glen_b Dec 16 '14 at 20:05
• @NickCox You're right! I misread the graph and thought that there were no fitted earning below zero, which I interpreted as using logs. I also left out the $\exp()$ around the first expectation in what I wrote. – Dimitriy V. Masterov Dec 16 '14 at 21:53
• This question actually contains some interesting content that would be relevant to other people than the OP. But at present this page is not a good search engine destination for people seeking such information. "Weird fitted values/residuals plot" in particular is rather vague about the nature of the weirdness! Does anybody have a suggestion, perhaps for an improved title? – Silverfish Dec 16 '14 at 22:01

You can answer the question for yourself with simple mathematics. If observed $y \ge 0$ and $\hat y$ denotes fitted $y$, then residual $e = y - \hat y$ must be $\ge -\hat y$. The line $e = - \hat y$ is thus a lower limit on your residuals. Despite your unconventional axis choice, it is clear that your data follow suit.

The underlying problem is presumably use of a standard linear model on data not suited to such. One way forward is a log-linear or Poisson(-like) model: (fortuitously but fortunately for the OP as a Stata user) there is a Stata-rich explanation in this blog posting. The posting should be of considerable interest to many users of statistics, however.

P.S. A standard residual plot has residuals on the vertical axis and fitted or predicted on the horizontal axis. The choice of axes is not here an arbitrary convention. A horizontal line indicating zero residuals is the natural reference line, as indicating behaviour matching a perfect model. As emphasised often by J.W. Tukey and others, the best references are linear, and the best linear references are horizontal, in the sense of being easiest to think about. In Stata there is a built-in post-estimation rvfplot for use after regress.

P.P.S. The graph flags a Stata user. Naturally use of Stata is quite secondary here to the main question.

There are two major aspects I see in the plot that I expect you might wonder about.

(I took the liberty of flipping your plot about to the way I'm more used to looking at them, with the random quantity on the y-axis.)

The first aspect is what looks like hard lower bound on the y-values (which is presumably 0), as you suggested.

The second is the fan-shape ("$<$") in the residuals. The two are related issues.

The spread seems to be linear in the mean - indeed, I'd guess proportional to it, but it's a little hard to tell from this plot, since your model looks like it's also biased at 0.

In that case, variance is proportional to the square of the mean, which suggests either taking logs (working with log-earnings would be a pretty common choice) or fitting a model with variance proportional to mean-squared (such as a Gamma GLM).

I disagree with Nick on this* - a Poisson-like model is unsuitable; a quasi-Poisson has variance proportional to mean, or standard deviation proportional to the square root of the mean, so its residual plot would look more parabolic. This one doesn't. As is common with financial data, the standard deviation is approximately proportional to the mean -- indeed it would be somewhat surprising if it were not, since it would imply that it would matter whether you worked in dollars or thousands of dollars

* Or perhaps I don't, since it seems we were having more a difference of terminology than substance.

If you have exact zeros in your data, neither of those suggestions would be suitable (at least not without some modification), but there are also zero-inflated models.

Working with a more appropriate model for the variance will likely improve other aspects of your model as well.

• The objection raised by @Glen_b about variance and mean is common, but explicitly discussed in the blog post I cited. Nor do exact zeros rule out a Poisson-like model. But I agree in so far I clearly cannot be certain just on the evidence cited that a Poisson model is the best bet, which is why I said log-linear or Poisson-like. – Nick Cox Dec 16 '14 at 20:07
• @Nick Our disagreement may perhaps be more terminology than substance. Personally I wouldn't use the term "Poisson-like" if the intent is simply to convey that the expectation is log-linear; since linear-in-the-logs is hardly unique to the Poisson, nor necessary to it -- so I would tend to take the reference to being Poisson-like to imply variance proportional to mean. If the log-linear aspect is what you're suggesting by the term, I agree completely. I have comments on the blog post's take on variance (looks like about 400 words so far), but perhaps this isn't the right place for that. – Glen_b Dec 16 '14 at 21:57
• That intersects (or so I hope) with a slowly growing prejudice of mine that the popularity of the term "Poisson regression" is singularly unfortunate, as the use of Poisson assumptions is less crucial to many applications than the idea of a logarithmic link function. (It's as if "linear regression" were being called "normal regression".) Privately I have been suggesting to students and colleagues that "log-linear" is the better term once one departs from the narrow path of a Poisson assumption (not least for continuous response variables). – Nick Cox Dec 16 '14 at 22:05