FOCUS AREAS

SAS/STAT Examples

Bayesian Binomial Model with Power Prior Using the MCMC Procedure


Contents | SAS Program | PDF


   data ptrials;
      input y n;
      datalines;
   5 163
   ; 


   data btrials;
      input y n @@;
      datalines;
   2  86
   2  69
   1  71
   1 113
   1 103
   ;


   data alldata;
      set btrials(in=i) ptrials;
      if i then group='current';
      else group = 'pilot';
   run;


ods graphics on;
proc mcmc data=alldata seed=1181 nmc=10000;
   parms p 0.2;
   begincnst;
      a0 = 0.5;
   endcnst;
   prior p ~ uniform(0,1);
   llike = logpdf('binomial',y,p,n);
   if (group='pilot') then llike = a0*llike;
   model general(llike);
run;     
ods graphics off;