Prepares the design file for two-stage sample design on the basis of a dataset containing information on each PSU

input_to_beat.2st_2(psu,psu_id,stratum_var,mos_var,delta,minimum)

Arguments

psu

Dataframe containing information on each PSU.

psu_id

Identifier of each PSU in PSU dataframe.

stratum_var

Identifier of stratum in PSU dataframe.

mos_var

Variable containing the number of selection units in each PSU.

delta

Average number of final number of SSU per each selection unit.

minimum

Minimum number of selection units to be interviewed in each PSU.

Author

Giulio Barcaroli

Examples

if (FALSE) { # \dontrun{
library(readr)
psu <- read_rds("https://github.com/barcaroli/R2BEAT_workflows/blob/master/psu.rds?raw=true")
head(psu)
library(R2BEAT)
psu_id="municipality"        # Identifier of the PSU
stratum_var="stratum"        # Identifier of the stratum
mos_var="ind"                # Variable to be used as 'measure of size'
delta=1                      # Average number of SSUs for each selection unit
minimum <- 50                # Minimum number of SSUs to be selected in each PSU
inp2 <- input_to_beat.2st_2(psu,
                            psu_id,
                            stratum_var,
                            mos_var,
                            delta,
                            minimum)
head(inp2$psu_file)
head(inp2$des_file)
} # }