Skip to content

Commit

Permalink
rename marginaleffects' s.value column name (#854)
Browse files Browse the repository at this point in the history
Fixes #853
  • Loading branch information
strengejacke authored Mar 11, 2024
1 parent b51927e commit 0549cf7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions R/standardize_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions tests/testthat/test-marginaleffects.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})

0 comments on commit 0549cf7

Please sign in to comment.