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

I've recently started using PROC BGLIMM for modelling Binary Repeated Measures Models with Random Effects. I must say it is a wonderful breath of fresh air for Bayesian Models. After reading the BGLIMM documentation, I have the following questions:

  1. Is the Hamiltonian Monte Carlo or Gamerman's algorithm used for posterior sampling?
  2. If the default sampler uses Gamerman's algorithm, is there a way to specify that BGLIMM use the HMC sampler?

Please find below my SAS script for this example:

proc bglimm data=data_in nmc=3000 seed=901214 Statistics=sum Stats=int diag=autocorr;
    class home trt_assign participant_id session_instance_new cohort;
    model home(event = "1") = trt_assign calcage baseline_measurement / dist=binary link=logit;
    random time/ type=ar(1) subject=participant_id;
    random intercept/ subject=cohort;
run;

Thanks again in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Of course, it is the perfectly obvious (hah! 🤔) NUTS option in either the RANDOM statement (for G side effects) or the REPEATED statement (for R side effects)..

 

SteveDenham

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

Of course, it is the perfectly obvious (hah! 🤔) NUTS option in either the RANDOM statement (for G side effects) or the REPEATED statement (for R side effects)..

 

SteveDenham

hakeem
Fluorite | Level 6

Hi Steve.

 

Thank you for responding to my question. 

 

For completeness, to specify the HMC sampler in BGLIMM with the default settings, simply include the "nuts" syntax in the random/repeat statements. The SAS script would thus run as follows:

 

proc bglimm data=data_in nmc=3000 seed=901214 Statistics=sum Stats=int diag=autocorr;
    class home trt_assign participant_id session_instance_new cohort;
    model home(event = "1") = trt_assign calcage baseline_measurement / dist=binary link=logit;
    random time/ type=ar(1) subject=participant_id nuts;
    random intercept/ subject=cohort nuts;
run;

SteveDenham
Jade | Level 19

I believe that is correct.  The code as presented will give the estimates conditional on the random effects.  Should you want the marginal estimates averaged over time, you could replace the first RANDOM statement with a REPEATED statement.

 

SteveDenham

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 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
  • 3 replies
  • 722 views
  • 1 like
  • 2 in conversation