Hello all,
I am trying to fit a brm model with some pretty sparse data; I cannot collect more data so please refrain from that suggestion. I do not have a large sample size, so I have issues with convergence for complex models. What I have is 25 subjects (ID) each with two Trials (Trial). Trials are of varying duration (Duration), which means that the Behaviors (Grim) vary due to Trial and Duration. I need to control for Duration and Trial, but what I am really interested in is the ID variable and whether the effect of ID remains consistent across trials. That is, are subject scores repeatable while controlling for a duration effect and the mean trial effect. What I think is that I should be testing a slope variable: does the Behavior remain consistent across Trial 1 and 2 within each individual (slope of each individualâs behavior across trials), while acknowledging that Duration of trial has an influence on likelihood of a behavior occurring and that Trial 2 likely has a more muted response in general across all individuals.
I am having trouble parameterizing this in R, though. Essentially, I have n=1 per ID/Trial class with 25 IDs and 2 Trials per ID, since I was only able to run two Trials per ID. I have been working with variations of this model:
Model <- brm(Grim ~ 1 + Trial + Duration + (1|ID), data=Rep, iter=10000, cores=2, chains = 2, control=list(max_treedepth=15, adapt_delta=.9999999999999999))
Which barely converges (hence the lengthy adapt_delta). If this is right, though, I am unsure which output means what I want. I thought, perhaps, sd_ID_intercept? and if the 95% CI overlaps with 0 than individual IDâs Behavior does not markedly change across Trials? But what throws me is the intercept suffix for sd_ID. Currently, I do not really care about whether IDs differ from each other (between individiual variation), only if individuals show little within individual variation (95% CI overlaps with 0).
I also wondered whether I could build two models, one with 1|ID and one without, and see if those two models significantly differ, but this is hard to visualize when I still get confused about the above parameterization issue.
Essentially, I am trying to parameterize a Bayesian rptR https://cran.r-project.org/web/packages/rptR/vignettes/rptR.html . rptR gives me singularity errors. I wanted to try stan_surv (since Duration is built into the model), but cannot get the package to even compile due to low memory.
Any help would be greatly appreciated - I think it is probably obvious from my writing, but stats are not my major disciplinary focus.