BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
lsandell
Obsidian | Level 7

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;
1 ACCEPTED SOLUTION

Accepted Solutions
SAS_Rob
SAS Employee

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

 

View solution in original post

1 REPLY 1
SAS_Rob
SAS Employee

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

 

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 501 views
  • 1 like
  • 2 in conversation