[R-sig-eco] how to do ChiX2 goodness of fit tests on weird distributions?

Erika Mudrak mudrak at wisc.edu
Thu Jun 11 23:40:26 CEST 2009


Hello everyone-

I have several sets of data that I fit (using MLE) to several uncommon distributions (betabinomial, zero-inflated negative binomial, zero-inflated betabinomial, zero-inflated binomial etc...). 

I used dzinbinom from the emdbook package, corresponding to Benjamin Bolker's book, Ecological Models and Data in R, and dzibinom and dzibb as developed on page 285-286 of this book. 

I have compared them using AIC values (with AICtab from the bbmle package), but I would still like to do a goodness of fit test on the "winner" to see if it is a reasonable distribution. 

goodfit() from vcd can only take poisson, binomial, and nbinomial. 

I would like to use chisq.test, but I am having trouble coming up with the reference distribution.

I followed an example on page 287 of this book where the reference distribution is calculated using dzibb, and then used it in the slot for p, a vector of probabilities: 


ZIBBprob=dzibb(1:size, prob=blurf1, theta=blurf2, size=blurf3, zprob=blurf4)
chisq.test(tabulate(obs),p=ZIBBprob)

My problem is that the ZIBBprob vector does not add up to 1...  Is this because I am mis-using dzibb?  

Does anyone have any suggestions on how I can perform GOF tests on these weirdo distributions?

Thanks

Erika Mudrak



-------------------------------------------
Erika Mudrak
Graduate Student
Department of Botany
University of Wisconsin-Madison
430 Lincoln Dr
Madison WI, 53706
608-265-2191
mudrak at wisc.edu



More information about the R-sig-ecology mailing list