For each lambda in an input vector of values, fit a penalized mvregmed model
mvregmed.grid(x, mediator, y, lambda.vec, max.outer = 5000,
max.inner = 2, x.std = TRUE, med.std = TRUE, y.std = TRUE,
step.multiplier = 0.5, print.iter = FALSE, max.cor=0.99)An object of class mvregmed.grid
matrix with columns representing "exposure" variable (sometimes called instrumental variable)
matrix with columns representing mediator variables
matrix with columns representing outcome variables
Vector of values of penalty parameter lambda's
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.
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.
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 DS, Dikilitas O, Sinnwell JP, Kullo I (2022). Penalized mediation models for multivariate data. Genet Epidemiol 46:32-50.
mvregmed.fit
data(medsim)
mvfit.grid <- mvregmed.grid(x, med[,1:10], y, lambda.vec=seq(.3, .04, by=-.01))
summary(mvfit.grid)
## plot(mvfit.grid)
Run the code above in your browser using DataLab