GLM with Gamma distribution of errors: negative residuals? I'm trying to understand how the Gamma distribution, which is always positive, is used to describe errors when using a GLM. In practice, errors can be negative, as I get negative residuals when applying a GLM with a Gamma distribution. Is it that the Gamma distribution describes the general shape of the error distribution, but the mean can be shifted so as to give negative errors? Clearly I've misunderstood something fundamental, but I'm not sure what that is...
 A: The Gamma distribution doesn't describe the errors, it describes the conditional distribution of $Y$.
$(Y|X=\underline{x})\sim\text{Gamma}$
Indeed, it's only occasionally useful to think of GLMs as having 'errors' at all. Under the model the data come from distributions within some family, but the shapes of the distributions vary as you change the conditional mean.
You can't usefully "mix" the conditional distributions (e.g. to look at what the shape of the conditional distribution is) unless they form a location scale family (have the same shape but potentially differ in mean and standard deviation). Some versions of residuals (like Anscombe residuals, for example) may be roughly alike enough in distribution that there can be some benefit in mixing across observations with different conditional means.
The wikipedia page describes the components of a GLM here. You will find mention of 'errors' in terms of the model a couple of times on that page, but they're not discussed in any very substantive way (for good reason).
An alternative would be something along the lines of John Fox's book on Applied Regression Analysis and Generalized Linear Models. The publisher has made three chapters of that book available here (no longer, it seems), including the intro chapter on GLMs. I'd advise reading at least the first 7 or so of that.
If you subtract the estimate of the mean from a Gamma random variable, of course you end up with some negative values. (If the assumptions all apply, and the mean was known rather than estimated, you you'd end up with residuals that were a collection of shifted Gammas)
In the Gaussian case, there's a close connection between the conditional distribution and errors, but that kind of thing really only makes much sense with a location-family. Most distributions in the exponential class are not location-families.
