Learn R Programming

SamplingStrata (version 1.5-4)

Optimal Stratification of Sampling Frames for Multipurpose Sampling Surveys

Description

In the field of stratified sampling design, this package offers an approach for the determination of the best stratification of a sampling frame, the one that ensures the minimum sample cost under the condition to satisfy precision constraints in a multivariate and multidomain case. This approach is based on the use of the genetic algorithm: each solution (i.e. a particular partition in strata of the sampling frame) is considered as an individual in a population; the fitness of all individuals is evaluated applying the Bethel-Chromy algorithm to calculate the sampling size satisfying precision constraints on the target estimates. Functions in the package allows to: (a) analyse the obtained results of the optimisation step; (b) assign the new strata labels to the sampling frame; (c) select a sample from the new frame accordingly to the best allocation. Functions for the execution of the genetic algorithm are a modified version of the functions in the 'genalg' package. M.Ballin, G.Barcaroli (2020) "R package SamplingStrata: new developments and extension to Spatial Sampling".

Copy Link

Version

Install

install.packages('SamplingStrata')

Monthly Downloads

484

Version

1.5-4

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

November 15th, 2022

Functions in SamplingStrata (1.5-4)

assignStrataLabel

Function to assign the optimized strata labels
KmeansSolution2

Initial solution obtained by applying kmeans clustering of frame units
aggrStrataSpatial

Builds the "strata" dataframe containing information on target variables Y's distributions in the different strata, starting from a frame where units are spatially correlated.
aggrStrata2

Builds the "strata" dataframe containing information on target variables Y's distributions in the different strata, starting from a frame
bethel

Multivariate optimal allocation
buildFrameDF

Builds the "sampling frame" dataframe from a dataset containing information on all the units in the population of reference
KmeansSolutionSpatial

Initial solution obtained by applying kmeans clustering of frame units
buildFrameSpatial

Builds the "sampling frame" dataframe from a dataset containing information all the units in the population of reference including spatial
adjustSize

Adjustment of the sample size in case it is externally given
computeGamma

Function that allows to calculate a heteroscedasticity index, together with associate prediction variance, to be used by the optimization step to correctly evaluate the standard deviation in the strata due to prediction errors.
buildStrataDF

Builds the "strata" dataframe containing information on target variables Y's distributions in the different strata, starting from sample data or from a frame
errors

Precision constraints (maximum CVs) as input for Bethel allocation
buildStrataDFSpatial

Builds the "strata" dataframe containing information on target variables Y's distributions in the different strata, starting from sample data or from a frame
evalSolution

Evaluation of the solution produced by the function 'optimizeStrata' by selecting a number of samples from the frame with the optimal stratification, and calculating average CV's on the target variables Y's.
checkInput

Checks the inputs to the package: dataframes "errors", "strata" and "sampling frame"
expected_CV

Expected coefficients of variation of target variables Y
optimizeStrata

Best stratification of a sampling frame for multipurpose surveys
optimStrata

Optimization of the stratification of a sampling frame given a sample survey
nations

Dataset 'nations'
plotSamprate

Plotting sampling rates in the different strata for each domain in the solution.
plotStrata2d

Plot bivariate distibutions in strata
optimizeStrata2

Best stratification of a sampling frame for multipurpose surveys (only with continuous stratification variables)
selectSample

Selection of a stratified sample from the frame with srswor method
selectSampleSystematic

Selection of a stratified sample from the frame with systematic method
optimizeStrataSpatial

Best stratification of a sampling frame for multipurpose surveys considering also spatial correlation
strata

Dataframe containing information on strata in the frame
procBethel

Procedure to apply Bethel algorithm and select a sample from given strata
summaryStrata

Information on strata structure
prepareSuggestion

Prepare suggestions for optimization with method = "continuous" or "spatial"
selectSampleSpatial

Selection of geo-referenced points from the frame
updateStrata

Assigns new labels to atomic strata on the basis of the optimized aggregated strata
updateFrame

Updates the initial frame on the basis of the optimized stratification
swissframe

Dataframe containing information on all units in the population of reference that can be considered as the final sampling unit (this example is related to Swiss municipalities)
swissmunicipalities

The Swiss municipalities population
swisserrors

Precision constraints (maximum CVs) as input for Bethel allocation
swissstrata

Dataframe containing information on strata in the swiss municipalities frame
tuneParameters

Execution and compared evaluation of optimization runs
var.bin

Allows to transform a continuous variable into a categorical ordinal one by applying a modified version of the k-means clustering function in the 'stats' package.
KmeansSolution

Initial solution obtained by applying kmeans clustering of atomic strata