From d8433867fb7783c407322964a5b108785d884394 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 5 Jul 2024 11:53:43 +0200 Subject: [PATCH] add tests --- tests/testthat/test-rmse.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-rmse.R b/tests/testthat/test-rmse.R index 8628760ad..e19bd49b3 100644 --- a/tests/testthat/test-rmse.R +++ b/tests/testthat/test-rmse.R @@ -28,6 +28,16 @@ test_that("rmse, ci", { # bootstrapped set.seed(123) out <- performance_rmse(model, ci = 0.95, ci_method = "boot") - expect_equal(out$CI_low, 1.9494, tolerance = 1e-4) - expect_equal(out$CI_high, 3.38406, tolerance = 1e-4) + expect_equal(out$CI_low, 1.9494, tolerance = 1e-3) + expect_equal(out$CI_high, 3.38406, tolerance = 1e-3) + + # bootstrapped, mixed models + skip_on_cran() + skip_if_not_installed("lme4") + data(sleepstudy, package = "lme4") + m <- lme4::lmer(Reaction ~ Days + (1 | Subject), data = sleepstudy) + set.seed(123) + out <- performance_rmse(m, ci = 0.95, iterations = 100) + expect_equal(out$CI_low, 26.26066, tolerance = 1e-3) + expect_equal(out$CI_high, 32.5642, tolerance = 1e-3) })