LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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;


Back to: Top of message | Previous page | Main SAS-L page