Obsidian | Level 7

## Analyzing count data in GLIMMIX

Hi, I need help in analyzing my count data (number of green leaves at maturity) measured from an experiment laid out in RCB with variety as a fixed factor and rep as a random factor. I know I need to run this in GLIMMIX but don't know how to go about analyzing this type of dataset with lots of zero values. I took a shot at using a negative binomial distribution, but the model did not converge (note log message: Pseudo-likelihood update fails in outer iteration 33). I then included method=laplace in the GLIMMIX statement, and this time the model converged but no estimates were given for the SE of the covariance parameters (not sure how to interpret that). I am a bit groping in the dark here as it's my first time to analyze such data in GLIMMIX.

I included here the SAS code that I used, a sample data and the distribution of my data for your reference.

Any help would be highly appreciated!

``````Proc GLIMMIX data= CountData plots=StudentPanel MAXLMMUPDATE=1000 MAXOPT=1000 ABSPCONV=.0000001   method=laplace;
class Rep var;
model response = var /dist=negbin;
random Rep;
run;``````

5 REPLIES 5
Super User

## Re: Analyzing count data in GLIMMIX

Did you try Zero-Inflated Models ?

Obsidian | Level 7

## Re: Analyzing count data in GLIMMIX

I wanted to, but don't know how to program it in GLIMMIX 😞

Super User

## Re: Analyzing count data in GLIMMIX

Could you switch it into proc genmod ?

Barite | Level 11

## Re: Analyzing count data in GLIMMIX

Maybe, it is not unlikely that there will be many zero-values even if data comes from a Poisson distribution. The random effect will do that in many groups the expected value can be very low.

Changing to Poisson will increase chance for convergence alot, as the problem most likely is that the model has difficulties with distinguish the variance in the neg-bin distribution from the variance from the random effect.

Then, remember to be aware how you calculate the degrees of freedom, as it has a large impact on the p-values. I think the option  "DDFM=BETWITHIN" is the best choiche when focus is on the fixed effect.

Rhodochrosite | Level 12

## Re: Analyzing count data in GLIMMIX

You have to be careful in the coding of the data. If rep is corresponding to each unique subject, then there would be confounding of the rep variance and the negative binomial (NB) scale parameter. You could not have both (either rep with Poisson, or NB and no rep). If "rep" corresponds to "blocks", so that there are different groups (e.g., treatments) all with the same rep level value, than it should work (no confounding). You didn't give enough output to identify the problem. Having a lot of zeros can happen when there is a NB or when there is a Poisson with a large random effect variance.

Discussion stats
• 5 replies
• 2989 views
• 0 likes
• 4 in conversation