Thanks for the support offered Please find the code, ods graphics on; proc mcmc data=input nmc=&nmc nbi=&nbi monitor=(_parms_ resn_pred_act resn_pred_ctrl resn_eos_act resn_eos_ctrl diff) diagnostics=(mcse autocorr ess) statistics=(summary intervals) stats(alpha=0.20) outpost=pred; /*** Set up the constants for the beta distributions (a and b) ***/ begincnst; a_act=1; b_act=1; a_ctrl=1; b_ctrl=1; endcnst; /*** Priors: distributions and initial values ***/ prior theta_act ~ beta(a_act,b_act); prior theta_ctrl ~ beta(a_ctrl,b_ctrl); parms theta_act 0.5 theta_ctrl 0.5; /*** Likelihood ***/ model resn_ia_act ~ binomial(n_ia_act,theta_act); model resn_ia_ctrl ~ binomial(n_ia_ctrl,theta_ctrl); /*** Predicted number of responders in the remaining sample (n - n_ia)***/ resn_pred_act = rand("binomial", theta_act, n_po_act); /*_p0: post interim*/ resn_pred_ctrl = rand("binomial", theta_ctrl, n_po_ctrl); /*** Number of responders at the end of the study = ia + pred ***/ resn_eos_act = resn_ia_act + resn_pred_act; resn_eos_ctrl = resn_ia_ctrl + resn_pred_ctrl; /*** Determine the probability that the difference is greater than 30% ***/ diff = theta_act - theta_ctrl; ods output PostSummaries=posterior1 PostIntervals=posterior2; run; ods graphics off;
... View more