BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
john1111
Obsidian | Level 7

 

I'm running the following two codes on the attached data and getting two different results. Moreover the results for the Zero inflation do not appear correct. I don't know whether it is a problem with some code or It's a sign that zero inflation is not the best for this data! because even the significance of the Zero inflation estimates is way off from proc nlmixed

 

 

proc genmod data = bbbb;
  model y_c = x1 x2/dist=zip;
  zeromodel x1 x2 /link = logit;
run;

/*********************************************************************************************************/

proc nlmixed data=bbbb;
   parameters b0=0 b1=0 b2=0 
              a0=0 a1 = 0 a2=0 ;
   linpinfl = a0 + a1*x1 + a2*x2;
  infprob  = 1/(1+exp(-linpinfl));
   lambda   = exp(b0 + b1*x1 + b2*x2 );
   if y_c=0 then 
        ll = log(infprob + (1-infprob)*exp(-lambda));
   else ll = log((1-infprob)) - lambda  + y_c*log(lambda) - lgamma(y_c + 1);
   model y_c ~ general(ll);
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I suggest you simulate data that matches the model. You will then know the true values of the parameters and you can assess which method performs as expected. Simulation enables you to generate a large data set (such as 10,000 observations) so that the standard errors for the statistics are very small.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

I suggest you simulate data that matches the model. You will then know the true values of the parameters and you can assess which method performs as expected. Simulation enables you to generate a large data set (such as 10,000 observations) so that the standard errors for the statistics are very small.

john1111
Obsidian | Level 7

Thanks a lot for this idea! I noticed the problem! I messed up the data unknowingly and I didn't realize that I had deleted all the observations with the Zero counts.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1630 views
  • 0 likes
  • 2 in conversation