BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GuidoThoemmes
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

View solution in original post

5 REPLIES 5
SteveDenham
Jade | Level 19

I would definitely forward this on to Technical Support, especially as you have analyses in three platforms that give contradictory results.

Steve Denham

GuidoThoemmes
Calcite | Level 5

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

SteveDenham
Jade | Level 19

Mark your answer as correct, so that future searches will turn this up.

Steve Denham

GuidoThoemmes
Calcite | Level 5

> 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

SteveDenham
Jade | Level 19

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1617 views
  • 3 likes
  • 2 in conversation