Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Fabien Bertho <fabien.bertho@sciences-po.org> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Poisson residuals |
Date | Thu, 24 Nov 2011 17:05:24 +0100 (CET) |
Yes, very helpful. Thanks a lot! > ---------------------------------------- > From: Maarten Buis <maartenlbuis@gmail.com> > Sent: Thu Nov 24 10:33:33 CET 2011 > To: <statalist@hsphsun2.harvard.edu> > Subject: Re: st: Poisson residuals > > > On Thu, Nov 24, 2011 at 10:01 AM, Fabien Bertho wrote: > > I am trying to compute residuals after Poisson regressions. > > > > First, I used the following code: > > > > predict yhat > > gen poisson_residual= y - yhat > > > > Then, I tried the Stata command > > > > predict poisson_residual_stdp, stdp > > > > Finally, I tried this one > > > > predict poisson_residual_score, score > > > > > > The first code gives exactly the same values as the third one. And I don't understand the difference with the second computation. > > > > Please, what is the difference between both and and which is the right value? > > With the -stdp- option you'll get the standard error of the linear > prediction, with the -score- option you'll get the first derivative of > the log likelihood with respect to xb, which is just by accident the > same as the raw residuals you computed in your first example. Your > first example just gives you the raw residuals, which are often not > very useful in non-linear models like -poisson-.So none of your > computations will give you the "right" numbers, it is even hard to > define what "right" is in this type of model. There is a whole cottage > industry inventing different types of residuals that are more or less > useful in such models. A fair set of those can be obtained by > estimating your -poisson- model using -glm- with the -family(poisson) > link(log)- options. You can see the different types of residuals and > their description by typing -help glm_postestimation-. There is also a > nice discussion in chapter 4 of > <http://www.stata.com/bookstore/glmext.html>. > > Hope this helps, > Maarten > > -------------------------- > Maarten L. Buis > Institut fuer Soziologie > Universitaet Tuebingen > Wilhelmstrasse 36 > 72074 Tuebingen > Germany > > > http://www.maartenbuis.nl > -------------------------- > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ -------------------------------------------------------------------------- Tous les courriers électroniques émis depuis la messagerie de Sciences Po doivent respecter des conditions d'usages. Pour les consulter rendez-vous sur http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/