tests/testthat/test-boot_bw_estimate.R

# Tests for boot_bw_estimate function/s ----------------------------------------

test_that("boot_bw_estimate works as expected", {
  boot_df <- boot_bw(
    x = indicatorsHH, w = villageData, statistic = bootClassic,
    params = "anc1", replicates = 99
  )

  expect_s3_class(boot_bw_estimate(boot_df), "data.frame")

  boot_df <- boot_bw(
    x = indicatorsHH, w = villageData, statistic = bootClassic,
    params = "anc1", replicates = 99, strata = "region"
  )

  expect_s3_class(boot_bw_estimate(boot_df), "data.frame")

  expect_error(boot_bw_estimate(boot_df$boot_data))
})

Try the bbw package in your browser

Any scripts or data that you put into this service are public.

bbw documentation built on April 12, 2025, 9:14 a.m.