tests/testthat/variance_approximation.R

test_that("Hajek, Hajek Variance Approximation", {
	# p. 138, from Tille, Y (2006) Sampling Algorithms. Springer.
	N=6
	n=3
	pi_i_values = c(0.07, 0.17, 0.41, 0.61, 0.83, 0.91)

	
	
	expect_equal(
		Hajek(pi_i = pi_i_values, n = N),
		c(0.07812, 0.16932, 0.29028, 0.28548, 0.16932, 0.09828)
	)
})
ksauby/ACS documentation built on Aug. 18, 2022, 3:33 a.m.