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

get_estimation_median(
  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_median(data = ech::toy_ech_2018, variable = "ht11", 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: 19 x 4
#>    dpto           estimacion estimacion_low estimacion_upp
#>    <fct>               <dbl>          <dbl>          <dbl>
#>  1 Montevideo         75072          67048           85239
#>  2 Artigas            54381          24590.          85147
#>  3 Canelones          63672          46912           74184
#>  4 Cerro Largo        39192          22025           59188
#>  5 Colonia            66693          38034          113299
#>  6 Durazno            32050          25024             NaN
#>  7 Flores            110105         110105          110105
#>  8 Florida            61801          38550           78552
#>  9 Lavalleja          42048          19046             NaN
#> 10 Maldonado          57426          41898.          89676
#> 11 Paysandú           42392.         31600           74625
#> 12 Río Negro          52390.           NaN             NaN
#> 13 Rivera             53270          40000          106010
#> 14 Rocha              44485          36170           75000
#> 15 Salto              50488          41780           73445
#> 16 San José           54517          44564.          63955
#> 17 Soriano            45505          34169           97684
#> 18 Tacuarembó         41807          27344           77014
#> 19 Treinta y Tres     48015            NaN             NaN
# }