Skip to content

Commit

Permalink
marginaleffects 0.20.1: minor change in labels (#968)
Browse files Browse the repository at this point in the history
* marginaleffects 0.20.1: minor change in labels

* trigger CI

* update test

* bump required version

---------

Co-authored-by: Daniel <[email protected]>
  • Loading branch information
vincentarelbundock and strengejacke authored May 13, 2024
1 parent b58da6d commit 2e3b010
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.21.6.6
Version: 0.21.6.7
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -151,7 +151,7 @@ Suggests:
logspline,
lqmm,
M3C,
marginaleffects (>= 0.16.0),
marginaleffects (>= 0.20.1),
MASS,
Matrix,
mclogit,
Expand Down Expand Up @@ -218,4 +218,3 @@ Config/Needs/website:
r-lib/pkgdown,
easystats/easystatstemplate
Config/rcmdcheck/ignore-inconsequential-notes: true
Remotes: easystats/insight
3 changes: 3 additions & 0 deletions R/methods_marginaleffects.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ model_parameters.marginaleffects <- function(model,

attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model))

# do not print or report these columns
out <- out[, !colnames(out) %in% c("predicted_lo", "predicted_hi"), drop = FALSE]

if (inherits(model, "marginalmeans")) {
attr(out, "coefficient_name") <- "Marginal Means"
} else if (inherits(model, "comparisons")) {
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-marginaleffects.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ test_that("marginaleffects()", {
model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
out <- parameters(model)
expect_identical(nrow(out), 1L)
expect_named(out, c(
"Parameter", "Coefficient", "SE", "Statistic",
"p", "S", "CI", "CI_low", "CI_high"
))
cols <- c("Parameter", "Comparison", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high")
expect_true(all(cols %in% colnames(out)))
out <- model_parameters(model, exponentiate = TRUE)
expect_equal(out$Coefficient, 1.394, tolerance = 1e-3)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-model_parameters.coxme.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
skip_on_cran()
skip_if_not_installed("coxme")
skip_if_not_installed("survival")
skip_if_not_installed("withr")

# modelparameters ----------------------------------

Expand Down

0 comments on commit 2e3b010

Please sign in to comment.