Skip to content

Commit 7236d61

Browse files
committed
use expect_equal in test-imprr_direct
1 parent 07cfb78 commit 7236d61

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

tests/testthat/test-imprr_direct.R

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
test_that("plug-in estimation works", {
2-
3-
data("identity")
4-
5-
example_direct <- imprr_direct(identity,
6-
J = 4,
7-
main_q = "app_identity",
8-
anc_correct = "anc_correct_identity",
9-
n_bootstrap = 10)
10-
11-
2+
## Otherwise identity data not correctly called
3+
## data("identity") does not work (not sure why?)
4+
identity <- rankingQ::identity
5+
example_direct <- imprr_direct(
6+
identity,
7+
J = 4,
8+
main_q = "app_identity",
9+
anc_correct = "anc_correct_identity",
10+
n_bootstrap = 10
11+
)
12+
expect_equal(
13+
example_direct$est_p_random,
14+
structure(
15+
list(
16+
mean = 0.315068713332798, lower = 0.289994374347022,
17+
upper = 0.344265852286426
18+
),
19+
row.names = c(NA, -1L), class = "data.frame"
20+
)
21+
)
1222
})
13-

0 commit comments

Comments
 (0)