empinf_mer: Empirical Influence Values for Two-Level Mixed Models

View source: R/empinf_mer.R

empinf_merR Documentation

Empirical Influence Values for Two-Level Mixed Models

Description

This function calculates the empirical influence values for a statistic in a given fitted model object using the delete-m_j jackknife.

Usage

empinf_mer(x, FUN, index = 1)

empinf_merm(x, FUN)

Arguments

x

A fitted merMod object from lmer.

FUN

A function taking a fitted merMod object as input and returning the statistic of interest.

index

An integer stating the position of the statistic in the output of FUN(x).

Details

empinf_mer computes non-parametric influence function of models fitted using lmer by deleting one cluster at a time. See van der Leeden, Meijer, and Busing (2008, pp. 420–422) for more information. Whereas empinf_mer computes influence values for a specified position (as specified with the index argument) of the output of FUN, empinf_merm computes influence values for every element in FUN(x).

Value

A numeric vector with length equals to number of clusters of x containing the weighted influence value of each cluster.

References

Van der Leeden, R., Meijer, E., & Busing, F. M. T. A. (2008). Resampling multilevel models. In J. de Leeuw & E. Meijer (Eds.), Handbook of multilevel Analysis (pp. 401–433). New York, NY: Springer.

Examples

library(lme4)
fm01ML <- lmer(Yield ~ (1 | Batch), Dyestuff, REML = FALSE)
# Define function for intraclass correlation
icc <- function(x) 1 / (1 + 1 / getME(x, "theta")^2)
empinf_mer(fm01ML, icc)
empinf_mer(fm01ML, fixef)

marklhc/bootmlm documentation built on May 24, 2023, 9:59 a.m.