Learn R Programming

performance (version 0.1.0)

check_convergence: Convergence test for mixed effects models

Description

check_convergence() provides an alternative convergence test for merMod-objects.

Usage

check_convergence(x, tolerance = 0.001)

Arguments

x

A merMod-object.

tolerance

Indicates up to which value the convergence result is accepted. The smaller tolerance is, the stricter the test will be.

Value

TRUE if convergence is fine and FALSE if convergence is suspicious. Additionally, the convergence value is returned as attribute.

Details

check_convergence() provides an alternative convergence test for merMod-objects, as discussed here and suggested by Ben Bolker in this comment. Further details can be found in convergence.

Examples

Run this code
# NOT RUN {
library(lme4)
data(cbpp)
set.seed(1)
cbpp$x <- rnorm(nrow(cbpp))
cbpp$x2 <- runif(nrow(cbpp))

model <- glmer(
  cbind(incidence, size - incidence) ~ period + x + x2 + (1 + x | herd),
  data = cbpp,
  family = binomial()
)

check_convergence(model)

# }

Run the code above in your browser using DataLab