Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 21, 2024
1 parent 0416f7d commit 1cb741f
Show file tree
Hide file tree
Showing 4 changed files with 24 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: parameters
Title: Processing of Model Parameters
Version: 0.22.0.6
Version: 0.22.0.7
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* Support for `svy2lme` models from package *svylme*.

## Changes

* `standardize_parameters()` now also prettifies labels of factors.

## Bug fixes

* Fixed issue with `equivalence_test()` when ROPE range was not symmetrically
Expand Down
13 changes: 13 additions & 0 deletions tests/testthat/_snaps/standardize_parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Preserve labels

Code
print(out)
Output
# Standardization method: refit
Parameter | Std. Coef. | 95% CI
--------------------------------------------------
(Intercept) | -1.01 | [-1.18, -0.84]
Species [versicolor] | 1.12 | [ 0.88, 1.37]
Species [virginica] | 1.91 | [ 1.66, 2.16]

6 changes: 6 additions & 0 deletions tests/testthat/test-standardize_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ test_that("Robust post hoc", {
expect_error(standardize_parameters(model, method = "basic", robust = TRUE, two_sd = TRUE), NA)
})

# Labels ------------------------------------------------------------------
test_that("Preserve labels", {
fit <- lm(Sepal.Length ~ Species, data = iris)
out <- standardize_parameters(fit)
expect_snapshot(print(out))
})

# model_parameters -------------------------------
test_that("standardize_parameters (model_parameters)", {
Expand Down

0 comments on commit 1cb741f

Please sign in to comment.