File: test-model_parameters.coxme.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 (21 lines) | stat: -rw-r--r-- 649 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
skip_on_cran()
skip_if_not_installed("coxme")
skip_if_not_installed("survival")
skip_if_not_installed("withr")

# modelparameters ----------------------------------

## TODO: works only interactively

# test_that("model_parameters.coxme", {
#   data(eortc, package = "coxme")
#   d <- coxme::eortc
#   d$surv <- survival::Surv(d$y, d$uncens)
#   m1 <- coxme::coxme(surv ~ trt + (1 | center), data = d)
#   out <- model_parameters(m1)
#   expect_named(
#     out,
#     c("Parameter", "Coefficient", "SE", "CI", "CI_low", "CI_high", "z", "df_error", "p")
#   )
#   expect_equal(out$Coefficient, 0.7086127, tolerance = 1e-4)
# })