Hi,
I am trying to do a hurdle model with a truncated negative binomial
distribution instead of a poisson. I keep getting the error message:
"NOTE: Execution error for observation 1."
I have tried setting the initial parameters to zero, 1 and -1. But I still
get the same message. The code I am running is:
options ls=74 ps=100 nodate nocenter pageno=1;
Data main;
input salinity male female court;
mf = male*female;
sf = salinity*female;
sm = salinity*male;
smf= salinity*male*female;
;
cards;
0 1 1 0
0 1 1 0
0 1 1 29
...more data......
;
proc sort data=main;
by male female salinity;
run;
proc nlmixed data = main;
parms a0 = 0 a1 = 0 a2 =0 a3=0 b0 = 0 b1 = 0 b2 = 0 b3 = 0 b4 = 0 b5 = 0 b6 =
0 b7 = 0 alpha=0;
eta0 = a0 + a1 * male + a2 *female + a3 *mf;
etap = b0 + b1 * male + b2 * female + b3 * mf + b4 * salinity +
b5 * sm + b6 * sf + b7 *smf;
exp_eta0 = exp(eta0);
mu = exp(etap);
p0 = exp_eta0 / (1 + exp_eta0);
m=1/alpha;
if court = 0 then ll = log(p0);
else ll = lgamma(court+m)-lgamma(court+1)-lgamma(m) + court*log(alpha*mu)-
(court+m)*log(1+alpha*mu)- log(1 -( 1 + alpha*mu)**(-m));
model court ~ general(ll);
run;
Any help would be greatly appreciated!!,
Emma
... View more