Skip to content

Commit

Permalink
Merge branch 'main' into marginaleffects_0_20_1
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke authored May 13, 2024
2 parents 2aabd48 + b58da6d commit 5db9ca4
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions tests/testthat/test-model_parameters.coxme.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ skip_if_not_installed("withr")

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

withr::with_environment(
new.env(),
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)
})
)
## 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)
# })

0 comments on commit 5db9ca4

Please sign in to comment.