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 30 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: Purchasing power, low-income households
Healthcare: Physician density, hospital beds, GP density
Childcare: Coverage rates for under-3 and 3-6 age groups
Housing: Building permits, rent levels, living space
Transport: Cars per capita
Public Finances: Municipal debt, tax revenue
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 32 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 (bundled, no network call)
covs <- gerda_covariates()
# Inspect the data
head(covs)
summary(covs)
# Not run: downloads election data from GitHub.
## Not run:
# 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"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.