adjustSize: Adjustment of the sample size in case it is externally given

adjustSizeR Documentation

Adjustment of the sample size in case it is externally given

Description

The optimisation step finds the best stratification that minimises the sample size under given precision constraints. In some cases, the goal is not the minimisation of the sample size, as this value is given externally. Nonetheless, it is still possible to perform the optimisation of the stratification, and then to proceed to an adjustment of the sample size by increasing or decreasing it proportionally in each resulting stratum.

Usage

adjustSize(size, strata, cens=NULL, minnumstr=2)

Arguments

size

The value of the sample size given externally

strata

The new (aggregated) strata generated by the function 'optimizeStrata'

cens

Flag indicating the presence of a take-all stratum

minnumstr

Indicates the minimum number of units that must be allocated in each stratum. Default is 2.

Value

The strata generated by the function 'optimizeStrata', where the variable 'SOLUZ' has been adjusted by taking into account the total required sample size

Author(s)

Giulio Barcaroli

Examples

## Not run: 
library(SamplingStrata)
data(swisserrors)
data(swissstrata)
solution <- optimizeStrata (
	errors = swisserrors,
	strata = swissstrata,
)
# 
sum(solution$aggr_strata$SOLUZ)
# Adjustment of total sample size (decreasing)
adjustedStrata <- adjustSize(size=300,strata=solution$aggr_strata)
sum(adjustedStrata$SOLUZ)
# Adjustment of total sample size (increasing)
adjustedStrata <- adjustSize(size=500,strata=solution$aggr_strata)
sum(adjustedStrata$SOLUZ)

## End(Not run)

barcaroli/SamplingStrata documentation built on Oct. 13, 2023, 8:56 a.m.