Journal of Statistical Software (Nov 2018)

merDeriv: Derivative Computations for Linear Mixed Effects Models with Application to Robust Standard Errors

  • Ting Wang,
  • Edgar C. Merkle

DOI
https://doi.org/10.18637/jss.v087.c01
Journal volume & issue
Vol. 87, no. 1
pp. 1 – 16

Abstract

Read online

While likelihood-based derivatives and related facilities are available in R for many types of statistical models, the facilities are notably lacking for models estimated via lme4. This is because the necessary statistical output, including the Hessian, Fisher information and casewise contributions to the model gradient, is not immediately available from lme4 and is not trivial to obtain. In this article, we describe merDeriv, an R package which supplies new functions to obtain analytic output from Gaussian mixed models. We discuss the theoretical results implemented in the code, focusing on calculation of robust standard errors via package sandwich. We also use the sleepstudy data to illustrate the package and to compare it to a benchmark from package lavaan.

Keywords