llcont.lmerMod {merDeriv} | R Documentation |
Extract Case-wise Log Likelihoods for Linear Mixed Effects Models
Description
A function for extracting the case-wise log likelihoods of a linear mixed effects model fitted via lme4. This function returns the case-wise log likelihoods, evaluated at the ML estimates.
Usage
## S3 method for class 'lmerMod'
llcont(x, ...)
Arguments
x |
An object of class |
... |
additional arguments, including |
Value
If level = 2
, a vector of log-likelihoods whose length is
the number of clusters. If level = 1
, a vector of length n,
containing log-likelihoods for all n observations.
References
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
Merkle, E. C., You, D. and Preacher, K. J., 2016. Testing Nonnested Structural Equation Models. Psychological Methods, 21(2), 151. https://arxiv.org/pdf/1402.6720v3
Examples
## Not run:
# The sleepstudy example
lme4fit <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, REML = FALSE)
# clusterwise log likelihood
llcont(lme4fit)
## End(Not run)