Description Usage Arguments Details See Also
pull_resid
takes a hierarchical linear model fit as a lmerMod
or lme
object and returns various types of level-1 residuals as a
vector. Because the pull_resid
only calculates one type of residual,
it is more efficient than using hlm_resid
and indexing the
resulting tibble. pull_resid
is designed to be used with methods that
take a long time to run, such as the resampling methods found in the
lmeresampler
package.
1 2 3 4 5 6 7 8 | ## Default S3 method:
pull_resid(object, ...)
## S3 method for class 'lmerMod'
pull_resid(object, type = "ls", standardize = FALSE, ...)
## S3 method for class 'lme'
pull_resid(object, type = "ls", standardize = FALSE, ...)
|
object |
an object of class |
... |
not in use |
type |
which residuals should be returned. Can be either 'ls', 'eb', or 'marginal' |
standardize |
a logical indicating if residuals should be standardized |
type = "ls"
Residuals calculated by fitting separate LS
regression models for each group. LS residuals are unconfounded by higher
level residuals, but unreliable for small within-group sample sizes. When
standardize = TRUE
, residuals are standardized by sigma components of
the model object.
type = "eb"
Residuals calculated using the empirical Bayes (EB)
method using maximum likelihood. EB residuals are interrelated with higher
level residuals. When standardize = TRUE
, residuals are standardized
by sigma components of the model object.
type = "marginal"
Marginal residuals only consider the fixed
effect portion of the estimates. When standardize = TRUE
, Cholesky
residuals are returned.
hlm_resid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.