inst/tinytest/test_nonprob.R

source("_code_for_all_.R")

# check parameters --------------------------------------------------------

expect_error(
  nonprob(data = admin)
)

expect_error(
  nonprob(data = admin,
          selection = ~ region)
)

expect_error(
  nonprob(data = admin,
          selection = ~ region,
          target = ~ single_shift)
)

expect_error(
  nonprob(data = admin,
          outcome = single_shift ~ region,
          target = ~ single_shift)
)

expect_error(
  nonprob(data = admin,
          outcome = single_shift ~ region,
          target = ~ single_shift,
          pop_means = pop_means)
)

expect_error(
  nonprob(data = admin,
          outcome = single_shift ~ region,
          target = ~ single_shift,
          pop_size = N)
)

expect_error(
  nonprob(data = admin,
          outcome = single_shift ~ region,
          selection =  ~ region,
          method_outcome = "nn")
)

Try the nonprobsvy package in your browser

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

nonprobsvy documentation built on April 3, 2025, 7:08 p.m.