## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## -----------------------------------------------------------------------------
library(statwitness)
dat <- transform(mtcars, transmission = factor(am))
audit <- statwitness(mpg ~ transmission + wt + hp, data = dat, focus = "transmission")
audit

## ----eval = requireNamespace("lme4", quietly = TRUE)--------------------------
dat <- lme4::sleepstudy
dat$criterion <- factor(rep(c("A", "B"), length.out = nrow(dat)))
dat$model <- factor(rep(c("M1", "M2"), each = 2, length.out = nrow(dat)))
dat$rater <- dat$Subject

audit <- statwitness(
  Reaction ~ criterion * model + (1 | rater),
  data = dat,
  focus = "criterion:model",
  exclude = "optimizer_agreement",
  audit_level = "core"
)
audit

## ----eval = FALSE-------------------------------------------------------------
# statwitness_repeated(
#   data = dataset,
#   outcome = "score",
#   id = "rater",
#   within = c("criterion", "model"),
#   focus = "criterion:model",
#   audit_level = "standard"
# )

