Learn R Programming

SamplingStrata (version 1.5-4)

summaryStrata: Information on strata structure

Description

Information on strata (population, allocation, sampling rate and X variables ranges)

Usage

summaryStrata(x,outstrata,progress,writeFiles)

Value

A formatted output containing information on the strata in the given domain

Arguments

x

the sampling frame

outstrata

the optimized strata

progress

progress bar

writeFiles

csv output of the strata structure

Examples

Run this code
if (FALSE) {
library(SamplingStrata)
data("swissmunicipalities")
data("errors")
errors$CV1 <- 0.1
errors$CV2 <- 0.1
errors <- errors[rep(row.names(errors),7),]
errors$domainvalue <- c(1:7)
errors
swissmunicipalities$id <- c(1:nrow(swissmunicipalities))
swissmunicipalities$domain = 1
frame <- buildFrameDF(swissmunicipalities,
                      id = "id",
                      domainvalue = "REG",
                      X = c("Surfacesbois","Surfacescult"),
                      Y = c("Pop020", "Pop2040")
)
solution <- optimizeStrata2 (
  errors, 
  frame,
  nStrata = 5,
  iter = 10, 
  pops = 10, 
  writeFiles = FALSE, 
  showPlot = TRUE, 
  parallel = FALSE) 
strataStructure <- summaryStrata(solution$framenew, solution$aggr_strata)
strataStructure
}

Run the code above in your browser using DataLab