I have encountered problems with the Bayesian analysis of a crossover trial with three treatments in three periods using six treatment sequences (3-by-6 Williams design). SAS PROC MCMC does not yield the correct estimates for between and within subject variability, and the standard deviations of the parameters are too large.
The data are analyzed using a linear mixed effects model with fixed effects for the factors treatment, period and sequence, and subject as random effect. The Bayesian analysis uses non-informative priors for all fixed effect parameters. Treatment effects (trt1, trt2) shall be estimated as well as the between and within subject variability standard deviations (sd_s, sd). SAS PROC MCMC does not provide acceptable estimates for sd=9.1 and sd_s=13.6. Since I use non-informative priors, this can be compared with the corresponding PROC MIXED in the framework of a frequentist analysis, which gives values SD=6.2 and SD_s=6.0 for this example dataset. Furthermore, the analysis of the same dataset with the same model implemented in R/WinBUGS or using the R function lme also yields the latter results. Therefore I think that the results of proc MCMC are incorrect. An example dataset and a code for the analysis is attached.
Guido,
When you come to this thread, there should be options to mark a post as "Helpful" (orange star) or "Correct" (green star). No one else would be able to see the buttons, and you won't see them on threads that you did not originate..
Steve Denham
I would definitely forward this on to Technical Support, especially as you have analyses in three platforms that give contradictory results.
Steve Denham
Hi Steve,
Thank you for your reply. I just wanted to make sure I have no programming mistake in my code. In the meantime I have received also feedback from others and the problem seems to be that the gamma distribution for the priors of the precisions was incorrectly parametrized. I have to specify the rate parameter, i.e. the inverse of the scale parameter, in the gamma distribution: gamma(shape=a, iscale=b); what I had wrongly used was gamma(shape=a, scale=b). With this the prior is the same as in WinBUGS. This leads to expected results and solves the problem.
Guido
Mark your answer as correct, so that future searches will turn this up.
Steve Denham
> Mark your answer as correct, so that future searches will turn this up
Please can I ask how the status of the answer can be changed, I cannot find a button to do so. (Sorry for the confusion.)
Guido
Guido,
When you come to this thread, there should be options to mark a post as "Helpful" (orange star) or "Correct" (green star). No one else would be able to see the buttons, and you won't see them on threads that you did not originate..
Steve Denham
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.