I have some longitudinal data with the following variables, id, time, outcome, stress, and multiple measurements on stress and outcome over time for each id. The question of interest would be, does the change over time (ie growth, trajectory, slope, whatever you want to term it) in stress predict the change over time (growth, trajectory) in the outcome. When I think about this question it almost sounds like, “do the id level slopes in stress predict the id level slopes in outcome?”
I guess I am daft, but I am having a really hard time trying to figure out how to model this question!! (I did try to simulate some data, but I don’t think I ended up simulating quite what I wanted.)
I think what I might want is something called a “multivariate growth model”? But I have had trouble seeing exactly how to formulate it.
Here is what my ideas were:
bf_stress <- bf(stress ~ 0 + (1 + time|p|id))
bf_outcome <- bf(outcome ~ 0 + (1 + time|p|id))
m1 <- brm(bf_outcome + bf_stress + set_rescor(FALSE), data=data)
This would give me the correlation between the varying slopes for stress and the varying slopes for outcome but that isn’t exactly what I was looking for.
Another idea was:
bf_stress <- bf(stress ~ time + (time|p|id))
bf_outcome <- bf(outcome ~ time*stress + (time|p|id))
m2 <- brm(bf_stress + bf_outcome + set_rescor(FALSE), data=data)
This includes stress in the outcome model, but I don’t see that it is really looking at the association of the growth in stress over time with the growth in outcome over time…
I have also thought about running a growth model on stress and one on outcome and then extracting the point estimates and sd’s for the slopes for each and then running a measurement error model using the slopes as data, like this:
m.s <- brm(stress ~ 0 + (1 + time|id), data=data)
m.o <- brm(outcome ~ 0 + (1 + time|id), data=data)
#insert code to extract means and sd's from posterior samples and create new dataframe that is length(id) long
m.sl <- brm(slopes_outcome | mi(sd_outcome) ~ 1 + me(slopes_stress, sd_stress), data=data2)
But that just seems rather hackish and also weird…
Is there a way to answer my question in a single model? I’d be grateful if someone could help! My experience is limited in these sort of longitudinal growth models.
What it seems like I want is for the growth model for stress to be the predictor for the growth model for outcome… but how?
Thanks!