File: test-model_parameters_mixed_coeforder.R

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 534 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
test_that("model_parameters.mixed.coeforder", {
  skip_if_not_installed("lme4")
  set.seed(1)
  dat <- data.frame(
    TST.diff = runif(100, 0, 100),
    Exposition = as.factor(sample(0:2, 100, TRUE)),
    Gruppe = as.factor(sample(0:1, 100, TRUE)),
    Kennung = as.factor(sample(1:5, 100, TRUE))
  )

  m <- lme4::lmer(TST.diff ~ Exposition + Gruppe + Gruppe:Exposition + (1 | Kennung), data = dat)
  cs <- coef(summary(m))
  mp <- model_parameters(m, effects = "fixed")
  expect_equal(mp$Parameter, rownames(cs))
})