View source: R/gerda_covariates.R
| gerda_covariates | R Documentation |
Returns county-level socioeconomic and demographic covariates from INKAR. This function provides flexible access to the raw covariate data for advanced users who want to inspect or manipulate it before merging with county-level election data.
For most users, we recommend using add_gerda_covariates instead,
which automatically performs the merge with correct join keys.
Note: These covariates are at the county (Kreis) level and should be
merged with county-level GERDA data (e.g., federal_cty_harm).
gerda_covariates()
The dataset includes 20 socioeconomic and demographic variables:
Demographics: Age structure, foreign population, gender
Economy: GDP, sectoral composition, enterprise structure
Labor Market: Unemployment rates (overall, youth, long-term)
Education: School completion rates, students, apprentices
Income: Median income, purchasing power, low-income households
County codes are formatted as 5-digit AGS codes matching GERDA's harmonized county codes (2021 boundaries).
A data frame with 11,200 rows and 22 columns containing county-level
covariates for 400 German counties from 1995 to 2022. See
gerda_covariates_codebook for variable descriptions.
add_gerda_covariates for automatic merging (recommended)
gerda_covariates_codebook for variable descriptions
# Get the covariates data
covs <- gerda_covariates()
# Inspect the data
head(covs)
summary(covs)
# Manual merge (advanced)
library(dplyr)
elections <- load_gerda_web("federal_cty_harm")
merged <- elections %>%
left_join(covs, by = c("county_code" = "county_code", "election_year" = "year"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.