Description Usage Arguments Details Note
View source: R/hlm_influence.R
This function is used to compute influence diagnostics for a hierarchical linear model.
It takes a model fit as a lmerMod
object or as a lme
object and returns a tibble with Cook's
distance, MDFFITS, covtrace, covratio, and leverage.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Default S3 method:
hlm_influence(model, ...)
## S3 method for class 'lmerMod'
hlm_influence(
model,
level = 1,
delete = NULL,
approx = TRUE,
leverage = "overall",
data = NULL,
...
)
## S3 method for class 'lme'
hlm_influence(
model,
level = 1,
delete = NULL,
approx = TRUE,
leverage = "overall",
...
)
|
model |
an object of class |
... |
not in use |
level |
used to define the group for which cases are deleted and influence
diagnostics are calculated. If |
delete |
numeric index of individual cases to be deleted. If the |
approx |
logical parameter used to determine how the influence diagnostics are calculated.
If |
leverage |
a character vector to determine which types of leverage should be included in the
returned tibble. There are four options: 'overall' (default), 'fixef', 'ranef', or 'ranef.uc'.
One or more types may be specified. For additional information about the types of leverage, see
|
data |
(optional) the data frame used to fit the model. This is only necessary for |
The hlm_influence
function provides a wrapper that appends influence diagnostics
to the original data. The approximated influence diagnostics returned by this
function are equivalent to those returned by cooks.distance
, mdffits
, covtrace
,
covratio
, and leverage
. The exact influence diagnostics obtained through a full
refit of the data are also available through case_delete
and the accompanying functions
cooks.distance
, mdffits
, covtrace
, and covratio
that can be called
directly on the case_delete
object.
It is possible to set level
and delete individual cases from different groups using
delete
, so numeric indices should be double checked to confirm that they encompass entire groups.
Additionally, if delete
is specified, leverage values are not returned in the resulting tibble.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.