Set up data to input to lavaan structural equation model (sem)
mvregmed.lavaan.dat(x, mediator, y, max.cor=0.99)A dataframe with updated x, mediator, and y
matrix of exposure variables
matrix of mediators
matrix of outcome variables
maximum correlation within mediators, so that fitting is more robust
Daniel Schaid and Jason Sinnwell
Use the function regmed.dat.check to standardize all variables and subset to subjects without missing data
Schaid DS, Dikilitas O, Sinnwell JP, Kullo I (2022). Penalized mediation models for multivariate data. Genet Epidemiol 46:32-50.