View source: R/estfun.lmerMod.R
estfun.lmerMod | R Documentation |
A function for extracting the case-wise and cluster-wise derivatives of a linear mixed effects models fitted via lme4. This function returns the case-wise and cluster-wise scores, evaluated at the ML estimates.
## S3 method for class 'lmerMod' estfun(x, ...)
x |
An object of class |
... |
additional arguments, including |
If level = 2
, a g by p score matrix, corresponding to
g clusters and p parameters. If level = 1
, a n by
p score matrix, corresponding to
n observations and p parameters.
For models with multiple clustering variables (three-level models,
crossed random effects), an error is thrown if level = 2
.
If ranpar = "var"
, the random effects are parameterized as
variance/covariance; If ranpar = "sd"
, the random effects are
parameterized as standard deviation/correlation.
Wang, T. & Merkle, E. C. (2018). Derivative Computations and Robust Standard Errors for Linear Mixed Effects Models in lme4. Journal of Statistical Software, 87(1), 1-16. doi: 10.18637/jss.v087.c01
## Not run: # The sleepstudy example lme4fit <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, REML = FALSE) # casewise scores estfun(lme4fit, level = 1, ranpar = "var") # clusterwise scores estfun(lme4fit, level = 2, ranpar = "sd") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.