diff --git a/DESCRIPTION b/DESCRIPTION index 88671c4bdb..1e2c573cd3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: insight Title: Easy Access to Model Information for Various Model Objects -Version: 0.19.8.7 +Version: 0.19.8.8 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NEWS.md b/NEWS.md index cc619b3549..5e36802b31 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,11 @@ * Support for models of class `serp` (package *serp*). +## General + +* `standardize_names()` now also recognizes column `s.value` from objects of + package *marginaleffects*. + ## Bug fixes * Fixed issue in `find_predictors()` for models with splines (`s()`), where diff --git a/R/standardize_names.R b/R/standardize_names.R index 91adb49b02..c13dbb724d 100644 --- a/R/standardize_names.R +++ b/R/standardize_names.R @@ -116,6 +116,7 @@ standardize_names.parameters_distribution <- standardize_names.parameters_model cn[cn == "std.error"] <- "SE" cn[cn == "std.dev"] <- "SD" cn[cn == "p.value"] <- "p" + cn[cn == "s.value"] <- "S" cn[cn == "bayes.factor"] <- "BF" cn[cn == "component"] <- "Component" cn[cn == "effect"] <- "Effects" diff --git a/tests/testthat/test-marginaleffects.R b/tests/testthat/test-marginaleffects.R index 6cf748bd7a..b8803345ca 100644 --- a/tests/testthat/test-marginaleffects.R +++ b/tests/testthat/test-marginaleffects.R @@ -26,4 +26,15 @@ test_that("marginaleffects", { # Find statistic expect_identical(insight::find_statistic(x), "z-statistic") + + # standardize names - "s.value" becomes "S" + skip_if_not_installed("parameters") + expect_named( + parameters::model_parameters(x), + c( + "rowid", "Parameter", "Coefficient", "SE", "Statistic", "p", + "S", "CI", "CI_low", "CI_high", "predicted_lo", "predicted_hi", + "Predicted", "Species", "Petal.Length", "Sepal.Width" + ) + ) })