Hello brms users,
In discussion with some colleagues today, we were wondering if you could estimate a time varying effect of a mediator using brms. I will have a play in the next couple of weeks but keen to know of anyone has tried or has ideas on wjat the model might look like.
Here is what I am thinking so far;
t = multiple time points
p = participants
m = mediator
z = outcome
# One implementation z ~ (t+m|t/p), t ~ m|t/p #Another idea a colleague suggested z ~ (t*m|p), t ~ m|p
EDIT: I had more of a think and changed the nesting.
Does this model give the effect of the mediator and how it is changing over time ?
Oh disclaimer Im still new to this so I thought it was an interesting question, dont hold back if its dumb.
- Operating System: Linux
- brms Version: 2.3.1
If anyone wants to try the model Paul recommends below then I have uploaded some simulated data kindly provided by the authors in article linked below. ExampleYing.csv (9.2 KB)