I am fitting a logistic regression in PROC MCMC and need to calculate the 95% HPD Credible Interval on the Odds Ratio (exponentiated) scale for each chain before taking the average across chains. Rather than taking the average posterior mean(s) and interval values and then exponentiating, I need to exponentiate means and interval values and then take the average. The BAYES statement has the STORE option so that posterior samples and 95% CrI can be determined. Note: I need to use PROC MCMC, so any solutions with GENMOD aren't desired.
How could I accomplish this, either through an existing statement or through a manual calculation? Thanks!
proc mcmc data=data.XX
plots=all
nbi=1000
nmc=9000
seed=123
dic
plots(smooth)=all
statistics=all
outpost=post1;
parms (beta0 B_tx) 0;
prior beta0 ~ normal(0,var=1);
prior B_tx ~ normal(0,var=1);
p = logistic(beta0 + B_tx*tx);
model outcome ~ binary(p);
run;
You could do something similar to this example in the documentation to compute posteriors for the odds ratios.
SAS Help Center: Missing at Random Analysis
You could do something similar to this example in the documentation to compute posteriors for the odds ratios.
SAS Help Center: Missing at Random Analysis
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.