tests/testthat/test-get_marginaleffects.R

if (require("marginaleffects") && require("lme4")) {
  test_that("get_marginaleffects", {
    model <- lm(Sepal.Width ~ Species * Petal.Length, data = iris)

    expect_equal(nrow(get_marginaleffects(model, trend = "Petal.Length", at = "Species")), 3L)

    # get_marginaleffects(model, trend = "Petal.Length", at = "Species", length = 10)
  })
}

Try the modelbased package in your browser

Any scripts or data that you put into this service are public.

modelbased documentation built on Jan. 13, 2023, 9:12 a.m.