Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 5, 2025
1 parent 28f299c commit d6e05ea
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
3 changes: 2 additions & 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.24.0.5
Version: 0.24.0.6
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -152,6 +152,7 @@ Suggests:
lmerTest,
lmtest,
logistf,
logitr,
logspline,
lqmm,
M3C,
Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/_snaps/windows/model_parameters.logitr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# model_parameters.logitr

Code
params
Output
Parameter | Log-Odds | SE | 95% CI | z | p
---------------------------------------------------------------------
scalePar | 0.37 | 0.02 | [ 0.32, 0.41] | 15.04 | < .001
feat | 1.34 | 0.36 | [ 0.64, 2.04] | 3.77 | < .001
brand [hiland] | -10.14 | 0.58 | [-11.26, -9.01] | -17.59 | < .001
brand [weight] | -1.75 | 0.18 | [ -2.10, -1.40] | -9.72 | < .001
brand [yoplait] | 2.00 | 0.14 | [ 1.72, 2.28] | 14.07 | < .001
Message
Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
using a Wald z-distribution approximation.

13 changes: 13 additions & 0 deletions tests/testthat/_snaps/windows/model_parameters.logitr.new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# model_parameters.logitr

Code
params
Output
Parameter | Log-Odds | SE | 95% CI | z | p
---------------------------------------------------------------------
scalePar | 0.37 | 0.02 | [ 0.32, 0.41] | 15.04 | < .001
feat | 1.34 | 0.36 | [ 0.64, 2.04] | 3.77 | < .001
brand [hiland] | -10.14 | 0.58 | [-11.26, -9.01] | -17.59 | < .001
brand [weight] | -1.75 | 0.18 | [ -2.10, -1.40] | -9.72 | < .001
brand [yoplait] | 2.00 | 0.14 | [ 1.72, 2.28] | 14.07 | < .001

16 changes: 16 additions & 0 deletions tests/testthat/test-model_parameters.logitr.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
skip_on_cran()
skip_if_not_installed("logitr")

test_that("model_parameters.logitr", {
data(yogurt, package = "logitr")
m <- logitr::logitr(
data = yogurt,
outcome = "choice",
obsID = "obsID",
pars = c("feat", "brand"),
scalePar = "price",
numMultiStarts = 5
)
params <- model_parameters(m, verbose = FALSE)
expect_snapshot(params, variant = "windows")
})

0 comments on commit d6e05ea

Please sign in to comment.