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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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