This is a special case of impute_down for the EU NUTS hierarchical typologies. All valid actual rows will be projected down to all smaller constituent typologies where data is missing.

impute_down_nuts(
  dat,
  geo_var = "geo",
  values_var = "values",
  method_var = NULL,
  nuts_year = 2016
)

Arguments

dat

A data frame with exactly two or three columns: geo for the geo codes of the units, values for the values, and optionally method for describing the data source.

geo_var

The variable that contains the geographical codes in the NUTS typologies, defaults to code"geo_var".

values_var

The variable that contains the upstream data to be imputed to the downstream data, defaults to "values".

method_var

The variable that contains the metadata on various processing information, defaults to NULL in which case it will be returned as 'method'.

nuts_year

The year of the NUTS typology to use, it defaults to the currently valid 2016. Alternative values can be any of these: 1999, 2003, 2006, 2010, 2013 and the already announced and defined 2021. For example, use 2013 for NUTS2013 data.

Value

An augmented version of the dat imputed data frame with all possible projections to valid smaller units, i.e. NUTS0 = country values imputed to all missing NUTS1 units, NUTS1 values imputed to all missing NUTS2 units, NUTS2 values imputed to all missing NUTS3 units.

Details

The more general function requires typology information from the higher and lower level typologies. This is not needed when the EU vocabulary is used, and the hierarchy can be established from the EU vocabularies.

Be mindful that while all possible imputations are made, imputations beyond one hierarchical level will result in very crude estimates.

The imputed dataset dat must refer to a single time unit, i.e. panel data is not supported.

See also

Other impute functions: impute_down()

Examples

{ data(mixed_nuts_example) impute_down_nuts(mixed_nuts_example, nuts_year = 2016) }
#> # A tibble: 150 x 5 #> geo values method typology valid_2016 #> <chr> <dbl> <chr> <chr> <lgl> #> 1 DE22 94.5 "" nuts_level_2 TRUE #> 2 DE221 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 3 DE222 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 4 DE223 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 5 DE224 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 6 DE225 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 7 DE226 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 8 DE227 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 9 DE228 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> 10 DE229 94.5 "imputed from NUTS2 DE22" nuts_level_3 TRUE #> # ... with 140 more rows