Programming the statistical procedures from SAS

How to test the fit of discrete distributions?

Reply
Occasional Contributor
Posts: 8

How to test the fit of discrete distributions?

I appreciate if someone can help me with this question.

Context:

In-field insect density was determined for different crop fields ("groups"). I have the frequency of the number of insects per sampling unit.

For instance,

field=1: the frequency of "zeros" insects per sampling unit was 353. The frequency of "ones" was 19.

field=2: the frequency of "zeros" was 580. The frequency of "ones" was 30. The frequency of "twos" was 3.

fieldclass.insectobserv_freq
10353
1119
20580
2130
223

I would like to compare the observed frequency of each one of my fifteen fields with discrete distributions using chi-square test.

I am trying to use PROC GENMOD because I think PROC DISCRETE is not available anymore.

proc genmod;

by field;

freq observ_freq;

model class.insect = / dist=binomial; run;

I am planning to test for the following discrete distributions:

Binomial

Inverse Gaussian

Multinomial

Negative binomial

Normal

Poisson

Zero-inflated Poisson

Zero-inflated negative binomial

Double Poisson

Neyman type A

Final table should look like this image from Env. Ento. 30(2) :

final_table.PNG

Thank you.

Respected Advisor
Posts: 2,655

Re: How to test the fit of discrete distributions?

The chi-square value is presented in the goodness-of-fit table, so getting this into a dataset with ODS OUTPUT should not be difficult. I do worry that the goodness of fit applies to a model with some terms in it, so you may have to change to:

proc genmod;

class field;

freq observ_freq;

model class.insect =field / dist=binomial; run;

And of course that makes it impossible to find out if different distributions are better applied in different fields.  So, try your method first, and if it gives no results in the goodness of fit table, you could try regressing on a dummy variable, such as regressing on a constant.

Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 200 views
  • 1 like
  • 2 in conversation