BookmarkSubscribeRSS Feed
coollord
Calcite | Level 5

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?

10 REPLIES 10
SteveDenham
Jade | Level 19

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

coollord
Calcite | Level 5

So the Pearson residuals should show a normal distribution?

SteveDenham
Jade | Level 19

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

coollord
Calcite | Level 5

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

SteveDenham
Jade | Level 19

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

coollord
Calcite | Level 5

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

SteveDenham
Jade | Level 19

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

coollord
Calcite | Level 5

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_?

SteveDenham
Jade | Level 19

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

Rick_SAS
SAS Super FREQ

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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