This function allows you to estimate ratio variables at universe level.

get_estimation_ratio(
  data = ech::toy_ech_2018,
  variable.x = NULL,
  variable.y = 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.x

data frame column to estimate

variable.y

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

Variable name of cluster

numero

Variable name of household id

estrato

Variable name of strata

pesoano

Variable name of 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{
toy_ech_2018 <- employment(data = ech::toy_ech_2018, pobpcoac = "pobpcoac")
#> Variables have been created: 
#>  	 pea (Poblacion economicamente activa);
#>          pet (Poblacion en edad de trabajar);
#>          po (Poblacion ocupada) &
#>          pd (Poblacion desocupada)
get_estimation_ratio(data = toy_ech_2018, variable.x = "po", variable.y = "pea", level = "i")
#> These confidence intervals are only an approximation of the correct confidence intervals 
#>   that arise from fully defining the sample design
#> # A tibble: 1 x 3
#>   estimacion estimacion_low estimacion_upp
#>        <dbl>          <dbl>          <dbl>
#> 1      0.925          0.902          0.948
# }