I'm attempting to implement a snippet of code found at this site:
http://www.ats.ucla.edu/stat/sas/code/zip_zinb.htm
They show a way to fit a zero-modified negative binomial distribution in SAS 9.1. However, I'm getting the following errors:
ERROR: Signal caught by CMP from PROC.
ERROR: Invalid Operation.
ERROR: Termination due to Floating Point Exception
The procedure gets to 6 iterations before returning this error.
This is a bit of a shot in the dark, but while I try to understand the error I was hoping someone else had a similar experience. The code is as follows:
*zero inflated negative binomial, producing the same result as "zinb count child camper persons, inflate(child)" in Stata;;
proc nlmixed data=fish;
parameters b0=0 b1=0 b2=0 b3 = 0
a0=0 a1 = 0 alpha = 1;
/* linear predictor for the inflation probability */
linpinfl = a0 + a1*child;
/* infprob = inflation probability for zeros */
/* = logistic transform of the linear predictor*/
infprob = 1/(1+exp(-linpinfl));
/* negative binomial with mean-dispersion */
lambda = exp(b0 + b1*child + b2*camper + b3*persons );
/* Build the ZIP log likelihood */
m = 1/alpha;
p = 1/(1+alpha*lambda);
if count=0 then
ll = log(infprob + (1-infprob)*(p**m));
else ll = log(1-infprob) + log(gamma(m + count)) - log(gamma(count + 1))
- log(gamma(m)) + m*log(p) + count*log(1-p);
model count ~ general(ll);
run;
I appreciate any and all help!!