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.
field | class.insect | observ_freq |
1 | 0 | 353 |
1 | 1 | 19 |
2 | 0 | 580 |
2 | 1 | 30 |
2 | 2 | 3 |
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) :
Thank you.
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.