Programming the statistical procedures from SAS


New Contributor
Posts: 4


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;


Super Contributor
Posts: 301

Re: Proc MCMC

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.

New Contributor
Posts: 4

Re: Proc MCMC

Posted in reply to JacobSimonsen

Thank you so much

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation