BookmarkSubscribeRSS Feed
Leila
Calcite | Level 5

Hello everyone,

I want to fit this model using PROC MCMC but, it did not fit properly.

Please help me to find error of the program.

Thank You in Advance.


**********Constrained Log binomial Model****************


proc mcmc data=one seed=12345 nbi=200000 nmc=2000000 stats(percent=2.5 97.5);

      parms beta0 0 beta1 0 beta2 0 beta3 0 s2 1;

      prior s2 ~ igamma(0.01, s=0.01);

      prior beta0 ~ normal(0,v=100);

      prior beta1 ~ normal(0,v=100);

    prior beta2 ~ normal(0,v=100);

    prior beta3 ~ normal(0,v=100);

      random delta ~ normal(beta0, var=s2) subject=cluss_co;

    eta = delta + beta1*x + beta2*u_inc + beta3*rdveg;

      px  = exp(eta);

      if(px=1) then px=0.9999999999999999;

      lp  = y * log(px) + (1-y)*log(1-px);

    if(eta > 0) then lp=-10000000000000;

      model general(lp);

      ods output postsummaries=randsum geweke=rgew;

run;Proa

2 REPLIES 2
JacobSimonsen
Barite | Level 11

Can you specify more detail about what the problem is.

I see often problems with log-binomial models, due to the fact that there is no mechanism that ensure that all estimated probabilites is in the interval (0,1) at the maximum-likelihood value. I thiink  an error will occur at the first iteration in the mcmc-algortitm where one of the probabilities is estimated outside the interval. So, maybe a change to logit-scale can solve the problem.

Leila
Calcite | Level 5

Thank you so much

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1454 views
  • 3 likes
  • 2 in conversation