tost_ml: Two One-Sided Tests for Fixed Effects in Multilevel Models

View source: R/tost_ml.R

tost_mlR Documentation

Two One-Sided Tests for Fixed Effects in Multilevel Models

Description

Two One-Sided Tests for Fixed Effects in Multilevel Models

Usage

tost_ml(model, fe, bound_l, bound_u)

Arguments

model

Multilevel model object fitted with lmerTest::lmer.

fe

Character vector. Name of the fixed effect variable.

bound_l

Lower bound based on SESOI (smallest effect size of interest).

bound_u

Upper bound based on SESOI (smallest effect size of interest).

Value

Vector of test statistics against lower and upper bound.

Examples

set.seed(234)
n1 <- 3 # groups
n2 <- 3 # observations per groups

dat <- data.frame(
  group = rep(c(LETTERS[1:n1]), each = n2),
  x1 = sample(1:5, n1 * n2, replace = TRUE),
  x2 = sample(1:5, n1 * n2, replace = TRUE),
  x3 = sample(1:5, n1 * n2, replace = TRUE)
)

tost_ml(
  model = lmerTest::lmer(x1 ~ x2 + x3 + (1 | group),
    data = dat, REML = FALSE
  ),
  fe = "x2", bound_l = -0.30, bound_u = 0.30
)

vjilmari/vjihelpers documentation built on May 23, 2022, 6:43 p.m.