input_to_beat.2st_2 {R2BEAT} | R Documentation |
Prepares the design and psu file for two-stage sample design (when a previous round of the survey is available, but no sampling frame)
Description
Prepares the design file for two-stage sample design on the basis of a dataset containing information on each PSU
Usage
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(s)
Giulio Barcaroli
Examples
## Not run:
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)
## End(Not run)
[Package R2BEAT version 1.0.5 Index]