digital-wellbeing / gametime-longitudinal

Data and code required to reproduce all analyses reported in our manuscript, Time spent playing video games is unlikely to impact well-being (Vuorre, Johannes, Magnusson, & Przybylski, 2021).
https://digital-wellbeing.github.io/gametime-longitudinal
Creative Commons Attribution 4.0 International
6 stars 0 forks source link

brms riclpm #1

Closed mvuorre closed 3 years ago

mvuorre commented 3 years ago

Just some quick notes. The brms riclpm needs to include the first timepoint x&y as outcomes, and three residual correlations. These can be added by i. include two more formulas (for 1st wave), ii. set_rescor(TRUE), and maybe by iii. manually set some response correlations to zero in the generated stan code.

https://github.com/digital-wellbeing/gametime-longitudinal/blob/41cee75ac6402ebcc89a11bec9f693ac02a6e22e/Models/RI-CLPM/RICLPM-brms-simulation.Rmd#L153

rpsychologist commented 3 years ago

Something like this? However, I don't think manually centering the variables will work.

fx1 <- bf(x1 ~ 1)
fy1 <- bf(y1 ~ 1)
fx2 <- bf(wx2 ~ wx1 + wy1)
fy2 <- bf(wy2 ~ wx1 + wy1)
fx3 <- bf(wx3 ~ wx2 + wy2)
fy3 <- bf(wy3 ~ wx2 + wy2)

fit_brms_wide_wc <- brm(
    formula =
        fx2 + fy2 +
        fx3 + fy3 +
        fx1 + fy1 +
        set_rescor(TRUE),
    data = dw,
)
mvuorre commented 3 years ago

This seems about right, and then we'll need to find a way to correlate x1&y1, x2&y2, x3&y3, optimally such that its not three separate correlations but identical across timepoints. If we just set_rescor(TRUE), it is going to correlate all the responses (e.g. y1&wx2), which are already parameters in the model. So if we can e.g. modify the stan code that this outputs, we could do it.

I am not sure why manually centering doesn't work?