input_to_beat.2st_2.Rd
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)
Dataframe containing information on each PSU.
Identifier of each PSU in PSU dataframe.
Identifier of stratum in PSU dataframe.
Variable containing the number of selection units in each PSU.
Average number of final number of SSU per each selection unit.
Minimum number of selection units to be interviewed in each PSU.
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)
} # }