Skip to content
Prev 7758 / 20628 Next

extracting gradient and hessian matrix from lme4

Hi,

I am trying to use a multivariate mixed effects linear model to
examine mediation.  This works fine.  The final step is to compute the
indirect effect and its standard error.  The indirect effect is easy
(product of coefficients plus their covariance).  For the standard
error, I need the gradient (D) and the hessian (H):
the variance is then:

D'\Sigma(\theta)D + \frac{1}{2}Tr{(\mathbf{H}\boldsymbol{\Sigma}(\theta))^{2}}

This is all given in the Appendix of
http://www.unc.edu/~dbauer/manuscripts/bauer-preacher-gil-PM-2006.pdf

Is there a way to get this out of a mer class object?  Looking at
class?mer, the appropriate bits of vcov give me $\Sigma(\theta)$.  @V
seems like it would give me the gradient but is null for a basic lmer
model.

Thanks,

Josh