This function allows you to estimate mean variable at universe level.

get_estimation_mean(
  data = ech::toy_ech_2018,
  variable = NULL,
  by.x = NULL,
  by.y = NULL,
  domain = NULL,
  level = NULL,
  ids = NULL,
  numero = "numero",
  estrato = NULL,
  pesoano = "pesoano",
  name = "estimacion"
)

Arguments

data

data frame with ECH microdata

variable

data frame column to estimate

by.x

data frame column

by.y

data frame column

domain

subpopulation reference setted as character expresion of logical evaluation

level

is household ("h") or individual ("i").

ids

ids

numero

household id

estrato

strata

pesoano

weights

name

name for the estimation new column

Value

table

Details

Disclaimer: This script is not an official INE product. Aviso: El script no es un producto oficial de INE.

Examples

# \donttest{
get_estimation_mean(data = ech::toy_ech_2018, variable = "pobre06", by.x = "dpto", level = "h")
#> These confidence intervals are only an approximation of the correct confidence intervals 
#>   that arise from fully defining the sample design
#> # A tibble: 26 x 5
#> # Groups:   dpto [19]
#>    dpto        pobre06  estimacion estimacion_low estimacion_upp
#>    <fct>       <fct>         <dbl>          <dbl>          <dbl>
#>  1 Montevideo  No pobre     0.940         0.903           0.976 
#>  2 Montevideo  Pobre        0.0604        0.0241          0.0968
#>  3 Artigas     No pobre     0.739         0.488           0.991 
#>  4 Artigas     Pobre        0.261         0.00873         0.512 
#>  5 Canelones   No pobre     1             1               1     
#>  6 Cerro Largo No pobre     1             1               1     
#>  7 Colonia     No pobre     1             1               1     
#>  8 Durazno     No pobre     0.728         0.412           1.04  
#>  9 Durazno     Pobre        0.272        -0.0429          0.588 
#> 10 Flores      No pobre     1             1               1     
#> # ... with 16 more rows
# }