Fit regularized mediation model for a specified lambda penalty value. Structural equation models for analysis of multiple exposures (x), multiple mediators, and multiple outcome variables (y) are fit with a lasso (L1) penalaty on the model parameters. The model is x-[alpha] -> mediator-[beta] -> outcome, where alpha and beta are the parameters for the indirect effect of x on y, through the mediator. The model also allows a direct effect of x on y: x-[delta]->y.
mvregmed.fit(x, mediator, y, lambda, x.std = TRUE, med.std = TRUE,
y.std = TRUE, max.outer = 5000, max.inner = 2, step.multiplier = 0.5,
print.iter = FALSE, max.cor=0.99)An object of class mvregmed
matrix with columns representing "exposure" variable (sometimes called instrumental variable)
matrix with columns representing mediator variables
matrix with columns representing outcome variables
lambda penalty parameter
logical (TRUE/FALSE) whether to standardize x by dividing by standard devation of x. Note that each column of x will be centered on its mean.
logical (TRUE/FALSE) whether to standardize mediator by dividing by standard devation of mediator. Note that each column of mediator will be centered on its mean.
logical (TRUE/FALSE) whether to standardize y by dividing by standard devation of y. Note that each column of y will be centered on its mean.
maximum number of outer loop iterations. The outer loop cycles over several inner loops.
maximum number of iterations for each inner loop. There is an inner loop for each paramemeter in the matrices alpha, beta, delta, and vary.
In inner loop, the step size is shrunk by the step.multiplier to assure that step size is not too large. Generally, the default of 0.5 works well.
print iteration number during fitting routine
maximum correlation within y, x, or mediators, so fitting is more robust
Daniel Schaid and Jason Sinnwell
Schaid DJ, Dikilitas O, Sinnwell JP, Kullo I (2022). Penalized Mediation Models for Multivariate Data. Genet Epidemiol 46:32-50.
mvregmed.grid
data(medsim)
mvfit <- mvregmed.fit(x, med[,1:10], y, lambda=.1)
summary(mvfit)
Run the code above in your browser using DataLab