input_to_beat.2st_1: Input dataframes for R2BEAT two-stages sample design

Description Usage Arguments Author(s) Examples

Description

Prepares the following input dataframes for R2BEAT two-stages sample design starting from ReGenesees design and/or calibrated objects: 1. strata 2. deff 3. effst 4. rho

Usage

1
2
3
4
5
6
7
8
     input_to_beat.2st_1(RGdes,
                        RGcal,
                        id_PSU,
                        id_SSU,
                        strata_vars,
                        target_vars,
                        deff_vars,
                        domain_vars)

Arguments

RGdes

ReGenesees design object.

RGcal

ReGenesees calibrated object.

id_PSU

variables used as identifiers in ReGenesees objects.

id_SSU

variables used as identifiers in ReGenesees objects.

strata_vars

stratification variables used in ReGenesees objects.

target_vars

target variables.

deff_vars

stratification variables to be used when calculating deff.

domain_vars

the variables used to identify the domain of interest.

Author(s)

Giulio Barcaroli

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
library(R2BEAT)

load("R2BEAT_ReGenesees.RData")   # ReGenesees design and calibration objects plus PSU data

RGdes <- des                           # ReGenesees design object
RGcal <- cal                           # ReGenesees calibrated object

strata_vars <- c("stratum")            # variables of stratification
target_vars <- c("income_hh",
                 "active",
                 "inactive",
                 "unemployed")         # target variables
deff_vars <- "stratum"    # stratification variables for calculating deff and effst 
                          # (n.b: must coincide or be a subset of variables of stratification)
id_PSU <- c("municipality")            # identification variable of PSUs
id_SSU <- c("id_hh")                   # identification variable of SSUs
domain_vars <- c("region")             # domain variables
inp1 <- input_to_beat.2st_1(RGdes,
                            RGcal,
                            id_PSU,
                            id_SSU,
                            strata_vars,
                            target_vars,
                            deff_vars,
                            domain_vars)							
inp1$strata
inp1$deff
inp1$effst
inp1$rho

## End(Not run)

barcaroli/R2BEATold documentation built on Jan. 2, 2021, 7:09 p.m.