if (FALSE) {
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)
}
Run the code above in your browser using DataLab