File: test-model_parameters.logistf.R

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
skip_on_cran()

skip_if_not_installed("logistf")
skip_if_not_installed("withr")

withr::with_options(
  list(parameters_exponentiate = FALSE),
  {
    data(sex2, package = "logistf")
    m1 <- logistf::logistf(case ~ age + oc + vic + vicl + vis + dia, data = sex2)
    m2 <- logistf::flic(m1)
    m3 <- logistf::flac(m1, data = sex2)

    test_that("model_parameters.logistf", {
      params <- model_parameters(m1)
      expect_snapshot(params, variant = "windows")
    })
    test_that("model_parameters.flic", {
      params <- model_parameters(m2)
      expect_snapshot(params, variant = "windows")
    })
    test_that("model_parameters.flac", {
      params <- model_parameters(m3)
      expect_snapshot(params, variant = "windows")
    })
  }
)