File: test-mira.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 (19 lines) | stat: -rw-r--r-- 490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
skip_if_not_installed("mice")
data("nhanes2", package = "mice")
imp <- mice::mice(nhanes2, printFlag = FALSE)
fit <- with(data = imp, exp = lm(bmi ~ age + hyp + chl))

mp1 <- model_parameters(fit)
mp2 <- summary(mice::pool(fit))

test_that("param", {
  expect_equal(mp1$Parameter, as.vector(mp2$term))
})

test_that("coef", {
  expect_equal(mp1$Coefficient, mp2$estimate, tolerance = 1e-3)
})

test_that("se", {
  expect_equal(mp1$SE, mp2$std.error, tolerance = 1e-3)
})