Learn R Programming

stratifyR (version 2.0-1)

Optimal Stratification of Univariate Populations

Description

Determines Optimum Strata Boundaries (OSB) and Optimum Sample Sizes (OSS) for univariate stratified sampling designs under Neyman allocation. The stratification variable is described by a best-fitting parametric distribution, selected automatically by AIC from a set of continuous families (normal, log-normal, gamma, Weibull, exponential, Cauchy, uniform, Pareto, triangular and right-triangular), and the optimum boundaries are obtained by minimising the Neyman objective. Version 2.0 keeps the original globally optimal Dynamic Programming (DP) solver of Reddy and Khan (2020) as the default and adds two faster derivative-free alternatives for interactive and large-scale use: a multi-start 'COBYLA' solver and a two-phase 'global' solver that couples 'DIRECT-L' with 'COBYLA' refinement. It also provides cost-constrained allocation with unequal per-stratum costs, a design-efficiency comparison (compare_designs), two- and three-dimensional and interactive visualisations, solution-quality diagnostics (a Cauchy-Schwarz optimality gap and KKT first-order residuals for the derivative-free solvers) and a self-contained 'shiny' application, while remaining backward compatible with the strata.data() and strata.distr() interface of version 1.x. The methodology follows Khan et al. (2008) , Reddy and Khan (2018) and Reddy and Khan (2020) .

Copy Link

Version

Install

install.packages('stratifyR')

Monthly Downloads

302

Version

2.0-1

License

GPL (>= 3)

Maintainer

Karuna G. Reddy

Last Published

September 10th, 2026

Functions in stratifyR (2.0-1)

distr.root

Calculate the objective function value for a given (d, y) under a hypothesized distribution (scaled-data formulation)
erf

To calculate the error for a normal variable
create.mat

To create and store calculated values of the objective function
data.optim

To implement the Dynamic Programming (DP) solution procedure on the stratification problem presented in the form of a Mathematical Programming Problem (MPP)
data.root

Calculate the objective function value for a given (d, y)
strata.data

Stratification of Univariate Survey Population Using the Data
strata.distr

Stratification of Univariate Survey Population Using the Distribution
distr.alloc

To calculate the stratum sample sizes (nh) for a fixed sample size (n) based on the hypothetical distribution of the data
distr.optim

To implement the Dynamic Programming (DP) solution procedure on the stratification problem presented in the form of a Mathematical Programming Problem (MPP)
get.dist

Determine best-fit distribution Identify the best-fit distribution for a univariate numeric vector
data.alloc

Allocate data To calculate the stratum sample sizes (nh) for a fixed sample size (n) directly based on the data
anaemia

Micronutrient data on Anaemia in Fiji
print.strata

Print Method for Stratified Survey Design Objects
realloc

To re-allocate the stratum sample sizes (nh)
mode.val

To calculate the modal value of the data
compare_designs

Compare Survey Design Efficiencies
minim.val

To identify the minimum value out of two given sets of values
stratifyRApp

Launch the stratifyR 2.0 Interactive Shiny Application
plot.strata

Plot Method for Stratified Survey Design Objects
summary.strata

Format and Present Results
hies

Household Income Expenditure Survey (HIES) in Fiji
math

Mathematics Marks for First-year University Students
sugarcane

Sugarcane Farming Data in Fiji