Skip to content

Commit

Permalink
added boot_rep test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshyam-k committed Mar 29, 2024
1 parent a6bbbc0 commit 7f8e8f6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-boot_rep.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
data(samp)

res <- boot_rep(samp,
"COUNTYFIPS",
DRYBIO_AG_TPA_live_ADJ ~ tcc16 + (1 | COUNTYFIPS),
DRYBIO_AG_TPA_live_ADJ != 0 ~ tcc16 + (1 | COUNTYFIPS))

names_nz <- samp[samp$DRYBIO_AG_TPA_live_ADJ > 0, ]$COUNTYFIPS |> unique()
names_all <- samp$COUNTYFIPS |> unique()


test_that("return object includes proper values", {
expect_equal(names(res), c("beta_lm", "beta_glm", "u_lm", "u_glm"))
})


test_that("u_lm and u_glm are properly named vectors", {
expect_named(res$u_lm, names_nz)
expect_named(res$u_glm, names_all)
})

0 comments on commit 7f8e8f6

Please sign in to comment.