Date: Mon, 27 Apr 2009 05:28:41 -0700
Reply-To: Ryan <Ryan.Andrew.Black@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ryan <Ryan.Andrew.Black@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Code for Hurdle-NegBin Model in NLMIXED
Content-Type: text/plain; charset=ISO-8859-1
For those interested, here's a solution that seems correct to me:
proc nlmixed data=mydata;
eta_zip=beta_l*X;
p0_zipe=1/(1+exp(-eta_zip));
eta_nb=beta_p*X;
mean=exp(eta_nb);
p=1/(1+(1/v)*mean);
p0=log(p0_zipe);
p_else=log(1-p0_zipe)+y*log(1-p)-log(p**(-1*(v))-1)+lgamma(y+(v))-
lgamma(v)-log(fact(y));
if y=0 then loglike=(p0);
else loglike=(p_else);
model y ~ general(loglike);
run;