Skip to content

optimall

Allocate Samples Among Strata

v1.4.0 · Apr 3, 2026 · GPL-3

Description

Functions for the design process of survey sampling, with specific tools for multi-wave and multi-phase designs. Perform optimum allocation using Neyman (1934) <doi:10.2307/2342192> or Wright (2012) <doi:10.1080/00031305.2012.733679> allocation, split strata based on quantiles or values of known variables, randomly select samples from strata, allocate sampling waves iteratively, and organize a complex survey design. Also includes a Shiny application for observing the effects of different strata splits. A paper on this package was published in the Journal of Statistical Software <doi:10.18637/jss.v114.i10>.

Downloads

532

Last 30 days

7542nd

1.5K

Last 90 days

6.2K

Last year

Trend: +38.5% (30d vs prior 30d)

CRAN Check Status

1 ERROR
13 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 ERROR
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (1 non-OK)
ERROR r-patched-linux-x86_64

tests

Running ‘testthat.R’ [57s/75s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(optimall)
  > 
  > test_check("optimall")
  Saving _problems/test-allocate_wave-29.R
  [ FAIL 1 | WARN 0 | SKIP 1 | PASS 262 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • On Linux (1): 'test-optimall_shiny.R:15:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-allocate_wave.R:22:3'): the output of allocate_wave is as expected ──
  Expected `output$nsample_actual` to equal `...$stratum_size`.
  Differences:
  2/3 mismatches (average diff: 1)
  [1] 10 - 11 == -1
  [3]  7 -  6 ==  1
  
  [ FAIL 1 | WARN 0 | SKIP 1 | PASS 262 ]
  Error:
  ! Test failures.
  Execution halted

Check History

ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 2, 2026
ERROR r-patched-linux-x86_64

tests

Running ‘testthat.R’ [57s/75s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(optimall)
  > 
  > test_check("optimall")
  Saving _problems/test-allocate_wave-29.R
  [ FAIL 1 | WARN 0 | SKIP 1 | PASS
...[truncated]...
d ──
  Expected `output$nsample_actual` to equal `...$stratum_size`.
  Differences:
  2/3 mismatches (average diff: 1)
  [1] 10 - 11 == -1
  [3]  7 -  6 ==  1
  
  [ FAIL 1 | WARN 0 | SKIP 1 | PASS 262 ]
  Error:
  ! Test failures.
  Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies dplyr glue magrittr rlang tibble optimall

Version History

updated 1.4.0 ← 1.3.1 diff Apr 3, 2026
new 1.3.1 Mar 10, 2026
updated 1.3.1 ← 1.3.0 diff Jan 27, 2026
updated 1.3.0 ← 1.2.0 diff Sep 7, 2025
updated 1.2.0 ← 1.1.1 diff Jul 16, 2025
updated 1.1.1 ← 1.1.0 diff Jun 2, 2024
updated 1.1.0 ← 0.1.5 diff Apr 12, 2024
updated 0.1.5 ← 0.1.4 diff Feb 14, 2024
updated 0.1.4 ← 0.1.3 diff Jan 11, 2024
updated 0.1.3 ← 0.1.2 diff Sep 5, 2023
updated 0.1.2 ← 0.1.1 diff Nov 8, 2022
updated 0.1.1 ← 0.1.0 diff Feb 8, 2022
new 0.1.0 Jul 20, 2021