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 (August 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 1 Aug 1996 20:32:04 -0300
Reply-To:   Silvano <silvano@UEL.BR>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Silvano <silvano@UEL.BR>
Subject:   Re: Zero-Inflated Poisson models
Content-Type:   text/plain; charset="iso-8859-1"

Hello all,

I read the message of Dale about ZIP models and I am trying fit one. I have two variables: FOTOP with 2 levels and BAP with 4 levels. My response variable is shoots' number. I fitted the models below, but it isnīt work. I donīt know if I create the levels of BAP correctly, so I make two programs but both isnīt work I need help.

The SAS programs are:

Proc nlmixed data=biom57 hess corr cov list; parms beta0=1 beta1=1 gamma0=1 gamma1=1; eta1= beta0 + beta1*fotop; * + null_2*bap; w = exp(eta1)/(1+exp(eta1)); eta2=gamma0 + gamma1*bap ;*+ null_1*fotop; lambda=exp(eta2); if y=0 then prob=w + (1-w)*exp(-lambda); if y=0 then logver=log(prob); else logver=log(1-w)+y*log(lambda) - lambda - lgamma(y+1); model y ~ general(loglike); run;

and the other:

%macro zip_model(lev_fotop=, lev_bap=); proc nlmixed data=biom57; eta1 = beta0 %do i=1 %to %eval(&lev_fotop-1); + (fotop=&i)*fotop_&i %end; %do i=1 %to %eval(&lev_bap-1); + (bap=i)*bap_&i %end; %do i=1 %to %eval(&lev_fotop-1); %do j=1 %to %eval(&lev_bap-1); + (fotop=&i & bap=&j)*inter_&i._&j %end; %end; ; w = exp(eta1)/(1+exp(eta1)); eta2 = gamma0 %do i=1 %to %eval(&lev_bap-1); + (bap=i)*bap_&i %end; ; lambda=exp(eta2); if y=0 then prob=w + (1-w)*exp(-lambda); if y=0 then logver=log(prob); else logver=log(1-w)+y*log(lambda) - lambda - lgamma(y+1); model y ~ general(loglike); run; %mend; %zip_model(lev_fotop=2, lev_bap=4);

Thanks for your help.

Silvano.


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