falkcarl / multilevelmediation

5 stars 1 forks source link

Can lme4 or other packages be used if not all paths are random? #17

Closed toddvogel1628 closed 3 years ago

toddvogel1628 commented 4 years ago

I'm not sure if you tested this on the BPG dataset, but if only one (or none) of the a or b paths is random can lme4 be used? I.e., if the covariance matrix of the random effects is not required, is the indirect effect (a*b product) distribution the same for both nlme and lme4?

This could significantly speed things up, since nlme would only be required for models with a and b paths as random.

toddvogel1628 commented 3 years ago

I tested a few models with lme4 and was able to get very similar estimates of the indirect effect and the different paths. The bootstrapping seemed similar as well, but I will have to test things more systematically. The specified random effects in these models was quite minimal, however, most of them only had random intercepts on the a and b regressions.

falkcarl commented 3 years ago

Yes, thought I'd prefer to combine this with #4