inst/tinytest/test-estimate.R

models <- list(
  lm(hp ~ mpg + drat, mtcars),
  lm(hp ~ mpg + drat, mtcars))

# multiple estimates",{
tab1 <- modelsummary(models,
  output = "data.frame",
  gof_omit = ".*",
  stars = TRUE,
  statistic = NULL,
  estimate = c(
    "{estimate} ({std.error}){stars}",
    "{estimate} [{conf.low}, {conf.high}]"))
tab2 <- modelsummary(models,
  output = "data.frame",
  gof_omit = ".*",
  stars = FALSE,
  statistic = NULL,
  estimate = c(
    "{estimate} ({std.error}){stars}",
    "{estimate} [{conf.low}, {conf.high}]"))
expect_true(all(tab1 == tab2))

# error",{
expect_error(
  modelsummary(models,
    output = "data.frame",
    gof_omit = ".*",
    stars = TRUE,
    statistic = NULL,
    estimate = c(
      "estimate",
      "{estimate} ({std.error}){stars}",
      "{estimate} [{conf.low}, {conf.high}]")))

Try the modelsummary package in your browser

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

modelsummary documentation built on Oct. 15, 2023, 5:06 p.m.