Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Poisson Regression Residuals

    I'm modeling the number of doctor visits (a count variable) on factors such as income, chronic condition, insurance, etc. I use the canned Stata command poisson y x1 x2, etc. but I am encountering the following issue when trying to find the sample average of the residuals:
    Stata does not allow me to execute predict resids, residuals after I've ran the poisson regression above.. I then tried to generate the residuals using the formula "y-yhat", yet I get a sample average of residuals with a negative average mean (-6.96e-09...) - is this 2nd approach even correct ? Also, I tried fitting the model with glm, f(poisson)and then running
    predict resids, residuals ,but Stata only allowed me to run it as "predict resids" and automatically added " (option mu assumed; predicted mean docvis)" and as a result the sample average of residuals with this approach is a constant value of 3.81 throughout all observations!

    Any thoughts here?
    Last edited by StataPerson; 21 Jul 2014, 09:56.

  • #2
    That question was asked and answered here:
    http://stats.stackexchange.com/quest.../108694#108694

    Note that the Statalist FAQ asks you to mention that you cross-posted your question elsewhere.

    Also note that the Statalist FAQ asks you to post under your real name. This has a long tradition on this list, and we believe that it helped maintain a friendly and professional tone on this list. To change your name you can use the "contact us" button on the bottom right of the page.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Although Stata Person (please change to your real name, as Maarten underlines) should have mentioned the post on Cross Validated, the extra problem with predict after glm is explained by Stata itself: you just have to read the help carefully. The syntax for predict includes options

      Code:
       
       mu              g_inverse(xb); the default
       anscombe        Anscombe residuals
       deviance        deviance residuals
       likelihood      a weighted average of standardized deviance and standardized Pearson residuals
       pearson         Pearson residuals
       response        differences between the observed and fitted outcomes
       working         working residuals
      so to get a flavour of residuals, just use one of the appropriate options. As Stata is telling you, predict defaults to showing the mean.


      Comment

      Working...
      X