## Poisson regression goodness of fit

Occasional Contributor
Posts: 9

# Poisson regression goodness of fit

Proc glimmix data = cool plots=all;

Class a1 a2 a3;

Model a1 = a2/ dist = poisson  s ddfm = kr;

Random a3;

run;

What's a good way to assess the diagnostics of the poisson model? Do the pearson residuals tell you if the model is a good fit?

Posts: 2,655

## Re: Poisson regression goodness of fit

For this distribution, the Pearson residuals are much more informative than the raw or standardized residuals.  Be sure to look at both the
marginal and conditional plots.

Steve Denham

Occasional Contributor
Posts: 9

## Re: Poisson regression goodness of fit

So the Pearson residuals should show a normal distribution?

Posts: 2,655

## Re: Poisson regression goodness of fit

Not really.  Since the distibution is Poisson, there is no "error term" in what is fit.  What you are looking for in the residual plot are outliers and indicators of overdispersion.

Steve Denham

Occasional Contributor
Posts: 9

## Re: Poisson regression goodness of fit

But then what does the residual mean in the covariance parameter estimates when you have R-side random effects? Is it meaningless?

Posts: 2,655

## Re: Poisson regression goodness of fit

It is the deviation from the marginal mean.  That means as much as you want it to, just be aware that it is not the same for distributions where the mean and variance are functionally related (Poisson, negative binomial, gamma as examples) as it is for distributions where they are not (normal, lognormal, T).

Steve Denham

Occasional Contributor
Posts: 9

## Re: Poisson regression goodness of fit

So can you still how would you interpret the residual covariance estimate for a poisson regressiion?

Posts: 2,655

## Re: Poisson regression goodness of fit

Overdispersion is what you are fitting with an R-side covariance for a Poisson distribution.

Occasional Contributor
Posts: 9

## Re: Poisson regression goodness of fit

Proc glimmix data = cool plots=all;

Class a1 a2 a3 a4;

Model a1 = a2/ dist = poisson  s ddfm = kr;

Random a3/ subject = a4 residual type = cs;

run;

Is it normal when I run this, the conditonal variance of residuals looks more constant than when I run it without the residual option? So residual is essentially an overdispersion parameter to account for the variance? Also is residual the same as _residual_?

Posts: 2,655

## Re: Poisson regression goodness of fit

Last thing first.  Yes, residual is the same as _residual_, at least in their effect.  Before the slash, _residual_ is the syntax, after the slash, use residual.

Without residual option, you are fitting fixed effect and random effect.  For the Poisson distribution, the mean is equal to the variance, so there is no additional "error".  When you add the residual option, you are fitting an additional error term.  This accounts for overdispersion, but it is NOT an estimate of variance like the residual term when fitting a Gaussian distribution.

Steve Denham

SAS Super FREQ
Posts: 4,241

## Re: Poisson regression goodness of fit

Although you are using PROC GLIMMIX, there are some examples of using PROC GENMOD that are simpler and that discuss the use of diagnostic plots. You can turn on PLOTS=ALL for the "Getting Started" example in the PROC GENMOD doc. For a general reference, see Visualizing Categorical Data by Michael Friendly, especially Chapter 7. There are several macos on his web site (Visualizing Categorical Data) for goodness-of-fit tests and generating diagnostic plots. The code is old, but the ideas are still good.

Discussion stats
• 10 replies
• 918 views
• 0 likes
• 3 in conversation