| Title: | Exact Optimal Allocation Algorithms for Stratified Sampling |
|---|---|
| Description: | Implements several exact methods for allocating optimal sample sizes when designing stratified samples. These methods are discussed in Wright (2012) <doi:10.1080/00031305.2012.733679> and Wright (2017) <doi:10.1016/j.spl.2017.04.026>. |
| Authors: | Andrew M. Raim [aut, cre] |
| Maintainer: | Andrew M. Raim <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-25 08:40:41 UTC |
| Source: | https://github.com/andrewraim/allocation |
Extract the allocation from the result of one of the Allocation-Methods.
allocation(object)allocation(object)
object |
Result from an allocation method |
A numeric vector whose elements contain an allocation for the corresponding stratum.
Additional arguments (controls) for Allocation-Methods.
allocation_control(verbose = FALSE, bits = 256, tol = 1e-10, digits = 4)allocation_control(verbose = FALSE, bits = 256, tol = 1e-10, digits = 4)
verbose |
Logical; if |
bits |
Number of bits of precision to use with |
tol |
A small positive number for use in allocate_prec; if all strata
have |
digits |
Number of decimals to display in output. |
An list of class allocation_control.
out1 = allocation_control() out2 = allocation_control(verbose = TRUE, bits = 128, tol = 1e-8, digits = 2)out1 = allocation_control() out2 = allocation_control(verbose = TRUE, bits = 128, tol = 1e-8, digits = 2)
Algorithms III and IV from Wright (2017), and classical unconstrained Neyman allocation (Neyman, 1934).
allocate_fixn(n0, N, S, lo = NULL, hi = NULL, control = allocation_control()) allocate_neyman(n0, N, S, control = allocation_control()) allocate_prec(v0, N, S, lo = NULL, hi = NULL, control = allocation_control())allocate_fixn(n0, N, S, lo = NULL, hi = NULL, control = allocation_control()) allocate_neyman(n0, N, S, control = allocation_control()) allocate_prec(v0, N, S, lo = NULL, hi = NULL, control = allocation_control())
n0 |
Target sample size for Algorithm III; integer. |
N |
Population size for each stratum; integer vector of length |
S |
Standard deviation for each stratum; numeric vector of length |
lo |
Sample size lower bounds for each stratum; numeric vector of
length |
hi |
Sample size upper bounds for each stratum; numeric vector of
length |
control |
Control object from allocation_control. |
v0 |
Target variance for Algorithm IV; numeric. |
The function allocate_fixn implements Algorithm III of Wright (2017) and
finds the optimal allocation for a given total sample size n0. The function
allocate_prec implements Algorithm IV of Wright (2017) and optimally
allocates units until the overall variance is smaller than a given v0.
Classical Neyman allocation is implemented by the function
allocate_neyman.
A list whose structure depends on the allocation method.
allocate_neyman
n: Integer vector with allocation .
v: Value of variance achieved at selected allocation.
N: The argument N passed to the function.
S: The argument S passed to the function.
allocate_fixn
n: Integer vector with allocation .
iter: Number of steps taken in the algorithm.
v: Value of variance achieved at selected allocation.
N: The argument N passed to the function.
S: The argument S passed to the function.
lo: The argument lo passed to the function.
hi: The argument hi passed to the function.
allocate_prec
n: Integer vector with allocation .
iter: Number of steps taken in the algorithm.
v: Value of variance achieved at selected allocation.
v0: The argument v0 passed to the function.
N: The argument N passed to the function.
S: The argument S passed to the function.
lo: The argument lo passed to the function.
hi: The argument hi passed to the function.
Neyman, Jerzy (1934). On the Two Different Aspects of the Representative Method: The Method of Stratified Sampling and the Method of Purposive Selection. Journal of the Royal Statistical Society, 97 (4): 558-625.
Tommy Wright (2012). The Equivalence of Neyman Optimum Allocation for Sampling and Equal Proportions for Apportioning the U.S. House of Representatives. The American Statistician, 66, pp.217-224.
Tommy Wright (2017), Exact optimal sample allocation: More efficient than Neyman, Statistics & Probability Letters, 129, pp.50-57.