Skip to contents

Given a fixed total sampling budget, allocates days across strata using the Neyman optimal allocation formula (Cochran 1977 eq. 5.24), which assigns more days to strata with larger variability and more calendar days.

Usage

reallocate_strata(n_total, N_h, s2_h)

Arguments

n_total

Positive integer. Total sampling days available across all strata.

N_h

Named numeric vector. Total available days per stratum. Values must be >= 1.

s2_h

Numeric vector of the same length as N_h. Pilot variance of effort per day per stratum. Values must be >= 0.

Value

A named integer vector. Elements named after strata in N_h give the Neyman-optimal sampling days per stratum.

Details

Neyman allocation: n_h = ceiling(n_total * (N_h * sqrt(s2_h)) / sum(N_h * sqrt(s2_h))).

Because each stratum's allocation is ceiling-ed independently, the sum of returned values may slightly exceed n_total.

References

Cochran, W.G. 1977. Sampling Techniques, 3rd ed. Wiley, New York.

Examples

reallocate_strata(
  n_total = 36,
  N_h     = c(weekday = 65, weekend = 28),
  s2_h    = c(400, 500)
)
#> weekday weekend 
#>      25      12