From 3f4ab157b20c7b7e2e13eca3fa34d50902d18041 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 5 Mar 2024 02:27:44 +0100 Subject: [PATCH 01/62] minor fix in bearing estimation --- apps/wizard/pages/owidle.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wizard/pages/owidle.py b/apps/wizard/pages/owidle.py index 81b497b0ec4..05dffef5c7d 100644 --- a/apps/wizard/pages/owidle.py +++ b/apps/wizard/pages/owidle.py @@ -28,7 +28,10 @@ "2024-03-04": [ "🐛 Fixed bug in distance estimation.", "✨ Bearing angle is now estimated using flat-earth approximation.", - ] + ], + "2024-03-05": [ + "🐛 Fixed bug in bearing estimation.", + ], } DAYS_TO_SHOW_UPDATES = 3 @@ -436,7 +439,7 @@ def distance_to_solution(country_selected: str) -> Tuple[str, str, str]: # GEO_DIST = cast(gpd.GeoDataFrame, GEO.to_crs(3310)) # GEO = cast(gpd.GeoDataFrame, GEO.to_crs(3310)) df_geo = GEO.copy() - df_geo = cast(gpd.GeoDataFrame, df_geo.to_crs(epsg=3395)) + # df_geo = cast(gpd.GeoDataFrame, df_geo.to_crs(epsg=3395)) solution = df_geo.loc[df_geo["location"] == SOLUTION, "geometry"] guess = df_geo.loc[df_geo["location"] == country_selected, "geometry"] From 72726d1221933d67197de58f5e5b611c4f82ae7a Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 18 Mar 2024 14:12:50 +0100 Subject: [PATCH 02/62] snapshot of VDEM 14 --- snapshots/democracy/2024-03-18/vdem.py | 33 +++++++++++++++++ snapshots/democracy/2024-03-18/vdem.zip.dvc | 40 +++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 snapshots/democracy/2024-03-18/vdem.py create mode 100644 snapshots/democracy/2024-03-18/vdem.zip.dvc diff --git a/snapshots/democracy/2024-03-18/vdem.py b/snapshots/democracy/2024-03-18/vdem.py new file mode 100644 index 00000000000..77b2feba668 --- /dev/null +++ b/snapshots/democracy/2024-03-18/vdem.py @@ -0,0 +1,33 @@ +"""Script to create a snapshot of dataset. + +To access the VDEM file: + +- Go to VDEM datasets: https://www.v-dem.net/data/the-v-dem-dataset/ +- Go to "Country-Year: V-Dem Full+Others" page: https://www.v-dem.net/data/the-v-dem-dataset/country-year-v-dem-fullothers-v14/ +- Fill the form and download the ZIP file. + +""" + +from pathlib import Path + +import click + +from etl.snapshot import Snapshot + +# Version for current snapshot dataset. +SNAPSHOT_VERSION = Path(__file__).parent.name + + +@click.command() +@click.option("--upload/--skip-upload", default=True, type=bool, help="Upload dataset to Snapshot") +@click.option("--path-to-file", prompt=True, type=str, help="Path to local data file.") +def main(path_to_file: str, upload: bool) -> None: + # Create a new snapshot. + snap = Snapshot(f"democracy/{SNAPSHOT_VERSION}/vdem.zip") + + # Copy local data file to snapshots data folder, add file to DVC and upload to S3. + snap.create_snapshot(filename=path_to_file, upload=upload) + + +if __name__ == "__main__": + main() diff --git a/snapshots/democracy/2024-03-18/vdem.zip.dvc b/snapshots/democracy/2024-03-18/vdem.zip.dvc new file mode 100644 index 00000000000..c86adf9c30a --- /dev/null +++ b/snapshots/democracy/2024-03-18/vdem.zip.dvc @@ -0,0 +1,40 @@ +# Learn more at: +# http://docs.owid.io/projects/etl/architecture/metadata/reference/ +meta: + origin: + # Data product / Snapshot + title: V-Dem Country-Year (Full + Others) + description: |- + The Varieties of Democracy (V-Dem) project publishes data and research on democracy and human rights. + + It acknowledges that democracy can be characterized differently and measures electoral, liberal, participatory, deliberative, and egalitarian characterizations of democracy. + + The project relies on evaluations by around 3,500 country experts and supplementary work by its researchers to assess political institutions and the protection of rights. + + The project is managed by the V-Dem Institute, based at the University of Gothenburg in Sweden. + + This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. + date_published: "2024-03-07" + version_producer: v14 + + # Citation + producer: V-Dem + citation_full: |- + Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan I. Lindberg, Jan Teorell, David Altman, Fabio Angiolillo, Michael Bernhard, Cecilia Borella, Agnes Cornell, M. Steven Fish, Linnea Fox, Lisa Gastaldi, Haakon Gjerløw, Adam Glynn, Ana Good God, Sandra Grahn, Allen Hicken, Katrin Kinzelbach, Joshua Krusell, Kyle L. Marquardt, Kelly McMann, Valeriya Mechkova, Juraj Medzihorsky, Natalia Natsika, Anja Neundorf, Pamela Paxton, Daniel Pemstein, Josefine Pernes, Oskar Rydén, Johannes von Römer, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Aksel Sundström, Eitan Tzelgov, Yi-ting Wang, Tore Wig, Steven Wilson and Daniel Ziblatt. 2024. "V-Dem Country-Year Dataset v14" Varieties of Democracy (V-Dem) Project. https://doi.org/10.23696/mcwt-fr58. + + + Pemstein, Daniel, Kyle L. Marquardt, Eitan Tzelgov, Yi-ting Wang, Juraj Medzihorsky, Joshua Krusell, Farhad Miri, and Johannes von Römer. 2024. “The V-Dem Measurement Model: Latent Variable Analysis for Cross-National and Cross-Temporal Expert-Coded Data”. V-Dem Working Paper No. 21. 9th edition. University of Gothenburg: Varieties of Democracy Institute. + + # Files + url_main: http://v-dem.net/vdemds.html + date_accessed: 2024-03-18 + + # License + license: + name: CC BY 4.0 + url: https://creativecommons.org/licenses/by/4.0/ + +outs: + - md5: 2425cdfc5c91eff98696d59cfb8d1a70 + size: 25342168 + path: vdem.zip From 361cbf39b94a404db27d24e8a31f8f7b57cf9ae9 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 18 Mar 2024 20:07:37 +0100 Subject: [PATCH 03/62] read file in zip folder --- etl/snapshot.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/etl/snapshot.py b/etl/snapshot.py index 94705b3f3b2..08a26d55ac3 100644 --- a/etl/snapshot.py +++ b/etl/snapshot.py @@ -255,6 +255,23 @@ def extract_to_tempdir(self) -> Any: # Return temporary directory return temp_dir + def read_in_zip(self, filename: str, *args, **kwargs) -> Table: + """Read data from file inside a zip archive. + + If the relevant data file is within a zip archive, this method will read this file and return it as a table. + + To do so, this method first unzips the archive to a temporary directory, and then reads the file. Note that the file should have a supported extension (see `read` method). + """ + with self.extract_to_tempdir() as tmpdir: + # Temporarily change the file extension so that .read works + extension_original = self.metadata.file_extension + self.metadata.file_extension = filename.split(".")[-1] + # Read + tb = self.read(Path(tmpdir) / filename, *args, **kwargs) + # Restore original file extension + self.metadata.file_extension = extension_original + return tb + @pruned_json @dataclass_json From 46938712d89e88e399f8e40c63f031dbb32e3aa9 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 18 Mar 2024 23:27:59 +0100 Subject: [PATCH 04/62] read file in zip/tar folder --- etl/snapshot.py | 92 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 21 deletions(-) diff --git a/etl/snapshot.py b/etl/snapshot.py index 94705b3f3b2..63d7c1726eb 100644 --- a/etl/snapshot.py +++ b/etl/snapshot.py @@ -176,27 +176,19 @@ def create_snapshot( self.download_from_source() self.dvc_add(upload=upload) - def to_table_metadata(self): + def to_table_metadata(self) -> TableMeta: return self.metadata.to_table_metadata() def read(self, *args, **kwargs) -> Table: """Read file based on its Snapshot extension.""" - if self.metadata.file_extension == "csv": - return self.read_csv(*args, **kwargs) - elif self.metadata.file_extension == "feather": - return self.read_feather(*args, **kwargs) - elif self.metadata.file_extension in ["xlsx", "xls", "xlsm", "xlsb", "odf", "ods", "odt"]: - return self.read_excel(*args, **kwargs) - elif self.metadata.file_extension == "json": - return self.read_json(*args, **kwargs) - elif self.metadata.file_extension == "dta": - return self.read_stata(*args, **kwargs) - elif self.metadata.file_extension == "rds": - return self.read_rds(*args, **kwargs) - elif self.metadata.file_extension == "rda": - return self.read_rda(*args, **kwargs) - else: - raise ValueError(f"Unknown extension {self.metadata.file_extension}") + return read_table_from_snapshot( + *args, + path=self.path, + table_metadata=self.to_table_metadata(), + snapshot_origin=self.metadata.origin, + file_extension=self.metadata.file_extension, + **kwargs, + ) def read_csv(self, *args, **kwargs) -> Table: """Read CSV file into a Table and populate it with metadata.""" @@ -228,6 +220,10 @@ def read_rda(self, *args, **kwargs) -> Table: """Read R data .rda file into a Table and populate it with metadata.""" return pr.read_rda(self.path, *args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) + def read_fwf(self, *args, **kwargs) -> Table: + """Read a table of fixed-width formatted lines with metadata.""" + return pr.read_fwf(self.path, *args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) + def read_from_records(self, *args, **kwargs) -> Table: """Read records into a Table and populate it with metadata.""" return pr.read_from_records(*args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) @@ -236,10 +232,6 @@ def read_from_dict(self, *args, **kwargs) -> Table: """Read data from a dictionary into a Table and populate it with metadata.""" return pr.read_from_dict(*args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) - def read_fwf(self, *args, **kwargs) -> Table: - """Read a table of fixed-width formatted lines with metadata.""" - return pr.read_fwf(self.path, *args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) - def ExcelFile(self, *args, **kwargs) -> pr.ExcelFile: """Return an Excel file object ready for parsing.""" return pr.ExcelFile(self.path, *args, metadata=self.to_table_metadata(), origin=self.metadata.origin, **kwargs) @@ -255,6 +247,26 @@ def extract_to_tempdir(self) -> Any: # Return temporary directory return temp_dir + def read_in_archive(self, filename: str, *args, **kwargs) -> Table: + """Read data from file inside a zip/tar archive. + + If the relevant data file is within a zip/tar archive, this method will read this file and return it as a table. + + To do so, this method first unzips/untars the archive to a temporary directory, and then reads the file. Note that the file should have a supported extension (see `read` method). + """ + with self.extract_to_tempdir() as tmpdir: + new_extension = filename.split(".")[-1] + # Read + tb = read_table_from_snapshot( + *args, + path=Path(tmpdir) / filename, + table_metadata=self.to_table_metadata(), + snapshot_origin=self.metadata.origin, + file_extension=new_extension, + **kwargs, + ) + return tb + @pruned_json @dataclass_json @@ -457,6 +469,44 @@ def to_table_metadata(self): return table_meta +def read_table_from_snapshot( + path: Union[str, Path], + table_metadata: TableMeta, + snapshot_origin: Union[Origin, None], + file_extension: str, + *args, + **kwargs, +) -> Table: + """Read snapshot as a table.""" + # Define kwargs / args + args = [ + path, + *args, + ] + kwargs = { + **kwargs, + "metadata": table_metadata, + "origin": snapshot_origin, + } + # Read table + if file_extension == "csv": + return pr.read_csv(*args, **kwargs) + elif file_extension == "feather": + return pr.read_feather(*args, **kwargs) + elif file_extension in ["xlsx", "xls", "xlsm", "xlsb", "odf", "ods", "odt"]: + return pr.read_excel(*args, **kwargs) + elif file_extension == "json": + return pr.read_json(*args, **kwargs) + elif file_extension == "dta": + return pr.read_stata(*args, **kwargs) + elif file_extension == "rds": + return pr.read_rds(*args, **kwargs) + elif file_extension == "rda": + return pr.read_rda(*args, **kwargs) + else: + raise ValueError(f"Unknown extension {file_extension}") + + def add_snapshot( uri: str, filename: Optional[Union[str, Path]] = None, From 24df2206342ea73b8c9d3f70c33f6c4d25e49ae3 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 19 Mar 2024 00:17:13 +0100 Subject: [PATCH 05/62] meadow --- dag/democracy.yml | 4 +++ .../data/meadow/democracy/2024-03-07/vdem.py | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 etl/steps/data/meadow/democracy/2024-03-07/vdem.py diff --git a/dag/democracy.yml b/dag/democracy.yml index b5fd1915366..61e0951cf21 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -8,3 +8,7 @@ steps: - data://garden/demography/2023-03-31/population data://grapher/democracy/2024-03-07/bmr: - data://garden/democracy/2024-03-07/bmr + + # Varieties of Democracy (2024) + data://meadow/democracy/2024-03-07/vdem: + - snapshot://democracy/2024-03-18/vdem.zip diff --git a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py new file mode 100644 index 00000000000..c9222c20257 --- /dev/null +++ b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py @@ -0,0 +1,32 @@ +"""Load a snapshot and create a meadow dataset.""" + +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + + +def run(dest_dir: str) -> None: + # + # Load inputs. + # + # Retrieve snapshot. + snap = paths.load_snapshot("vdem.zip") + + # Load data from snapshot. + tb = snap.read_in_archive("V-Dem-CY-Full+Others-v14.csv") + + # + # Process data. + # + # Ensure all columns are snake-case, set an appropriate index, and sort conveniently. + tb = tb.underscore().set_index(["country_name", "year"], verify_integrity=True).sort_index() + + # + # Save outputs. + # + # Create a new meadow dataset with the same metadata as the snapshot. + ds_meadow = create_dataset(dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=snap.metadata) + + # Save changes in the new meadow dataset. + ds_meadow.save() From 5e4947e162b11ac78ccd5f7b5fe23b5d38566772 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 19 Mar 2024 13:41:20 +0100 Subject: [PATCH 06/62] only load relevant columns --- .../data/meadow/democracy/2024-03-07/vdem.py | 214 +++++++++++++++++- 1 file changed, 213 insertions(+), 1 deletion(-) diff --git a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py index c9222c20257..d0dd4aacc86 100644 --- a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py @@ -6,6 +6,218 @@ paths = PathFinder(__file__) +COLUMNS_KEEP = [ + # primary keys + "year", + "country_name", + # e + "e_ti_cpi", + "e_wbgi_gee", + # v2c + "v2clacjstm_osp", + "v2clacjstm_osp_codehigh", + "v2clacjstm_osp_codelow", + "v2clacjstw_osp", + "v2clacjstw_osp_codehigh", + "v2clacjstw_osp_codelow", + "v2clrspct", + "v2clrspct_codehigh", + "v2clrspct_codelow", + "v2clsocgrp", + "v2clsocgrp_codehigh", + "v2clsocgrp_codelow", + "v2cltrnslw_osp", + "v2cltrnslw_osp_codehigh", + "v2cltrnslw_osp_codelow", + # v2d + "v2dlcommon", + "v2dlcommon_codehigh", + "v2dlcommon_codelow", + "v2dlconslt", + "v2dlconslt_codehigh", + "v2dlconslt_codelow", + "v2dlcountr", + "v2dlcountr_codehigh", + "v2dlcountr_codelow", + "v2dlengage", + "v2dlengage_codehigh", + "v2dlengage_codelow", + "v2dlreason", + "v2dlreason_codehigh", + "v2dlreason_codelow", + # v2e + "v2elfrfair_osp", + "v2elfrfair_osp_codehigh", + "v2elfrfair_osp_codelow", + "v2elmulpar_osp", + "v2elmulpar_osp_codehigh", + "v2elmulpar_osp_codelow", + "v2eltrnout", + "v2eltype_0", + "v2eltype_1", + "v2eltype_2", + "v2eltype_3", + "v2eltype_4", + "v2eltype_5", + "v2eltype_6", + "v2eltype_7", + "v2eltype_8", + "v2eltype_9", + "v2ex_hogw", + "v2ex_hosw", + "v2ex_legconhog", + "v2ex_legconhos", + "v2exaphogp", + "v2exfemhog", + "v2exfemhos", + "v2exhoshog", + "v2exnamhog", + "v2exnamhos", + "v2expathhg", + "v2expathhs", + # v2j + "v2jucorrdc", + "v2jucorrdc_codehigh", + "v2jucorrdc_codelow", + # v2l + "v2lgcrrpt", + "v2lgcrrpt_codehigh", + "v2lgcrrpt_codelow", + "v2lgfemleg", + # v2p + "v2pepwrsoc", + "v2pepwrsoc_codehigh", + "v2pepwrsoc_codelow", + # v2s + "v2svdomaut", + "v2svdomaut_codehigh", + "v2svdomaut_codelow", + "v2svinlaut", + "v2svinlaut_codehigh", + "v2svinlaut_codelow", + "v2svstterr", + "v2svstterr_codehigh", + "v2svstterr_codelow", + # v2x + "v2x_civlib", + "v2x_civlib_codehigh", + "v2x_civlib_codelow", + "v2x_clphy", + "v2x_clphy_codehigh", + "v2x_clphy_codelow", + "v2x_clpol", + "v2x_clpol_codehigh", + "v2x_clpol_codelow", + "v2x_clpriv", + "v2x_clpriv_codehigh", + "v2x_clpriv_codelow", + "v2x_corr", + "v2x_corr_codehigh", + "v2x_corr_codelow", + "v2x_cspart", + "v2x_cspart_codehigh", + "v2x_cspart_codelow", + "v2x_delibdem", + "v2x_delibdem_codehigh", + "v2x_delibdem_codelow", + "v2x_egal", + "v2x_egal_codehigh", + "v2x_egal_codelow", + "v2x_egaldem", + "v2x_egaldem_codehigh", + "v2x_egaldem_codelow", + "v2x_elecoff", + "v2x_elecreg", + "v2x_elecreg", + "v2x_execorr", + "v2x_execorr_codehigh", + "v2x_execorr_codelow", + "v2x_frassoc_thick", + "v2x_frassoc_thick_codehigh", + "v2x_frassoc_thick_codelow", + "v2x_freexp_altinf", + "v2x_freexp_altinf_codehigh", + "v2x_freexp_altinf_codelow", + "v2x_gencl", + "v2x_gencl_codehigh", + "v2x_gencl_codelow", + "v2x_gencs", + "v2x_gencs_codehigh", + "v2x_gencs_codelow", + "v2x_gender", + "v2x_gender_codehigh", + "v2x_gender_codelow", + "v2x_genpp", + "v2x_genpp_codehigh", + "v2x_genpp_codelow", + "v2x_jucon", + "v2x_jucon_codehigh", + "v2x_jucon_codelow", + "v2x_libdem", + "v2x_libdem_codehigh", + "v2x_libdem_codelow", + "v2x_liberal", + "v2x_liberal_codehigh", + "v2x_liberal_codelow", + "v2x_partip", + "v2x_partip_codehigh", + "v2x_partip_codelow", + "v2x_partipdem", + "v2x_partipdem_codehigh", + "v2x_partipdem_codelow", + "v2x_polyarchy", + "v2x_polyarchy_codehigh", + "v2x_polyarchy_codelow", + "v2x_pubcorr", + "v2x_pubcorr_codehigh", + "v2x_pubcorr_codelow", + "v2x_regime", + "v2x_regime_amb", + "v2x_rule", + "v2x_rule_codehigh", + "v2x_rule_codelow", + "v2x_suffr", + "v2xcl_rol", + "v2xcl_rol_codehigh", + "v2xcl_rol_codelow", + "v2xcs_ccsi", + "v2xcs_ccsi_codehigh", + "v2xcs_ccsi_codelow", + "v2xdd_dd", + "v2xdl_delib", + "v2xdl_delib_codehigh", + "v2xdl_delib_codelow", + "v2xeg_eqaccess", + "v2xeg_eqaccess_codehigh", + "v2xeg_eqaccess_codelow", + "v2xeg_eqdr", + "v2xeg_eqdr_codehigh", + "v2xeg_eqdr_codelow", + "v2xeg_eqprotec", + "v2xeg_eqprotec_codehigh", + "v2xeg_eqprotec_codelow", + "v2xel_frefair", + "v2xel_frefair_codehigh", + "v2xel_frefair_codelow", + "v2xel_locelec", + "v2xel_locelec_codehigh", + "v2xel_locelec_codelow", + "v2xel_regelec", + "v2xel_regelec_codehigh", + "v2xel_regelec_codelow", + "v2xex_elecreg", + "v2xex_elecreg", + "v2xlg_elecreg", + "v2xlg_elecreg", + "v2xlg_legcon", + "v2xlg_legcon_codehigh", + "v2xlg_legcon_codelow", + "v2xnp_pres", + "v2xnp_pres_codehigh", + "v2xnp_pres_codelow", +] + + def run(dest_dir: str) -> None: # # Load inputs. @@ -14,7 +226,7 @@ def run(dest_dir: str) -> None: snap = paths.load_snapshot("vdem.zip") # Load data from snapshot. - tb = snap.read_in_archive("V-Dem-CY-Full+Others-v14.csv") + tb = snap.read_in_archive("V-Dem-CY-Full+Others-v14.csv", usecols=COLUMNS_KEEP, dtype={"v2exnamhog": "str"}) # # Process data. From 97c3f44059b933623071fc66f9e77a018987a936 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 19 Mar 2024 14:38:13 +0100 Subject: [PATCH 07/62] wip --- dag/democracy.yml | 2 + .../democracy/2024-03-07/vdem.countries.json | 2 + .../2024-03-07/vdem.excluded_countries.json | 2 + .../garden/democracy/2024-03-07/vdem.meta.yml | 53 +++++++++++++++++++ .../data/garden/democracy/2024-03-07/vdem.py | 37 +++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.py diff --git a/dag/democracy.yml b/dag/democracy.yml index 61e0951cf21..b880f94d4f0 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -12,3 +12,5 @@ steps: # Varieties of Democracy (2024) data://meadow/democracy/2024-03-07/vdem: - snapshot://democracy/2024-03-18/vdem.zip + data://garden/democracy/2024-03-07/vdem: + - data://meadow/democracy/2024-03-07/vdem diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json new file mode 100644 index 00000000000..2c63c085104 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json @@ -0,0 +1,2 @@ +{ +} diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json new file mode 100644 index 00000000000..0d4f101c7a3 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json @@ -0,0 +1,2 @@ +[ +] diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml new file mode 100644 index 00000000000..8dcee25ca3f --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml @@ -0,0 +1,53 @@ +# NOTE: To learn more about the fields, hover over their names. +definitions: + common: + presentation: + topic_tags: + - Democracy + + +# Learn more about the available fields: +# http://docs.owid.io/projects/etl/architecture/metadata/reference/ +dataset: + update_period_days: 365 + + +tables: + vdem: + variables: + # testing_variable: + # title: Testing variable title + # unit: arbitrary units + # short_unit: au + # description_short: Short description of testing variable. + # description_processing: Description of processing of testing variable. + # description_key: List of key points about the indicator. + # description_from_producer: Description of testing variable from producer. + # processing_level: minor + # presentation: + # attribution: + # attribution_short: + # faqs: + # grapher_config: + # title_public: + # title_variant: + # topic_tags: + # display: + # color: + # conversionFactor: 1 + # description: + # entityAnnotationsMap: Test annotation + # includeInTable: + # isProjection: false + # name: Testing variable + # numDecimalPlaces: 0 + # shortUnit: au + # tableDisplay: + # hideAbsoluteChange: + # hideRelativeChange: + # tolerance: 0 + # unit: arbitrary units + # yearIsDay: false + # zeroDay: + {} + diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.py b/etl/steps/data/garden/democracy/2024-03-07/vdem.py new file mode 100644 index 00000000000..65d73c29f18 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.py @@ -0,0 +1,37 @@ +"""Load a meadow dataset and create a garden dataset.""" + +from etl.data_helpers import geo +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + + +def run(dest_dir: str) -> None: + # + # Load inputs. + # + # Load meadow dataset. + ds_meadow = paths.load_dataset("vdem") + + # Read table from meadow dataset. + tb = ds_meadow["vdem"].reset_index() + + # + # Process data. + # + tb = geo.harmonize_countries( + df=tb, countries_file=paths.country_mapping_path, excluded_countries_file=paths.excluded_countries_path + ) + tb = tb.set_index(["country", "year"], verify_integrity=True) + + # + # Save outputs. + # + # Create a new garden dataset with the same metadata as the meadow dataset. + ds_garden = create_dataset( + dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata + ) + + # Save changes in the new garden dataset. + ds_garden.save() From cb4a45a885dc0dfba79875d40744cdff2190687c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Tue, 19 Mar 2024 18:36:09 +0100 Subject: [PATCH 08/62] enhance: generalise fillna table method --- lib/catalog/owid/catalog/tables.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/catalog/owid/catalog/tables.py b/lib/catalog/owid/catalog/tables.py index c8c1f60448c..e9342de9dcd 100644 --- a/lib/catalog/owid/catalog/tables.py +++ b/lib/catalog/owid/catalog/tables.py @@ -899,18 +899,21 @@ def rename_index_names(self, renames: Dict[str, str]) -> "Table": tb = tb.set_index(column_idx_new) return tb - def fillna(self, value, **kwargs) -> "Table": + def fillna(self, **kwargs) -> "Table": """Usual fillna, but, if the object given to fill values with is a table, transfer its metadata to the filled table.""" - tb = super().fillna(value, **kwargs) - - if type(value) == type(self): - for column in tb.columns: - if column in value.columns: - tb._fields[column] = variables.combine_variables_metadata( - variables=[tb[column], value[column]], operation="fillna", name=column - ) - + if "value" in kwargs: + value = kwargs.pop("value") + tb = super().fillna(value, **kwargs) + + if type(value) == type(self): + for column in tb.columns: + if column in value.columns: + tb._fields[column] = variables.combine_variables_metadata( + variables=[tb[column], value[column]], operation="fillna", name=column + ) + else: + tb = super().fillna(**kwargs) return tb From 9fed765b83d3aa766ea0370049815bbe989765e7 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 19 Mar 2024 18:38:29 +0100 Subject: [PATCH 09/62] wip --- .../data/garden/democracy/2024-03-07/vdem.py | 72 +++++++++++++++++++ .../data/meadow/democracy/2024-03-07/vdem.py | 39 +++++----- 2 files changed, 95 insertions(+), 16 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.py b/etl/steps/data/garden/democracy/2024-03-07/vdem.py index 65d73c29f18..85f3875fda2 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.py @@ -17,9 +17,81 @@ def run(dest_dir: str) -> None: # Read table from meadow dataset. tb = ds_meadow["vdem"].reset_index() + tb = tb.astype( + { + "v2exnamhos": str, + } + ) # # Process data. # + # Drop superfluous observations + tb = tb[~((tb["country"] == "Italy") & (tb["year"] == 1861))] + tb.loc[(tb["country"] == "Piedmont-Sardinia") & (tb["year"] == 1861), "country"] = "Italy" + + # Goemans et al.'s (2009) Archigos dataset, rulers.org, and worldstatesmen.org identify non-elected General Raoul Cédras as the de-facto leader of Haiti from 1991 until 1994. + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exnamhos"] = "Raoul Cédras" + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hosw"] = 1 + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hogw"] = 0 + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exaphogp"] = 0 + + # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. + ## HOG + tb.loc[tb["v2exnamhog"] == "Diango Cissoko", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "Ion Chicu", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "Joseph Jacques Jean Chrétien", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "KåreIsaachsen Willoch", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "YuriiIvanovych Yekhanurov", "v2exfemhog"] = 0 + ## HOS + tb.loc[tb["v2exnamhos"] == "Ali Ben Bongo Ondimba", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Chulalongkorn (Rama V)", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Dieudonné François Joseph Marie Reste", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Letsie III", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == 'Miguel I "o Rei Absoluto"', "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Moshoeshoe II", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Prince Zaifeng", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Rajkeswur Purryag", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Shimon Peres", "v2exfemhos"] = 0 + + # Sort + tb = tb.sort_values(["country", "year"]) + + # Something + columns = [ + "v2elmulpar_osp", + "v2elmulpar_osp_codehigh", + "v2elmulpar_osp_codelow", + "v2elfrfair_osp", + ] + mask = tb["v2x_elecreg"] == 1 + for col in columns: + ffilled = tb[col].ffill() + mask = tb["v2x_elecreg"] == 1 + tb.loc[mask, col] = ffilled.loc[mask] + + # tb["year_diff"] = tb.groupby("country").year.diff() + # column_name = "v2elmulpar_osp" + # tb.loc[(tb["diff"]!=1) & (tb[column_name].isna()) & (tb["v2x_elecreg"].isna())].empty + + # For v2elmulpar_osp_imp + tb["v2elmulpar_osp_imp"] = tb["v2elmulpar_osp"] + tb.loc[(tb["v2elmulpar_osp_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_imp"] = tb[ + "v2elmulpar_osp_imp" + ].shift(1) + + # For v2elmulpar_osp_high_imp + tb["v2elmulpar_osp_high_imp"] = tb["v2elmulpar_osp_codehigh"] + tb.loc[(tb["v2elmulpar_osp_high_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_high_imp"] = tb[ + "v2elmulpar_osp_high_imp" + ].shift(1) + + # For v2elmulpar_osp_low_imp + tb["v2elmulpar_osp_low_imp"] = tb["v2elmulpar_osp_codelow"] + tb.loc[(tb["v2elmulpar_osp_low_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_low_imp"] = tb[ + "v2elmulpar_osp_low_imp" + ].shift(1) + + # Harmonize country names tb = geo.harmonize_countries( df=tb, countries_file=paths.country_mapping_path, excluded_countries_file=paths.excluded_countries_path ) diff --git a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py index d0dd4aacc86..4f5b353c5ad 100644 --- a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py @@ -53,26 +53,27 @@ "v2elmulpar_osp_codehigh", "v2elmulpar_osp_codelow", "v2eltrnout", - "v2eltype_0", - "v2eltype_1", - "v2eltype_2", - "v2eltype_3", - "v2eltype_4", - "v2eltype_5", - "v2eltype_6", - "v2eltype_7", - "v2eltype_8", - "v2eltype_9", - "v2ex_hogw", - "v2ex_hosw", + # What type of election was held on this date? + "v2eltype_0", # Legislative; lower, sole, or both chambers, first or only round. + "v2eltype_1", # Legislative; lower, sole, or both chambers, second or later round. + "v2eltype_2", # Legislative; upper chamber only, first or only round. + "v2eltype_3", # Legislative; upper chamber only, second round. + "v2eltype_4", # Constituent Assembly, first or only round. + "v2eltype_5", # Constituent Assembly, second or later round. + "v2eltype_6", # Presidential, first or only round. + "v2eltype_7", # Presidential, second round. + "v2eltype_8", # Metropolitan or supranational legislative, first or only round. + "v2eltype_9", # Metropolitan or supranational legislative, second round. + "v2ex_hogw", # HOG have more relative power than the HOS over the appointment and dismissal of cabinet ministers? + "v2ex_hosw", # HOS have more relative power than the HOG over the appointment and dismissal of cabinet ministers? "v2ex_legconhog", "v2ex_legconhos", "v2exaphogp", "v2exfemhog", "v2exfemhos", - "v2exhoshog", - "v2exnamhog", - "v2exnamhos", + "v2exhoshog", # Is the head of state (HOS) also head of government (HOG)? + "v2exnamhog", # What is the name of the head of government? + "v2exnamhos", # What is the name of the head of state? "v2expathhg", "v2expathhs", # v2j @@ -231,8 +232,14 @@ def run(dest_dir: str) -> None: # # Process data. # + # Column rename + tb = tb.rename( + columns={ + "country_name": "country", + } + ) # Ensure all columns are snake-case, set an appropriate index, and sort conveniently. - tb = tb.underscore().set_index(["country_name", "year"], verify_integrity=True).sort_index() + tb = tb.underscore().set_index(["country", "year"], verify_integrity=True).sort_index() # # Save outputs. From 41c3ac213c395216606c2a4856cd2cd2e9d7852f Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 19 Mar 2024 18:47:31 +0100 Subject: [PATCH 10/62] restructure argument --- lib/catalog/owid/catalog/tables.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/catalog/owid/catalog/tables.py b/lib/catalog/owid/catalog/tables.py index e9342de9dcd..f6eabc43486 100644 --- a/lib/catalog/owid/catalog/tables.py +++ b/lib/catalog/owid/catalog/tables.py @@ -899,11 +899,10 @@ def rename_index_names(self, renames: Dict[str, str]) -> "Table": tb = tb.set_index(column_idx_new) return tb - def fillna(self, **kwargs) -> "Table": + def fillna(self, value=None, **kwargs) -> "Table": """Usual fillna, but, if the object given to fill values with is a table, transfer its metadata to the filled table.""" - if "value" in kwargs: - value = kwargs.pop("value") + if value is not None: tb = super().fillna(value, **kwargs) if type(value) == type(self): @@ -914,6 +913,8 @@ def fillna(self, **kwargs) -> "Table": ) else: tb = super().fillna(**kwargs) + + tb = cast(Table, tb) return tb From 94c07103e569cd5122e6a3a43f79fe81ef94bc1f Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 20 Mar 2024 02:03:12 +0100 Subject: [PATCH 11/62] clean step --- .../democracy/2024-03-07/vdem.countries.json | 2 - .../data/garden/democracy/2024-03-07/vdem.py | 109 -- .../democracy/2024-03-07/vdem/__init__.py | 120 +++ .../2024-03-07/vdem/vdem.countries.json | 201 ++++ .../{ => vdem}/vdem.excluded_countries.json | 0 .../2024-03-07/{ => vdem}/vdem.meta.yml | 0 .../democracy/2024-03-07/vdem/vdem_clean.py | 962 ++++++++++++++++++ 7 files changed, 1283 insertions(+), 111 deletions(-) delete mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json delete mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem.py create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.excluded_countries.json (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.meta.yml (100%) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json deleted file mode 100644 index 2c63c085104..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.py b/etl/steps/data/garden/democracy/2024-03-07/vdem.py deleted file mode 100644 index 85f3875fda2..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Load a meadow dataset and create a garden dataset.""" - -from etl.data_helpers import geo -from etl.helpers import PathFinder, create_dataset - -# Get paths and naming conventions for current step. -paths = PathFinder(__file__) - - -def run(dest_dir: str) -> None: - # - # Load inputs. - # - # Load meadow dataset. - ds_meadow = paths.load_dataset("vdem") - - # Read table from meadow dataset. - tb = ds_meadow["vdem"].reset_index() - - tb = tb.astype( - { - "v2exnamhos": str, - } - ) - # - # Process data. - # - # Drop superfluous observations - tb = tb[~((tb["country"] == "Italy") & (tb["year"] == 1861))] - tb.loc[(tb["country"] == "Piedmont-Sardinia") & (tb["year"] == 1861), "country"] = "Italy" - - # Goemans et al.'s (2009) Archigos dataset, rulers.org, and worldstatesmen.org identify non-elected General Raoul Cédras as the de-facto leader of Haiti from 1991 until 1994. - tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exnamhos"] = "Raoul Cédras" - tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hosw"] = 1 - tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hogw"] = 0 - tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exaphogp"] = 0 - - # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. - ## HOG - tb.loc[tb["v2exnamhog"] == "Diango Cissoko", "v2exfemhog"] = 0 - tb.loc[tb["v2exnamhog"] == "Ion Chicu", "v2exfemhog"] = 0 - tb.loc[tb["v2exnamhog"] == "Joseph Jacques Jean Chrétien", "v2exfemhog"] = 0 - tb.loc[tb["v2exnamhog"] == "KåreIsaachsen Willoch", "v2exfemhog"] = 0 - tb.loc[tb["v2exnamhog"] == "YuriiIvanovych Yekhanurov", "v2exfemhog"] = 0 - ## HOS - tb.loc[tb["v2exnamhos"] == "Ali Ben Bongo Ondimba", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Chulalongkorn (Rama V)", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Dieudonné François Joseph Marie Reste", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Letsie III", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == 'Miguel I "o Rei Absoluto"', "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Moshoeshoe II", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Prince Zaifeng", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Rajkeswur Purryag", "v2exfemhos"] = 0 - tb.loc[tb["v2exnamhos"] == "Shimon Peres", "v2exfemhos"] = 0 - - # Sort - tb = tb.sort_values(["country", "year"]) - - # Something - columns = [ - "v2elmulpar_osp", - "v2elmulpar_osp_codehigh", - "v2elmulpar_osp_codelow", - "v2elfrfair_osp", - ] - mask = tb["v2x_elecreg"] == 1 - for col in columns: - ffilled = tb[col].ffill() - mask = tb["v2x_elecreg"] == 1 - tb.loc[mask, col] = ffilled.loc[mask] - - # tb["year_diff"] = tb.groupby("country").year.diff() - # column_name = "v2elmulpar_osp" - # tb.loc[(tb["diff"]!=1) & (tb[column_name].isna()) & (tb["v2x_elecreg"].isna())].empty - - # For v2elmulpar_osp_imp - tb["v2elmulpar_osp_imp"] = tb["v2elmulpar_osp"] - tb.loc[(tb["v2elmulpar_osp_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_imp"] = tb[ - "v2elmulpar_osp_imp" - ].shift(1) - - # For v2elmulpar_osp_high_imp - tb["v2elmulpar_osp_high_imp"] = tb["v2elmulpar_osp_codehigh"] - tb.loc[(tb["v2elmulpar_osp_high_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_high_imp"] = tb[ - "v2elmulpar_osp_high_imp" - ].shift(1) - - # For v2elmulpar_osp_low_imp - tb["v2elmulpar_osp_low_imp"] = tb["v2elmulpar_osp_codelow"] - tb.loc[(tb["v2elmulpar_osp_low_imp"].isna()) & (tb["v2x_elecreg"] == 1), "v2elmulpar_osp_low_imp"] = tb[ - "v2elmulpar_osp_low_imp" - ].shift(1) - - # Harmonize country names - tb = geo.harmonize_countries( - df=tb, countries_file=paths.country_mapping_path, excluded_countries_file=paths.excluded_countries_path - ) - tb = tb.set_index(["country", "year"], verify_integrity=True) - - # - # Save outputs. - # - # Create a new garden dataset with the same metadata as the meadow dataset. - ds_garden = create_dataset( - dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata - ) - - # Save changes in the new garden dataset. - ds_garden.save() diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py new file mode 100644 index 00000000000..36c78aeb0e5 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -0,0 +1,120 @@ +"""Load a meadow dataset and create a garden dataset.""" + +from typing import cast + +import vdem_clean as clean # VDEM's cleaning library +from owid.catalog import Table + +from etl.data_helpers import geo +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + + +def run(dest_dir: str) -> None: + # %% Intro + # + # Load inputs. + # + # Load meadow dataset. + ds_meadow = paths.load_dataset("vdem") + + # Read table from meadow dataset. + tb = ds_meadow["vdem"].reset_index() + + tb = tb.astype( + { + "v2exnamhos": str, + } + ) + + # + # Process data. + # + tb = cast(Table, tb) + tb = clean.initial_cleaning(tb) + + # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. + tb = clean.clean_female_flag(tb) + + # Sort + tb = tb.sort_values(["country", "year"]) + + # (L76-L94) Create expanded and refined Regimes of the World indicator + # %% Create indicators for multi-party elections, and free and fair elections + tb = clean.estimate_mulpar_indicators(tb) + + # %% (L96-L109) Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years: + tb = clean.estimate_ex_indicators(tb) + + # %% (L109-L122) Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years + tb = clean.estimate_leg_indicators(tb) + + # %% (L122-L141) Create indicators for multi-party head of state elections with imputed values between election-years + tb = clean.estimate_hos_indicators(tb) + + # %% (L141-L167) Create indicators for multi-party head of government elections with imputed values between election-years + tb = clean.estimate_hog_indicators(tb) + + # %% (L167-L175) Create indicators for multi-party executive and legislative elections with imputed values between election-years + tb = clean.estimate_exleg_indicators(tb) + + # %% (L177-L201) Create indicator for multi-party head of executive elections with imputed values between election-years + tb = clean.estimate_hoe_indicators(tb) + + # %% (L202-L300) Create dichotomous indicators for classification criteria + tb = clean.estimate_dichotomous_indicators(tb) + + # %% (L302-L314) Create indicators for Regimes of the World with expanded coverage and minor changes to coding + tb = clean.estimate_row_indicators(tb) + + # %% (L322-L389) Compare our and standard RoW coding + tb = clean.compare_with_row_coding(tb) + + # %% (L389-L401) Finalize expanded and refined Regimes of the World indicator with ambiguous categories + tb = clean.add_regime_amb_row(tb) + + # %% (L416) Drop irrelevant columns now + tb = clean.drop_columns(tb) + + # %% (L419-L424) Create reduced version of political regimes, only distinguishing between closed autocracies, electoral autocracies, and electoral democracies (including liberal democracies) + tb["regime_redux_row"] = tb["regime_row_owid"].replace({3: 2}) + + # %% (L427-L669) Rename columns of interest + tb = clean.rename_columns(tb) + + # %% Ratio as share (share of adult citizens with vote right) + tb["suffr_vdem"] = tb["suffr_vdem"] * 100 + + # %% Create variable identifying gender of chief executive + tb = clean.estimate_gender_hoe_indicator(tb) + + # %% Estimate gender of HOG + tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] + tb = tb.drop(columns=["v2exhoshog"]) + + # %% Proceed + # Harmonize country names + tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) + + # Set index + tb = tb.set_index(["country", "year"], verify_integrity=True) + + # Dtypes + tb = tb.astype(dtype={"v2exnamhos": "string"}) + + # %% Save + # + # Save outputs. + # + # Create a new garden dataset with the same metadata as the meadow dataset. + ds_garden = create_dataset( + dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata + ) + + # Save changes in the new garden dataset. + ds_garden.save() + + +# %% diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json new file mode 100644 index 00000000000..25b636f9780 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -0,0 +1,201 @@ +{ + "Afghanistan": "Afghanistan", + "Albania": "Albania", + "Algeria": "Algeria", + "Angola": "Angola", + "Argentina": "Argentina", + "Armenia": "Armenia", + "Australia": "Australia", + "Austria": "Austria", + "Azerbaijan": "Azerbaijan", + "Baden": "Grand Duchy of Baden", + "Bahrain": "Bahrain", + "Bangladesh": "Bangladesh", + "Barbados": "Barbados", + "Bavaria": "Kingdom of Bavaria", + "Belarus": "Belarus", + "Belgium": "Belgium", + "Benin": "Benin", + "Bhutan": "Bhutan", + "Bolivia": "Bolivia", + "Bosnia and Herzegovina": "Bosnia and Herzegovina", + "Botswana": "Botswana", + "Brazil": "Brazil", + "Bulgaria": "Bulgaria", + "Burkina Faso": "Burkina Faso", + "Burundi": "Burundi", + "Cambodia": "Cambodia", + "Cameroon": "Cameroon", + "Canada": "Canada", + "Cape Verde": "Cape Verde", + "Central African Republic": "Central African Republic", + "Chad": "Chad", + "Chile": "Chile", + "China": "China", + "Colombia": "Colombia", + "Comoros": "Comoros", + "Costa Rica": "Costa Rica", + "Croatia": "Croatia", + "Cuba": "Cuba", + "Cyprus": "Cyprus", + "Czechia": "Czechia", + "Democratic Republic of the Congo": "Democratic Republic of Congo", + "Denmark": "Denmark", + "Djibouti": "Djibouti", + "Dominican Republic": "Dominican Republic", + "Ecuador": "Ecuador", + "Egypt": "Egypt", + "El Salvador": "El Salvador", + "Equatorial Guinea": "Equatorial Guinea", + "Eritrea": "Eritrea", + "Estonia": "Estonia", + "Eswatini": "Eswatini", + "Ethiopia": "Ethiopia", + "Fiji": "Fiji", + "Finland": "Finland", + "France": "France", + "Gabon": "Gabon", + "Georgia": "Georgia", + "German Democratic Republic": "East Germany", + "Germany": "Germany", + "Ghana": "Ghana", + "Greece": "Greece", + "Guatemala": "Guatemala", + "Guinea": "Guinea", + "Guinea-Bissau": "Guinea-Bissau", + "Guyana": "Guyana", + "Haiti": "Haiti", + "Honduras": "Honduras", + "Hong Kong": "Hong Kong", + "Hungary": "Hungary", + "Iceland": "Iceland", + "India": "India", + "Indonesia": "Indonesia", + "Iran": "Iran", + "Iraq": "Iraq", + "Ireland": "Ireland", + "Israel": "Israel", + "Italy": "Italy", + "Ivory Coast": "Cote d'Ivoire", + "Jamaica": "Jamaica", + "Japan": "Japan", + "Jordan": "Jordan", + "Kazakhstan": "Kazakhstan", + "Kenya": "Kenya", + "Kosovo": "Kosovo", + "Kuwait": "Kuwait", + "Kyrgyzstan": "Kyrgyzstan", + "Laos": "Laos", + "Latvia": "Latvia", + "Lebanon": "Lebanon", + "Lesotho": "Lesotho", + "Liberia": "Liberia", + "Libya": "Libya", + "Lithuania": "Lithuania", + "Luxembourg": "Luxembourg", + "Madagascar": "Madagascar", + "Malawi": "Malawi", + "Malaysia": "Malaysia", + "Maldives": "Maldives", + "Mali": "Mali", + "Malta": "Malta", + "Mauritania": "Mauritania", + "Mauritius": "Mauritius", + "Mexico": "Mexico", + "Modena": "Duchy of Modena and Reggio", + "Moldova": "Moldova", + "Mongolia": "Mongolia", + "Montenegro": "Montenegro", + "Morocco": "Morocco", + "Mozambique": "Mozambique", + "Namibia": "Namibia", + "Nepal": "Nepal", + "Netherlands": "Netherlands", + "New Zealand": "New Zealand", + "Nicaragua": "Nicaragua", + "Niger": "Niger", + "Nigeria": "Nigeria", + "North Korea": "North Korea", + "North Macedonia": "North Macedonia", + "Norway": "Norway", + "Oman": "Oman", + "Pakistan": "Pakistan", + "Panama": "Panama", + "Papua New Guinea": "Papua New Guinea", + "Paraguay": "Paraguay", + "Parma": "Duchy of Parma and Piacenza", + "Peru": "Peru", + "Philippines": "Philippines", + "Piedmont-Sardinia": "Kingdom of Sardinia", + "Poland": "Poland", + "Portugal": "Portugal", + "Qatar": "Qatar", + "Republic of Vietnam": "Republic of Vietnam", + "Romania": "Romania", + "Russia": "Russia", + "Rwanda": "Rwanda", + "Sao Tome and Principe": "Sao Tome and Principe", + "Saudi Arabia": "Saudi Arabia", + "Saxony": "Kingdom of Saxony", + "Senegal": "Senegal", + "Serbia": "Serbia", + "Seychelles": "Seychelles", + "Sierra Leone": "Sierra Leone", + "Singapore": "Singapore", + "Slovakia": "Slovakia", + "Slovenia": "Slovenia", + "Solomon Islands": "Solomon Islands", + "Somalia": "Somalia", + "Somaliland": "Somaliland", + "South Africa": "South Africa", + "South Korea": "South Korea", + "South Sudan": "South Sudan", + "South Yemen": "Yemen People's Republic", + "Spain": "Spain", + "Sri Lanka": "Sri Lanka", + "Sudan": "Sudan", + "Suriname": "Suriname", + "Sweden": "Sweden", + "Switzerland": "Switzerland", + "Syria": "Syria", + "Taiwan": "Taiwan", + "Tajikistan": "Tajikistan", + "Tanzania": "Tanzania", + "Thailand": "Thailand", + "Timor-Leste": "East Timor", + "Togo": "Togo", + "Trinidad and Tobago": "Trinidad and Tobago", + "Tunisia": "Tunisia", + "Turkmenistan": "Turkmenistan", + "Tuscany": "Grand Duchy of Tuscany", + "Two Sicilies": "Kingdom of the Two Sicilies", + "Uganda": "Uganda", + "Ukraine": "Ukraine", + "United Arab Emirates": "United Arab Emirates", + "United Kingdom": "United Kingdom", + "United States of America": "United States", + "Uruguay": "Uruguay", + "Uzbekistan": "Uzbekistan", + "Vanuatu": "Vanuatu", + "Venezuela": "Venezuela", + "Vietnam": "Vietnam", + "Yemen": "Yemen", + "Zambia": "Zambia", + "Zanzibar": "Zanzibar", + "Zimbabwe": "Zimbabwe", + "Brunswick": "Brunswick", + "Burma/Myanmar": "Myanmar", + "Hamburg": "Hamburg", + "Hanover": "Hanover", + "Hesse-Darmstadt": "Hesse Grand Ducal", + "Hesse-Kassel": "Hesse Electoral", + "Mecklenburg Schwerin": "Mecklenburg Schwerin", + "Oldenburg": "Oldenburg", + "Palestine/British Mandate": "Palestine", + "Papal States": "Vatican", + "Republic of the Congo": "Congo", + "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", + "The Gambia": "Gambia", + "T\u00fcrkiye": "Turkey", + "W\u00fcrtemberg": "Kingdom of Wurttemberg" +} diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py new file mode 100644 index 00000000000..666695045ce --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -0,0 +1,962 @@ +"""Code equivalent to clean step (STATA). + +ref: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_clean.do +""" +from typing import Union + +import numpy as np +from owid.catalog import Table + + +def initial_cleaning(tb: Table) -> Table: + """Initial data cleaning.""" + # Drop superfluous observations + tb = tb.loc[~((tb["country"] == "Italy") & (tb["year"] == 1861))] + tb.loc[(tb["country"] == "Piedmont-Sardinia") & (tb["year"] == 1861), "country"] = "Italy" + + # Goemans et al.'s (2009) Archigos dataset, rulers.org, and worldstatesmen.org identify non-elected General Raoul Cédras as the de-facto leader of Haiti from 1991 until 1994. + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exnamhos"] = "Raoul Cédras" + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hosw"] = 1 + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hogw"] = 0 + tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exaphogp"] = 0 + return tb + + +def clean_female_flag(tb: Table) -> Table: + """While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here.""" + ## HOG + tb.loc[tb["v2exnamhog"] == "Diango Cissoko", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "Ion Chicu", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "Joseph Jacques Jean Chrétien", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "KåreIsaachsen Willoch", "v2exfemhog"] = 0 + tb.loc[tb["v2exnamhog"] == "YuriiIvanovych Yekhanurov", "v2exfemhog"] = 0 + ## HOS + tb.loc[tb["v2exnamhos"] == "Ali Ben Bongo Ondimba", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Chulalongkorn (Rama V)", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Dieudonné François Joseph Marie Reste", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Letsie III", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == 'Miguel I "o Rei Absoluto"', "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Moshoeshoe II", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Prince Zaifeng", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Rajkeswur Purryag", "v2exfemhos"] = 0 + tb.loc[tb["v2exnamhos"] == "Shimon Peres", "v2exfemhos"] = 0 + + return tb + + +def estimate_mulpar_indicators(tb: Table) -> Table: + """Create indicators for multi-party elections, and free and fair elections.""" + columns = { + # Create indicators for multi-party elections with imputed values between election-years + "v2elmulpar_osp": "v2elmulpar_osp", + "v2elmulpar_osp_codehigh": "v2elmulpar_osp_high", + "v2elmulpar_osp_codelow": "v2elmulpar_osp_low", + # Create indicators for free and fair elections with imputed values between election-years + "v2elfrfair_osp": "v2elfrfair_osp", + } + columns_old = list(columns.keys()) + columns_new = list(columns.values()) + + ## Forward fill indicators when there are regularly scheduled national elections on course, as stipulated by election law or well-established precedent + mask = tb["v2x_elecreg"] == 1 + tb.loc[mask, columns_new] = tb.groupby(["country"])[columns_old].ffill().loc[mask] + + # Copy v2elfrfair_osp to v2elfrfair_osp_high and v2elfrfair_osp_low + tb["v2elfrfair_osp_high"] = tb["v2elfrfair_osp"].copy() + tb["v2elfrfair_osp_low"] = tb["v2elfrfair_osp"].copy() + return tb + + +def estimate_ex_indicators(tb: Table) -> Table: + """Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years.""" + MASK_PRESIDENTIAL = (tb["v2eltype_6"] == 1) | (tb["v2eltype_7"] == 1) + columns = { + "v2elmulpar_osp": "v2elmulpar_osp_ex", + "v2elmulpar_osp_codehigh": "v2elmulpar_osp_ex_high", + "v2elmulpar_osp_codelow": "v2elmulpar_osp_ex_low", + } + columns_old = list(columns.keys()) + columns_new = list(columns.values()) + tb[columns_new] = tb[columns_old].copy() + tb.loc[~MASK_PRESIDENTIAL, columns_new] = np.nan + + ## Forward fill indicators when there are regularly scheduled national elections on the executive on course, as stipulated by election law or well-established precedent + mask = tb["v2xex_elecreg"] == 1 + tb.loc[mask, columns_new] = tb.groupby(["country"])[columns_new].ffill().loc[mask] + return tb + + +def estimate_leg_indicators(tb: Table) -> Table: + """Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years.""" + ## v2eltype_4 and v2eltype_5 excluded in Marcus Tannenberg and Anna Lührmann's Stata code; included here to align coding with code in V-Dem's data pipeline. + MASK_LEG = (tb["v2eltype_0"] == 1) | (tb["v2eltype_1"] == 1) | (tb["v2eltype_4"] == 1) | (tb["v2eltype_5"] == 1) + columns = { + "v2elmulpar_osp": "v2elmulpar_osp_leg", + "v2elmulpar_osp_codehigh": "v2elmulpar_osp_leg_high", + "v2elmulpar_osp_codelow": "v2elmulpar_osp_leg_low", + } + columns_old = list(columns.keys()) + columns_new = list(columns.values()) + tb[columns_new] = tb[columns_old].copy() + tb.loc[~MASK_LEG, columns_new] = np.nan + + ## Forward fill indicators when there are regularly scheduled national elections on the legislature on course, as stipulated by election law or well-established precedent + mask = tb["v2xlg_elecreg"] == 1 + tb.loc[mask, columns_new] = tb.groupby(["country"])[columns_new].ffill().loc[mask] + return tb + + +def estimate_hos_indicators(tb: Table) -> Table: + """Create indicators for multi-party head of state elections with imputed values between election-years.""" + + def _set_mulpar_hos(tb: Table, column_new: str, column_ex: str, column_leg: str) -> Table: + # Iniitalize new column + tb[column_new] = 0 + tb.loc[tb["v2x_elecreg"].isna(), column_new] = np.nan + # Define mask + mask = ( + # Marcus Tannenberg does not know why electoral regime used as filter instead of relative power of heads of state and government as filter, as above; Anna Lührmann wrote this code. Using electoral regime as filter for this and all following variables yields identical coding. + ( + # If head of state is directly elected, elections for executive must be multi-party. + (tb["v2expathhs"] == 7) & (tb["v2xex_elecreg"] == 1) & (tb[column_ex] > 1) & (tb[column_ex].notna()) + ) + | ( + # If head of state is appointed by legislature, elections for legislature must be multi-party. + (tb["v2expathhs"] == 6) & (tb["v2xlg_elecreg"] == 1) & (tb[column_leg] > 1) & (tb[column_leg].notna()) + ) + | + # It is unclear why v2elmulpar_osp_ex and not v2elmulpar_osp_leg is used, if this is about legislative elections; this seems to be an error, which is why I use the following code instead + ( + # If head of state is appointed otherwise, but approval by the legislature is necessary, elections for legislature must be multi-party. + (tb["v2ex_legconhos"] == 1) + & (tb["v2xlg_elecreg"] == 1) + & (tb[column_leg] > 1) + & (tb[column_leg].notna()) + ) + ) + # Set 1 when mask is True + tb.loc[mask, column_new] = 1 + + return tb + + tb = _set_mulpar_hos(tb, "v2elmulpar_osp_hos", "v2elmulpar_osp_ex", "v2elmulpar_osp_leg") + tb = _set_mulpar_hos(tb, "v2elmulpar_osp_hos_high", "v2elmulpar_osp_ex_high", "v2elmulpar_osp_leg_high") + tb = _set_mulpar_hos(tb, "v2elmulpar_osp_hos_low", "v2elmulpar_osp_ex_low", "v2elmulpar_osp_leg_low") + + return tb + + +def estimate_hog_indicators(tb: Table) -> Table: + """Create indicators for multi-party head of government elections with imputed values between election-years.""" + tb["v2elmulpar_osp_hog"] = 0 + tb.loc[tb["v2x_elecreg"].isna(), "v2elmulpar_osp_hog"] = np.nan + + # Define mask + mask = ( + ( + # If head of government is directly elected, elections for executive must be multi-party + (tb["v2expathhs"] == 8) + & (tb["v2xex_elecreg"] == 1) + & (tb["v2elmulpar_osp_ex"] > 1) + & (tb["v2elmulpar_osp_ex"].notna()) + ) + | ( + # If head of government is appointed by legislature, elections for legislature must be multi-party. + (tb["v2expathhs"] == 7) + & (tb["v2xex_elecreg"] == 1) + & (tb["v2elmulpar_osp_leg"] > 1) + & (tb["v2elmulpar_osp_leg"].notna()) + ) + | ( + # If head of government is appointed by the head of state, elections for the head of state must be multi-party + (tb["v2expathhs"] == 6) & (tb["v2elmulpar_osp_hos"] == 1) + ) + ) + tb.loc[mask, "v2elmulpar_osp_hog"] = 1 + + ## If head of government is appointed otherwise, but approval by the legislature is necessary, elections for legislature must be multi-party + tb.loc[ + (tb["v2ex_legconhog"] == 1) + & (tb["v2xlg_elecreg"] == 1) + & (tb["v2elmulpar_osp_leg"] > 1) + & tb["v2elmulpar_osp_leg"].notna(), + "v2elmulpar_osp_hog", + ] = 1 + + def _set_mulpar_hog(tb: Table, column_new: str, column_ex: str, column_leg: str, column_hos: str) -> Table: + # Iniitalize new column + tb[column_new] = 0 + tb.loc[tb["v2x_elecreg"].isna(), column_new] = np.nan + # Define mask + mask = ( + ( + # If head of government is directly elected, elections for executive must be multi-party. + (tb["v2expathhg"] == 8) & (tb["v2xex_elecreg"] == 1) & (tb[column_ex] > 1) & (tb[column_ex].notna()) + ) + | ( + # If head of government is appointed by legislature, elections for legislature must be multi-party. + (tb["v2expathhs"] == 7) & (tb["v2xlg_elecreg"] == 1) & (tb[column_leg] > 1) & (tb[column_leg].notna()) + ) + | ( + # If head of government is appointed by the head of state, elections for the head of state must be multi-party. + (tb["v2expathhs"] == 6) & (tb[column_hos] == 1) + ) + | + # If head of government is appointed otherwise, but approval by the legislature is necessary, elections for legislature must be multi-party. + ((tb["v2ex_legconhog"] == 1) & (tb["v2xlg_elecreg"] == 1) & (tb[column_leg] > 1) & (tb[column_leg].notna())) + ) + # Set 1 when mask is True + tb.loc[mask, column_new] = 1 + + return tb + + tb = _set_mulpar_hog( + tb, "v2elmulpar_osp_hog_high", "v2elmulpar_osp_ex_high", "v2elmulpar_osp_leg_high", "v2elmulpar_osp_hos_high" + ) + tb = _set_mulpar_hog( + tb, "v2elmulpar_osp_hog_low", "v2elmulpar_osp_ex_low", "v2elmulpar_osp_leg_low", "v2elmulpar_osp_hos_low" + ) + return tb + + +def estimate_exleg_indicators(tb: Table) -> Table: + """Create indicators for multi-party executive and legislative elections with imputed values between election-years.""" + + def _set_mulpar_exleg(tb: Table, column_new: str, column_ex: str, column_leg: str) -> Table: + # Iniitalize new column + tb[column_new] = 0 + tb.loc[tb["v2ex_hosw"].isna(), column_new] = np.nan + + tb.loc[ + (tb["v2xlg_elecreg"] == 1) + & (tb["v2xex_elecreg"] == 1) + & (tb[column_ex] > 1) + & (tb[column_ex].notna()) + & (tb[column_leg] > 1) + & (tb[column_leg].notna()), + column_new, + ] = 1 + return tb + + tb = _set_mulpar_exleg(tb, "v2elmulpar_osp_exleg", "v2elmulpar_osp_ex", "v2elmulpar_osp_leg") + tb = _set_mulpar_exleg(tb, "v2elmulpar_osp_exleg_high", "v2elmulpar_osp_ex_high", "v2elmulpar_osp_leg_high") + tb = _set_mulpar_exleg(tb, "v2elmulpar_osp_exleg_low", "v2elmulpar_osp_ex_low", "v2elmulpar_osp_leg_low") + + return tb + + +def estimate_hoe_indicators(tb: Table) -> Table: + """Create indicator for multi-party head of executive elections with imputed values between election-years.""" + + def _set_mulpar_hoe(tb: Table, column_new: str, column_hos: str, column_hog: str) -> Table: + # Iniitalize new column + tb[column_new] = 0 + tb.loc[tb["v2ex_hosw"].isna(), column_new] = np.nan + + # If head of state is more powerful than head of government, head of state is the head of the executive + tb.loc[(tb["v2ex_hosw"] <= 1) & (tb["v2ex_hosw"] > 0.5), column_new] = tb[column_hos] + # If head of state is as or less powerful than head of government, head of government is the head of the executive + tb.loc[tb["v2ex_hosw"] <= 0.5, column_new] = tb[column_hog] + + # Some values of v2ex_hosw are missing, and using v2exhoshog and v2ex_hogw as well improves coverage; Marcus Lührmann agrees with the addition; I therefore add the next two lines + ## 1st condition: If head of state is also head of government, they are the head of the executive. + ## 2nd condition: If head of government is less powerful than head of state, head of state must be more powerful than head of government. + mask = (tb["v2exhoshog"] == 1) | (tb["v2ex_hogw"] == 0) + tb.loc[mask, column_new] = tb.loc[mask, column_hos] + + return tb + + tb = _set_mulpar_hoe(tb, "v2elmulpar_osp_hoe", "v2elmulpar_osp_hos", "v2elmulpar_osp_hog") + tb = _set_mulpar_hoe(tb, "v2elmulpar_osp_hoe_high", "v2elmulpar_osp_hos_high", "v2elmulpar_osp_hog_high") + tb = _set_mulpar_hoe(tb, "v2elmulpar_osp_hoe_low", "v2elmulpar_osp_hos_low", "v2elmulpar_osp_hog_low") + + return tb + + +def estimate_dichotomous_indicators(tb: Table) -> Table: + """Create dichotomous indicators for classification criteria.""" + + def _set_dich( + tb: Table, + column_new: str, + column_condition: str, + low: Union[float, None] = None, + mid: Union[float, None] = None, + up: Union[float, None] = None, + ) -> Table: + tb[column_new] = np.nan + + if up is not None: + tb.loc[(tb[column_condition] >= low) & (tb[column_condition] <= mid), column_new] = 0 + else: + tb.loc[tb[column_condition] <= mid, column_new] = 0 + + if up is not None: + tb.loc[(tb[column_condition] > mid) & (tb[column_condition] <= up), column_new] = 1 + else: + tb.loc[tb[column_condition] > mid, column_new] = 1 + + return tb + + # relative to V-Dem/RoW, = added to v2elmulpar_osp_leg < 1, even if v2elmulpar_osp_leg != 1 for all observations, for possible future iterations. + tb = _set_dich(tb, "v2x_polyarchy_dich", "v2x_polyarchy", 0, 0.5, 1) + tb = _set_dich(tb, "v2x_polyarchy_high_dich", "v2x_polyarchy_codehigh", 0, 0.5, 1) + tb = _set_dich(tb, "v2x_polyarchy_low_dich", "v2x_polyarchy_codelow", 0, 0.5, 1) + # L215 + tb = _set_dich(tb, "v2elfrfair_osp_dich", "v2elfrfair_osp", 0, 2) + tb = _set_dich(tb, "v2elfrfair_osp_high_dich", "v2elfrfair_osp_high", 0, 2) + tb = _set_dich(tb, "v2elfrfair_osp_low_dich", "v2elfrfair_osp_low", 0, 2) + # L227 + tb = _set_dich(tb, "v2elmulpar_osp_dich", "v2elmulpar_osp", 0, 2) + tb = _set_dich(tb, "v2elmulpar_osp_high_dich", "v2elmulpar_osp_high", 0, 2) + tb = _set_dich(tb, "v2elmulpar_osp_low_dich", "v2elmulpar_osp_low", 0, 2) + # L239 + tb = _set_dich(tb, "v2x_liberal_dich", "v2x_liberal", 0, 0.8, 1) + tb = _set_dich(tb, "v2x_liberal_high_dich", "v2x_liberal_codehigh", 0, 0.8, 1) + tb = _set_dich(tb, "v2x_liberal_low_dich", "v2x_liberal_codelow", 0, 0.8, 1) + # L251 + tb = _set_dich(tb, "v2clacjstm_osp_dich", "v2clacjstm_osp", mid=3) + tb = _set_dich(tb, "v2clacjstm_osp_high_dich", "v2clacjstm_osp_codehigh", mid=3) + tb = _set_dich(tb, "v2clacjstm_osp_low_dich", "v2clacjstm_osp_codelow", mid=3) + # L263 + tb = _set_dich(tb, "v2clacjstw_osp_dich", "v2clacjstw_osp", mid=3) + tb = _set_dich(tb, "v2clacjstw_osp_high_dich", "v2clacjstw_osp_codehigh", mid=3) + tb = _set_dich(tb, "v2clacjstw_osp_low_dich", "v2clacjstw_osp_codelow", mid=3) + # L275 + tb = _set_dich(tb, "v2cltrnslw_osp_dich", "v2cltrnslw_osp", mid=3) + tb = _set_dich(tb, "v2cltrnslw_osp_high_dich", "v2cltrnslw_osp_codehigh", mid=3) + tb = _set_dich(tb, "v2cltrnslw_osp_low_dich", "v2cltrnslw_osp_codelow", mid=3) + # L287: relative to V-Dem/RoW, I added v2elmulpar_osp_leg < ., as otherwise v2elmulpar_osp_leg_dich = 1 if v2elmulpar_osp_leg > 1. + tb = _set_dich(tb, "v2elmulpar_osp_leg_dich", "v2elmulpar_osp_leg", mid=1) + tb = _set_dich(tb, "v2elmulpar_osp_leg_high_dich", "v2elmulpar_osp_leg_high", mid=1) + tb = _set_dich(tb, "v2elmulpar_osp_leg_low_dich", "v2elmulpar_osp_leg_low", mid=1) + return tb + + +def estimate_row_indicators(tb: Table) -> Table: + "Create indicators for Regimes of the World with expanded coverage and minor changes to coding." + column_new = "regime_row_owid" + tb[column_new] = np.nan + + # Replace regime_row_owid based on conditions + tb.loc[ + (tb["v2elfrfair_osp_dich"] == 1) + & (tb["v2elmulpar_osp_dich"] == 1) + & (tb["v2x_polyarchy_dich"] == 1) + & (tb["v2x_liberal_dich"] == 1) + & (tb["v2clacjstm_osp_dich"] == 1) + & (tb["v2clacjstw_osp_dich"] == 1) + & (tb["v2cltrnslw_osp_dich"] == 1), + column_new, + ] = 3 + + tb.loc[ + (tb["v2elfrfair_osp_dich"] == 1) + & (tb["v2elmulpar_osp_dich"] == 1) + & (tb["v2x_polyarchy_dich"] == 1) + & ( + (tb["v2x_liberal_dich"] == 0) + | (tb["v2clacjstm_osp_dich"] == 0) + | (tb["v2clacjstw_osp_dich"] == 0) + | (tb["v2cltrnslw_osp_dich"] == 0) + ), + column_new, + ] = 2 + + tb.loc[ + ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) + & (tb["v2elmulpar_osp_hoe"] == 1) + & (tb["v2elmulpar_osp_leg_dich"] == 1), + column_new, + ] = 1 + + tb.loc[ + ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) + & ((tb["v2elmulpar_osp_hoe"] == 0) | (tb["v2elmulpar_osp_leg_dich"] == 0)), + column_new, + ] = 0 + + # Previous coding rules allow for some observations being coded as electoral democracies even though they have a chief executive who neither meets the criteria for direct or indirect election, nor for being dependent on the legislature. + # I do not change the coding for these observations because I presume that the criteria for electoral democracy overrule the criteria for distinguishing between electoral and closed autocracies. This also means that I cannot use these criteria alone to code some observations for which only v2x_polyarchy_dich is missing. + + # But: if one criteria for electoral democracy is not met, and one criteria for electoral autocracy is not met, this must mean that the country is a closed autocracy: + tb.loc[ + ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) + & ((tb["v2elmulpar_osp_hoe"] == 0) | (tb["v2elmulpar_osp_leg_dich"] == 0)) + & (tb[column_new].isna()), + column_new, + ] = 0 + # This also means that if one criteria for electoral democracy is not met, yet both criteria for an electoral autocracy is met, it must be an electoral autocracy + tb.loc[ + ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) + & (tb["v2elmulpar_osp_hoe"] == 1) + & (tb["v2elmulpar_osp_leg_dich"] == 1) + & (tb[column_new].isna()), + column_new, + ] = 1 + + return tb + + +def compare_with_row_coding(tb: Table) -> Table: + """Compare our and standard RoW coding.""" + # import pandas as pd + # filtered_tb = tb[tb['year'] >= 1900] + # frequency_table = pd.crosstab(index=filtered_tb['regime_row_owid'], columns=filtered_tb['v2x_regime'], dropna=False) + + # 4 Observations are coded differently because v2x_polyarchy in V-Dem's input dataset is barely above 0.5, whereas in the released dataset it is rounded to 0.5 and therefore is not above the coding threshold (conversation with Marcus Tannenberg and Johannes von Römer). + assert ( + tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 2), ["country", "year", "v2x_polyarchy"]].shape[0] + == 4 + ) + tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 2), "regime_row_owid"] = 2 + + # No observations own classification identifies as electoral democracies, whereas RoW identifies them as liberal democracies + assert ( + tb.loc[(tb["regime_row_owid"] == 2) & (tb["v2x_regime"] == 3), ["country", "year", "v2x_polyarchy"]].shape[0] + == 0 + ) + + # 18 observations own classification identifies as closed autocracies, whereas RoW does not provide data + assert ( + tb.loc[ + (tb["regime_row_owid"] == 0) & (tb["v2x_regime"].isna()) & (tb["year"] > 1900), + ["country", "year", "v2x_polyarchy"], + ].shape[0] + == 18 + ) + # Libya in 1911, 1914, and 1922-1933 can be coded because I use information from v2exhoshog in addition to information from v2ex_hosw to identify head of the executive + # Honduras in 1934 and 1935, Kazakhstan in 1990, and Turkmenistan in 1990 can be coded because I use information from the other criteria for democracies and autocracies in the absence of information from v2x_polyarchy + + # 13 observations own classification identifies as electoral autocracies, whereas RoW does not provide data + # tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"].isna() & (tb["year"] > 1900)), ["country", "year", "v2x_polyarchy"]] + # Observations can be coded because I use information from the other criteria for democracies and autocracies in the absence of information from v2x_polyarchy + + # 141 bservations own classification identifies as closed autocracies, whereas RoW identifies them as electoral autocracies + assert tb.loc[(tb["regime_row_owid"] == 0) & (tb["v2x_regime"] == 1), ["country", "year"]].shape[0] == 141 + + # Belgium in 1919 is hard-recoded in RoW code, though Marcus Tannenberg does not know why that happens even if the errors in a previous version of the V-Dem dataset should by now be remedied; it only continues to make a difference for Belgium in 1919; I keep the recode. + # replace regime_row_owid = 1 if country_name == "Belgium" & year == 1919 + tb.loc[(tb["country"] == "Belgium") & (tb["year"] == 1919), "regime_row_owid"] = 1 + + # 111 observations with multi-party elections for legislature and executive (hence the RoW coding); but which had chief executive which were heads of state that were neither directly or indirectly chosen through multiparty elections, nor were they accountable to a legislature chosen through multi-party elections; I therefore do not recode them. + assert ( + tb.loc[ + (tb["regime_row_owid"] < tb["v2x_regime"]) + & (~tb["v2x_regime"].isna()) + & (tb["v2ex_hosw"] <= 1) + & (tb["v2ex_hosw"] > 0.5), + ["country", "year", "v2exnamhos"], + ].shape[0] + == 111 + ) + # Examples include many prominent heads of state which came to office in coup d'etats or rebellions, such as Boumedienne (Algeria 1965), Anez (Bolivia 2019), Buyoya (Burundi 1987), Batista (Cuba 1952), Ankrah (Ghana 1966), Khomeini (Iran 1980), Buhari (Nigeria 1983), Jammeh (The Gambia 1994), and Eyadema (1967 Togo) + + # 8 observations which had multi-party elections for legislature and executive (hence the RoW coding); but which had chief executives which were heads of government that were neither directly or indirectly chosen through multiparty elections, nor were they accountable to a legislature chosen through multi-party elections: + assert ( + tb.loc[ + (tb["regime_row_owid"] == 0) + & (tb["v2x_regime"] == 1) + & (tb["v2elmulpar_osp_exleg"] == 1) + & (tb["v2ex_hosw"] <= 0.5), + ["country", "year", "v2elmulpar_osp_exleg", "v2expathhg", "v2ex_legconhog", "v2expathhs", "v2ex_legconhos"], + ].shape[0] + == 8 + ) + # Examples include prominent heads of government which came to office in a rebellion or were appointed by a foreign power, such as Castro (Cuba 1959) + + # 21 observations coded differently because I use v2ex_legconhog above for consistency, while RoW uses v2exaphogp instead. I defer to RoW coding in these cases. It may be that their data pipeline uses date-specific data which are superior to the year-end data used here. + assert ( + tb.loc[ + (tb["regime_row_owid"] == 0) + & (tb["v2x_regime"] == 1) + & (tb["v2elmulpar_osp_exleg"] == 0) + & (tb["v2ex_hosw"] <= 0.5), + ["country", "year", "v2expathhg", "v2ex_legconhog", "v2exaphogp"], + ].shape[0] + == 21 + ) + tb.loc[ + (tb["regime_row_owid"] == 0) + & (tb["v2x_regime"] == 1) + & (tb["v2elmulpar_osp_exleg"] == 0) + & (tb["v2ex_hosw"] <= 0.5), + "regime_row_owid", + ] = 1 + + # 270 bservations own classification identifies as electoral autocracies, whereas RoW identifies them as closed autocracies: + # tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 0), ["country", "year"]] + + # 180 observations with chief executives that were heads of state directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (2elmulpar_osp_ex instead of v2elmulpar_osp_leg) above: + # tb.loc[ + # (tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 0) & (tb["v2ex_hosw"] <= 1) & (tb["v2ex_hosw"] > 0.5), + # ["country", "year", "v2elmulpar_osp_leg_dich", "v2elmulpar_osp_hoe", "v2elmulpar_osp_ex", "v2elmulpar_osp_leg"], + # ] + + # 90 observations with chief executives that were heads of government directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (v2elmulpar_osp instead of v2xlg_elecreg) above: + # list v2elmulpar_osp_leg v2elmulpar_osp_hoe v2elmulpar_osp v2xlg_elecreg if regime_row_owid == 1 & v2x_regime == 0 & v2ex_hosw <= 0.5 + assert ( + tb.loc[ + (tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 0) & (tb["v2ex_hosw"] <= 0.5), + ["v2elmulpar_osp_leg", "v2elmulpar_osp_hoe", "v2elmulpar_osp", "v2xlg_elecreg"], + ].shape[0] + == 90 + ) + + # 34 observations which RoW identifies as electoral autocracies, but which own classification identifies as missing: + # All observations have missing values for multi-party legislative elections, sometimes also for free and fair as well as multi-party elections in general. One could say that if v2x_elecreg == 0 — or v2eltype_0/1/4/5 are all zero — this means that were no (multi-party legislative) elections - but this would make these regimes closed autocracies, not electoral autociraces. So this better stay as is. + assert ( + tb.loc[ + (tb["regime_row_owid"].isna()) & (tb["v2x_regime"] == 1), + [ + "country", + "year", + "v2x_elecreg", + "v2elfrfair_osp_dich", + "v2elmulpar_osp_dich", + "v2x_polyarchy_dich", + "v2elmulpar_osp_hoe", + "v2elmulpar_osp_leg_dich", + "v2eltype_0", + "v2eltype_1", + "v2eltype_4", + "v2eltype_5", + ], + ].shape[0] + == 34 + ) + + # 5 observation which RoW identifies as closed autocracy, but which own classification identifies as missing: + # Slovakia in 1993 had not held legislative elections yet. This can stay as is. + assert ( + tb.loc[ + (tb["regime_row_owid"].isna()) & (tb["v2x_regime"] == 0), + [ + "country", + "year", + "v2elfrfair_osp_dich", + "v2elmulpar_osp_dich", + "v2x_polyarchy_dich", + "v2elmulpar_osp_hoe", + "v2elmulpar_osp_leg_dich", + ], + ].shape[0] + == 5 + ) + + # 1 observation which RoW identifies as electoral democracy, but which own classification identifies as missing: + # We impute Australia in 1900 in later script. + assert ( + tb.loc[ + (tb["regime_row_owid"].isna()) & (tb["v2x_regime"] == 2), + [ + "country", + "year", + "v2elfrfair_osp_dich", + "v2elmulpar_osp_dich", + "v2x_polyarchy_dich", + "v2x_liberal_dich", + "v2clacjstm_osp_dich", + "v2clacjstw_osp_dich", + "v2cltrnslw_osp_dich", + ], + ].shape[0] + == 1 + ) + + return tb + + +def add_regime_amb_row(tb: Table) -> Table: + """Finalize expanded and refined Regimes of the World indicator with ambiguous categories.""" + tb["regime_amb_row_owid"] = np.nan + + tb.loc[ + (tb["regime_row_owid"] == 3), + "regime_amb_row_owid", + ] = 9 + tb.loc[ + (tb["regime_row_owid"] == 3) + & ( + (tb["v2elfrfair_osp_low_dich"] == 0) + | (tb["v2elmulpar_osp_low_dich"] == 0) + | (tb["v2x_polyarchy_low_dich"] == 0) + | (tb["v2x_liberal_low_dich"] == 0) + | (tb["v2clacjstm_osp_low_dich"] == 0) + | (tb["v2clacjstw_osp_low_dich"] == 0) + | (tb["v2cltrnslw_osp_low_dich"] == 0) + ), + "regime_amb_row_owid", + ] = 8 + tb.loc[ + (tb["regime_row_owid"] == 2), + "regime_amb_row_owid", + ] = 6 + tb.loc[ + (tb["regime_row_owid"] == 2) + & ( + (tb["v2elfrfair_osp_high_dich"] == 1) + & (tb["v2elmulpar_osp_high_dich"] == 1) + & (tb["v2x_polyarchy_high_dich"] == 1) + & (tb["v2x_liberal_high_dich"] == 1) + & (tb["v2clacjstm_osp_high_dich"] == 1) + & (tb["v2clacjstw_osp_high_dich"] == 1) + & (tb["v2cltrnslw_osp_high_dich"] == 1) + ), + "regime_amb_row_owid", + ] = 7 + # replace regime_amb_row_owid = 5 if regime_row_owid == 2 & (v2elfrfair_osp_low_dich == 0 | v2elmulpar_osp_low_dich == 0 | v2x_polyarchy_low_dich == 0) + tb.loc[ + (tb["regime_row_owid"] == 2) + & ( + (tb["v2elfrfair_osp_low_dich"] == 0) + | (tb["v2elmulpar_osp_low_dich"] == 0) + | (tb["v2x_polyarchy_low_dich"] == 0) + ), + "regime_amb_row_owid", + ] = 5 + tb.loc[ + (tb["regime_row_owid"] == 1), + "regime_amb_row_owid", + ] = 3 + tb.loc[ + (tb["regime_row_owid"] == 1) + & ( + (tb["v2elfrfair_osp_high_dich"] == 1) + & (tb["v2elmulpar_osp_high_dich"] == 1) + & (tb["v2x_polyarchy_high_dich"] == 1) + ), + "regime_amb_row_owid", + ] = 4 + tb.loc[ + (tb["regime_row_owid"] == 1) & ((tb["v2elmulpar_osp_hoe_low"] == 0) | (tb["v2elmulpar_osp_leg_low_dich"] == 0)), + "regime_amb_row_owid", + ] = 2 + tb.loc[ + (tb["regime_row_owid"] == 0), + "regime_amb_row_owid", + ] = 0 + tb.loc[ + (tb["regime_row_owid"] == 0) & (tb["v2elmulpar_osp_hoe_high"] == 1) & (tb["v2elmulpar_osp_leg_high_dich"] == 1), + "regime_amb_row_owid", + ] = 1 + + # import pandas as pd + # filtered_tb = tb[tb['year'] >= 1900] + # filtered_tb = tb[(tb['year'] >= 1900) * (tb["regime_row_owid"] == tb["v2x_regime"])] + # frequency_table = pd.crosstab(index=filtered_tb['regime_amb_row_owid'], columns=filtered_tb['v2x_regime_amb'], dropna=False) + return tb + + +def drop_columns(tb: Table) -> Table: + """Drop columns that are not of interest.""" + tb.drop( + columns=[ + "v2x_regime", + "v2x_regime_amb", + "v2x_elecreg", + "v2xex_elecreg", + "v2xlg_elecreg", + "v2eltype_0", + "v2eltype_1", + "v2eltype_2", + "v2eltype_3", + "v2eltype_4", + "v2eltype_5", + "v2eltype_6", + "v2eltype_7", + "v2eltype_8", + "v2eltype_9", + "v2elmulpar_osp", + "v2elfrfair_osp", + "v2elmulpar_osp", + "v2elmulpar_osp_leg", + "v2elfrfair_osp", + "v2exnamhos", + "v2expathhs", + "v2exnamhog", + "v2exaphogp", + "v2expathhg", + "v2ex_legconhog", + "v2ex_legconhos", + "v2elmulpar_osp_ex", + "v2elmulpar_osp_ex", + "v2elmulpar_osp_leg", + "v2elmulpar_osp_hos", + "v2elmulpar_osp_hog", + "v2elmulpar_osp_exleg", + "v2cltrnslw_osp", + "v2clacjstm_osp", + "v2clacjstw_osp", + "v2elmulpar_osp_codehigh", + "v2elmulpar_osp_codelow", + "v2elfrfair_osp_codehigh", + "v2elfrfair_osp_codelow", + "v2elmulpar_osp_high", + "v2elmulpar_osp_low", + "v2elfrfair_osp_high", + "v2elfrfair_osp_low", + "v2elmulpar_osp_ex_high", + "v2elmulpar_osp_ex_high", + "v2elmulpar_osp_ex_low", + "v2elmulpar_osp_ex_low", + "v2elmulpar_osp_leg_high", + "v2elmulpar_osp_leg_high", + "v2elmulpar_osp_leg_low", + "v2elmulpar_osp_leg_low", + "v2elmulpar_osp_hos_high", + "v2elmulpar_osp_hos_low", + "v2elmulpar_osp_hog_high", + "v2elmulpar_osp_hog_low", + "v2elmulpar_osp_exleg_high", + "v2elmulpar_osp_exleg_low", + "v2cltrnslw_osp_codehigh", + "v2cltrnslw_osp_codelow", + "v2clacjstm_osp_codehigh", + "v2clacjstm_osp_codelow", + "v2clacjstw_osp_codehigh", + "v2clacjstw_osp_codelow", + ] + ) + return tb + + +def rename_columns(tb: Table) -> Table: + """Rename variables of interest.""" + tb = tb.rename( + columns={ + "v2x_polyarchy_dich": "electdem_dich_row_owid", # _owid suffix to reflect that I coded the variable slightly differently than Lührmann et al. + "v2x_polyarchy_high_dich": "electdem_dich_high_row_owid", + "v2x_polyarchy_low_dich": "electdem_dich_low_row_owid", + "v2elfrfair_osp_dich": "electfreefair_row", + "v2elfrfair_osp_high_dich": "electfreefair_high_row", + "v2elfrfair_osp_low_dich": "electfreefair_low_row", + "v2elmulpar_osp_dich": "electmulpar_row", + "v2elmulpar_osp_high_dich": "electmulpar_high_row", + "v2elmulpar_osp_low_dich": "electmulpar_low_row", + "v2x_liberal_dich": "lib_dich_row", + "v2x_liberal_high_dich": "lib_dich_high_row", + "v2x_liberal_low_dich": "lib_dich_low_row", + "v2clacjstm_osp_dich": "accessjust_m_row", + "v2clacjstm_osp_high_dich": "accessjust_m_high_row", + "v2clacjstm_osp_low_dich": "accessjust_m_low_row", + "v2clacjstw_osp_dich": "accessjust_w_row", + "v2clacjstw_osp_high_dich": "accessjust_w_high_row", + "v2clacjstw_osp_low_dich": "accessjust_w_low_row", + "v2cltrnslw_osp_dich": "transplaws_row", + "v2cltrnslw_osp_high_dich": "transplaws_high_row", + "v2cltrnslw_osp_low_dich": "transplaws_low_row", + "v2elmulpar_osp_hoe": "electmulpar_hoe_row_owid", # _owid suffix to reflect that I coded the variable slightly differently than Lührmann et al. + "v2elmulpar_osp_hoe_high": "electmulpar_hoe_high_row_owid", + "v2elmulpar_osp_hoe_low": "electmulpar_hoe_low_row_owid", + "v2elmulpar_osp_leg_dich": "electmulpar_leg_row", + "v2elmulpar_osp_leg_high_dich": "electmulpar_leg_high_row", + "v2elmulpar_osp_leg_low_dich": "electmulpar_leg_low_row", + "v2x_polyarchy": "electdem_vdem", + "v2x_polyarchy_codelow": "electdem_vdem_low", + "v2x_polyarchy_codehigh": "electdem_vdem_high", + "v2x_elecoff": "electoff_vdem", + "v2xel_frefair": "electfreefair_vdem", + "v2xel_frefair_codelow": "electfreefair_vdem_low", + "v2xel_frefair_codehigh": "electfreefair_vdem_high", + "v2x_frassoc_thick": "freeassoc_vdem", + "v2x_frassoc_thick_codelow": "freeassoc_vdem_low", + "v2x_frassoc_thick_codehigh": "freeassoc_vdem_high", + "v2x_suffr": "suffr_vdem", + "v2x_freexp_altinf": "freeexpr_vdem", + "v2x_freexp_altinf_codelow": "freeexpr_vdem_low", + "v2x_freexp_altinf_codehigh": "freeexpr_vdem_high", + "v2x_libdem": "libdem_vdem", + "v2x_libdem_codelow": "libdem_vdem_low", + "v2x_libdem_codehigh": "libdem_vdem_high", + "v2x_liberal": "lib_vdem", + "v2x_liberal_codelow": "lib_vdem_low", + "v2x_liberal_codehigh": "lib_vdem_high", + "v2xcl_rol": "indiv_libs_vdem", + "v2xcl_rol_codelow": "indiv_libs_vdem_low", + "v2xcl_rol_codehigh": "indiv_libs_vdem_high", + "v2x_jucon": "judicial_constr_vdem", + "v2x_jucon_codelow": "judicial_constr_vdem_low", + "v2x_jucon_codehigh": "judicial_constr_vdem_high", + "v2xlg_legcon": "legis_constr_vdem", + "v2xlg_legcon_codelow": "legis_constr_vdem_low", + "v2xlg_legcon_codehigh": "legis_constr_vdem_high", + "v2x_partipdem": "participdem_vdem", + "v2x_partipdem_codelow": "participdem_vdem_low", + "v2x_partipdem_codehigh": "participdem_vdem_high", + "v2x_partip": "particip_vdem", + "v2x_partip_codelow": "particip_vdem_low", + "v2x_partip_codehigh": "particip_vdem_high", + "v2x_cspart": "civsoc_particip_vdem", + "v2x_cspart_codelow": "civsoc_particip_vdem_low", + "v2x_cspart_codehigh": "civsoc_particip_vdem_high", + "v2xdd_dd": "dirpop_vote_vdem", + "v2xel_locelec": "locelect_vdem", + "v2xel_locelec_codelow": "locelect_vdem_low", + "v2xel_locelec_codehigh": "locelect_vdem_high", + "v2xel_regelec": "regelect_vdem", + "v2xel_regelec_codelow": "regelect_vdem_low", + "v2xel_regelec_codehigh": "regelect_vdem_high", + "v2x_delibdem": "delibdem_vdem", + "v2x_delibdem_codelow": "delibdem_vdem_low", + "v2x_delibdem_codehigh": "delibdem_vdem_high", + "v2xdl_delib": "delib_vdem", + "v2xdl_delib_codelow": "delib_vdem_low", + "v2xdl_delib_codehigh": "delib_vdem_high", + "v2dlreason": "justified_polch_vdem", + "v2dlreason_codelow": "justified_polch_vdem_low", + "v2dlreason_codehigh": "justified_polch_vdem_high", + "v2dlcommon": "justcomgd_polch_vdem", + "v2dlcommon_codelow": "justcomgd_polch_vdem_low", + "v2dlcommon_codehigh": "justcomgd_polch_vdem_high", + "v2dlcountr": "counterarg_polch_vdem", + "v2dlcountr_codelow": "counterarg_polch_vdem_low", + "v2dlcountr_codehigh": "counterarg_polch_vdem_high", + "v2dlconslt": "elitecons_polch_vdem", + "v2dlconslt_codelow": "elitecons_polch_vdem_low", + "v2dlconslt_codehigh": "elitecons_polch_vdem_high", + "v2dlengage": "soccons_polch_vdem", + "v2dlengage_codelow": "soccons_polch_vdem_low", + "v2dlengage_codehigh": "soccons_polch_vdem_high", + "v2x_egaldem": "egaldem_vdem", + "v2x_egaldem_codelow": "egaldem_vdem_low", + "v2x_egaldem_codehigh": "egaldem_vdem_high", + "v2x_egal": "egal_vdem", + "v2x_egal_codelow": "egal_vdem_low", + "v2x_egal_codehigh": "egal_vdem_high", + "v2xeg_eqprotec": "equal_rights_vdem", + "v2xeg_eqprotec_codelow": "equal_rights_vdem_low", + "v2xeg_eqprotec_codehigh": "equal_rights_vdem_high", + "v2xeg_eqaccess": "equal_access_vdem", + "v2xeg_eqaccess_codelow": "equal_access_vdem_low", + "v2xeg_eqaccess_codehigh": "equal_access_vdem_high", + "v2xeg_eqdr": "equal_res_vdem", + "v2xeg_eqdr_codelow": "equal_res_vdem_low", + "v2xeg_eqdr_codehigh": "equal_res_vdem_high", + "v2x_civlib": "civ_libs_vdem", + "v2x_civlib_codelow": "civ_libs_vdem_low", + "v2x_civlib_codehigh": "civ_libs_vdem_high", + "v2x_clphy": "phys_integr_libs_vdem", + "v2x_clphy_codehigh": "phys_integr_libs_vdem_high", + "v2x_clphy_codelow": "phys_integr_libs_vdem_low", + "v2x_clpol": "pol_libs_vdem", + "v2x_clpol_codehigh": "pol_libs_vdem_high", + "v2x_clpol_codelow": "pol_libs_vdem_low", + "v2x_clpriv": "priv_libs_vdem", + "v2x_clpriv_codehigh": "priv_libs_vdem_high", + "v2x_clpriv_codelow": "priv_libs_vdem_low", + "v2x_gender": "wom_emp_vdem", + "v2x_gender_codehigh": "wom_emp_vdem_high", + "v2x_gender_codelow": "wom_emp_vdem_low", + "v2x_gencl": "wom_civ_libs_vdem", + "v2x_gencl_codehigh": "wom_civ_libs_vdem_high", + "v2x_gencl_codelow": "wom_civ_libs_vdem_low", + "v2x_gencs": "wom_civ_soc_vdem", + "v2x_gencs_codehigh": "wom_civ_soc_vdem_high", + "v2x_gencs_codelow": "wom_civ_soc_vdem_low", + "v2x_genpp": "wom_pol_par_vdem", + "v2x_genpp_codehigh": "wom_pol_par_vdem_high", + "v2x_genpp_codelow": "wom_pol_par_vdem_low", + "v2lgfemleg": "wom_parl_vdem", + "v2exfemhos": "wom_hos_vdem", + "v2exfemhog": "wom_hog_vdem", + "v2clsocgrp": "socgr_civ_libs_vdem", + "v2clsocgrp_codehigh": "socgr_civ_libs_vdem_high", + "v2clsocgrp_codelow": "socgr_civ_libs_vdem_low", + "v2pepwrsoc": "socgr_pow_vdem", + "v2pepwrsoc_codehigh": "socgr_pow_vdem_high", + "v2pepwrsoc_codelow": "socgr_pow_vdem_low", + "v2svstterr": "terr_contr_vdem", + "v2svstterr_codehigh": "terr_contr_vdem_high", + "v2svstterr_codelow": "terr_contr_vdem_low", + "v2x_rule": "rule_of_law_vdem", + "v2x_rule_codehigh": "rule_of_law_vdem_high", + "v2x_rule_codelow": "rule_of_law_vdem_low", + "v2clrspct": "public_admin_vdem", + "v2clrspct_codehigh": "public_admin_vdem_high", + "v2clrspct_codelow": "public_admin_vdem_low", + "v2svinlaut": "int_auton_vdem", + "v2svinlaut_codehigh": "int_auton_vdem_high", + "v2svinlaut_codelow": "int_auton_vdem_low", + "v2svdomaut": "dom_auton_vdem", + "v2svdomaut_codehigh": "dom_auton_vdem_high", + "v2svdomaut_codelow": "dom_auton_vdem_low", + "v2x_corr": "corruption_vdem", + "v2x_corr_codehigh": "corruption_vdem_high", + "v2x_corr_codelow": "corruption_vdem_low", + "v2x_pubcorr": "corr_publsec_vdem", + "v2x_pubcorr_codehigh": "corr_publsec_vdem_high", + "v2x_pubcorr_codelow": "corr_publsec_vdem_low", + "v2x_execorr": "corr_exec_vdem", + "v2x_execorr_codehigh": "corr_exec_vdem_high", + "v2x_execorr_codelow": "corr_exec_vdem_low", + "v2lgcrrpt": "corr_leg_vdem", + "v2lgcrrpt_codehigh": "corr_leg_vdem_high", + "v2lgcrrpt_codelow": "corr_leg_vdem_low", + "v2jucorrdc": "corr_jud_vdem", + "v2jucorrdc_codehigh": "corr_jud_vdem_high", + "v2jucorrdc_codelow": "corr_jud_vdem_low", + "e_ti_cpi": "corruption_cpi", + "v2xnp_pres": "personalism_vdem", + "v2xnp_pres_codehigh": "personalism_vdem_high", + "v2xnp_pres_codelow": "personalism_vdem_low", + "v2xcs_ccsi": "civ_soc_str_vdem", + "v2xcs_ccsi_codehigh": "civ_soc_str_vdem_high", + "v2xcs_ccsi_codelow": "civ_soc_str_vdem_low", + "v2eltrnout": "turnout_vdem", + "e_wbgi_gee": "goveffective_vdem_wbgi", + } + ) + return tb + + +def standardise_country_names(tb: Table) -> Table: + """Standardise country names. + + TODO: This should be done by standard function! + """ + # Replace values in 'country_name' column based on conditions + tb["country"] = tb["country"].replace( + { + "Burma/Myanmar": "Myanmar", + "Democratic Republic of the Congo": "Democratic Republic of Congo", + "Ivory Coast": "Cote d'Ivoire", + "Republic of the Congo": "Congo", + "The Gambia": "Gambia", + "Palestine/British Mandate": "Palestine", + "Timor-Leste": "East Timor", + "United States of America": "United States", + "Würtemberg": "Kingdom of Wurttemberg", + "Czech Republic": "Czechia", + "German Democratic Republic": "East Germany", + "Hesse-Kassel": "Hesse Electoral", + "Hesse-Darmstadt": "Hesse Grand Ducal", + "South Yemen": "Yemen People's Republic", + # Nassau? + } + ) + return tb + + +def estimate_gender_hoe_indicator(tb: Table) -> Table: + """Create variable identifying gender of chief executive.""" + tb["wom_hoe_vdem"] = np.nan + # # If head of state is more powerful than head of government, and head of state is the head of the executive, then update wom_hoe_vdem accordingly + tb.loc[(tb["v2ex_hosw"] <= 1) & (tb["v2ex_hosw"] > 0.5) & (tb["wom_hos_vdem"].notna()), "wom_hoe_vdem"] = tb[ + "wom_hos_vdem" + ] + # Update wom_hoe_vdem based on the power of head of state relative to head of government + tb.loc[(tb["v2ex_hosw"] <= 0.5) & (tb["wom_hog_vdem"].notna()), "wom_hoe_vdem"] = tb["wom_hog_vdem"] + # If head of state is also head of government, they are the head of the executive. + tb.loc[(tb["v2exhoshog"] == 1) & (tb["wom_hos_vdem"].notna()), "wom_hoe_vdem"] = tb["wom_hos_vdem"] + # If head of government is less powerful than head of state, head of state must be more powerful than head of government. + tb.loc[(tb["v2ex_hogw"] == 0) & (tb["wom_hos_vdem"].notna()), "wom_hoe_vdem"] = tb["wom_hos_vdem"] + + # Drop columns + tb = tb.drop( + columns=[ + "v2ex_hosw", + "v2ex_hogw", + ] + ) + return tb From 0967d6e4d9ef7202bc8c6e3beaabd1ddd99e9567 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 20 Mar 2024 17:41:45 +0100 Subject: [PATCH 12/62] wip --- .../garden/democracy/2024-03-07/vdem/__init__.py | 12 +++++++++--- .../garden/democracy/2024-03-07/vdem/vdem_clean.py | 13 +++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 36c78aeb0e5..7a3f49c9eeb 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -1,5 +1,6 @@ """Load a meadow dataset and create a garden dataset.""" +from copy import deepcopy from typing import cast import vdem_clean as clean # VDEM's cleaning library @@ -41,6 +42,9 @@ def run(dest_dir: str) -> None: # Sort tb = tb.sort_values(["country", "year"]) + # %% Copy origins (some indicators will loose their 'origins' in metadata) + origins = deepcopy(tb["country"].metadata.origins) + # (L76-L94) Create expanded and refined Regimes of the World indicator # %% Create indicators for multi-party elections, and free and fair elections tb = clean.estimate_mulpar_indicators(tb) @@ -94,6 +98,11 @@ def run(dest_dir: str) -> None: tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] tb = tb.drop(columns=["v2exhoshog"]) + # %% Bring origins back + columns = [col for col in tb.columns if col not in ["country", "year"]] + for col in columns: + tb[col].metadata.origins = origins + # %% Proceed # Harmonize country names tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) @@ -101,9 +110,6 @@ def run(dest_dir: str) -> None: # Set index tb = tb.set_index(["country", "year"], verify_integrity=True) - # Dtypes - tb = tb.astype(dtype={"v2exnamhos": "string"}) - # %% Save # # Save outputs. diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index 666695045ce..2d33cde799f 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -53,17 +53,18 @@ def estimate_mulpar_indicators(tb: Table) -> Table: "v2elmulpar_osp_codelow": "v2elmulpar_osp_low", # Create indicators for free and fair elections with imputed values between election-years "v2elfrfair_osp": "v2elfrfair_osp", + "v2elfrfair_osp_codehigh": "v2elfrfair_osp_high", + "v2elfrfair_osp_codelow": "v2elfrfair_osp_low", } columns_old = list(columns.keys()) columns_new = list(columns.values()) ## Forward fill indicators when there are regularly scheduled national elections on course, as stipulated by election law or well-established precedent mask = tb["v2x_elecreg"] == 1 - tb.loc[mask, columns_new] = tb.groupby(["country"])[columns_old].ffill().loc[mask] - - # Copy v2elfrfair_osp to v2elfrfair_osp_high and v2elfrfair_osp_low - tb["v2elfrfair_osp_high"] = tb["v2elfrfair_osp"].copy() - tb["v2elfrfair_osp_low"] = tb["v2elfrfair_osp"].copy() + tb[columns_new] = tb[columns_old].copy() + tb.loc[mask, columns_new] = tb.groupby(["country"])[columns_new].ffill().loc[mask] + # condition = (tb['v2x_elecreg'] == 1) & (tb['v2elmulpar_osp_imp'].isna()) + # tb.loc[:, columns_new] = tb.groupby(["country"])[columns_old].transform(lambda x: x.ffill().where(x.bfill().eq(1))) return tb @@ -650,7 +651,7 @@ def add_regime_amb_row(tb: Table) -> Table: def drop_columns(tb: Table) -> Table: """Drop columns that are not of interest.""" - tb.drop( + tb = tb.drop( columns=[ "v2x_regime", "v2x_regime_amb", From f9ba671e8753862548901a3ac5b06c6b3932278b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 20 Mar 2024 19:13:33 +0100 Subject: [PATCH 13/62] wip: impute --- .../democracy/2024-03-07/vdem/__init__.py | 87 ++++-- .../2024-03-07/vdem/countries_impute.yml | 285 ++++++++++++++++++ .../democracy/2024-03-07/vdem/vdem_impute.py | 31 ++ 3 files changed, 370 insertions(+), 33 deletions(-) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 7a3f49c9eeb..d13e81aeb1b 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -4,6 +4,7 @@ from typing import cast import vdem_clean as clean # VDEM's cleaning library +import vdem_impute as impute # VDEM's imputing library from owid.catalog import Table from etl.data_helpers import geo @@ -14,7 +15,7 @@ def run(dest_dir: str) -> None: - # %% Intro + # %% Intro 1 # # Load inputs. # @@ -30,6 +31,7 @@ def run(dest_dir: str) -> None: } ) + # %% Intro 2 # # Process data. # @@ -39,38 +41,37 @@ def run(dest_dir: str) -> None: # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. tb = clean.clean_female_flag(tb) + # Harmonize country names + tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) + # Sort tb = tb.sort_values(["country", "year"]) - # %% Copy origins (some indicators will loose their 'origins' in metadata) + # %% PART 1: CLEAN + # The following lines (until "PART 2") are the cleaning steps. + # This is a transcription from Bastian's work: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_clean.do + + # Copy origins (some indicators will loose their 'origins' in metadata) origins = deepcopy(tb["country"].metadata.origins) - # (L76-L94) Create expanded and refined Regimes of the World indicator - # %% Create indicators for multi-party elections, and free and fair elections + # %% Create expanded and refined Regimes of the World indicator + # (L76-L94) Create indicators for multi-party elections, and free and fair elections tb = clean.estimate_mulpar_indicators(tb) - - # %% (L96-L109) Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years: + # (L96-L109) Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years: tb = clean.estimate_ex_indicators(tb) - - # %% (L109-L122) Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years + # (L109-L122) Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years tb = clean.estimate_leg_indicators(tb) - - # %% (L122-L141) Create indicators for multi-party head of state elections with imputed values between election-years + # (L122-L141) Create indicators for multi-party head of state elections with imputed values between election-years tb = clean.estimate_hos_indicators(tb) - - # %% (L141-L167) Create indicators for multi-party head of government elections with imputed values between election-years + # (L141-L167) Create indicators for multi-party head of government elections with imputed values between election-years tb = clean.estimate_hog_indicators(tb) - - # %% (L167-L175) Create indicators for multi-party executive and legislative elections with imputed values between election-years + # (L167-L175) Create indicators for multi-party executive and legislative elections with imputed values between election-years tb = clean.estimate_exleg_indicators(tb) - - # %% (L177-L201) Create indicator for multi-party head of executive elections with imputed values between election-years + # (L177-L201) Create indicator for multi-party head of executive elections with imputed values between election-years tb = clean.estimate_hoe_indicators(tb) - - # %% (L202-L300) Create dichotomous indicators for classification criteria + # (L202-L300) Create dichotomous indicators for classification criteria tb = clean.estimate_dichotomous_indicators(tb) - - # %% (L302-L314) Create indicators for Regimes of the World with expanded coverage and minor changes to coding + # (L302-L314) Create indicators for Regimes of the World with expanded coverage and minor changes to coding tb = clean.estimate_row_indicators(tb) # %% (L322-L389) Compare our and standard RoW coding @@ -78,23 +79,22 @@ def run(dest_dir: str) -> None: # %% (L389-L401) Finalize expanded and refined Regimes of the World indicator with ambiguous categories tb = clean.add_regime_amb_row(tb) - - # %% (L416) Drop irrelevant columns now - tb = clean.drop_columns(tb) - - # %% (L419-L424) Create reduced version of political regimes, only distinguishing between closed autocracies, electoral autocracies, and electoral democracies (including liberal democracies) + # (L419-L424) Create reduced version of political regimes, only distinguishing between closed autocracies, electoral autocracies, and electoral democracies (including liberal democracies) tb["regime_redux_row"] = tb["regime_row_owid"].replace({3: 2}) - # %% (L427-L669) Rename columns of interest + # %% Drop and rename columns + # (L416) Drop irrelevant columns now + tb = clean.drop_columns(tb) + # (L427-L669) Rename columns of interest tb = clean.rename_columns(tb) # %% Ratio as share (share of adult citizens with vote right) tb["suffr_vdem"] = tb["suffr_vdem"] * 100 - # %% Create variable identifying gender of chief executive + # %% Gender indicators + # Create variable identifying gender of chief executive tb = clean.estimate_gender_hoe_indicator(tb) - - # %% Estimate gender of HOG + # Estimate gender of HOG tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] tb = tb.drop(columns=["v2exhoshog"]) @@ -103,11 +103,32 @@ def run(dest_dir: str) -> None: for col in columns: tb[col].metadata.origins = origins - # %% Proceed - # Harmonize country names - tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) + # %% PART 2: IMPUTE + # The following lines concern imputing steps. + # Equivalent to: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do - # Set index + # %% Proceed + # Expand to have observations for all years and countries + # Indicator `vdem_obs` is created to flag the original observations (though they can easily be identified by the non-missing values in the other columns) + # tb = impute.expand_observations(tb) + + # %% Impute values from adjacent years + # Conditions for Australia and the year 1900 + condition_australia_1900 = (tb["country"] == "Australia") & (tb["year"] == 1900) + # Perform replacements (is this just based on 1899?) + tb.loc[condition_australia_1900, "regime_row_owid"] = 3 + tb.loc[condition_australia_1900, "regime_redux_row"] = 2 + tb.loc[condition_australia_1900, "regime_amb_row_owid"] = 8 + + # The following are other candidates, but we discarded them because there are too many years missing. + # - Honduras 1922-1933 (12 years missing) + # I favor no imputation because of 12 years of missing data, and the country may have met the criteria for democracy. + # - Peru 1886-1891 (6 years missing) + # I favor no imputation because of six years of missing data, and even though one criterion for electoral autocracy is not met, the country may have met the criteria for democracy (if unlikely), thereby overriding the former. + + # %% + + # %% Set index tb = tb.set_index(["country", "year"], verify_integrity=True) # %% Save diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml new file mode 100644 index 00000000000..e1b5b5c962b --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -0,0 +1,285 @@ +# List specifying how to impute specific country. +# +# As an example: +# +# - country: Panama +# country_impute: Colombia +# year_min: 1832 +# year_max: 1902 +# +# This means that we want to inherit the classifications for Panama from Colombia between 1832 and 1902. +# +# We note that `country` can also be a list of countries. + + +# BANGLADESH (1945-1948) +## 1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0) +- country: Bangladesh + country_impute: Pakistan + year_min: 1947 + year_max: 1970 +## 1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016) +- country: Bangladesh + country_impute: Pakistan + year_min: 1789 + year_max: 1946 + +# UKRAINE (1789-1989) +## 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). +- country: Ukraine + country_impute: Russia + year_min: 1946 + year_max: 1989 + +# PAKISTAN (1789-1946) +## 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) +- country: Pakistan + country_impute: India + year_min: 1947 + year_max: 1970 + +# POLAND +## Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); [I favor no imputation]. + +# ITALY (1789-1860) +## 1814-1860 part of Austria-Hungary (Wimmer and Min 2006) [No imputation] +## 1815-1860 part of Piedmont-Sardinia (Butcher and Griffiths 2020) +- country: Italy + country_impute: Piedmont-Sardinia + year_min: 1815 + year_max: 1860 + +# NIGERIA (1789-1913) +## 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); [I favor no imputation]. + +# VIETNAM (1789-1944) +## 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); [I favor no imputation]. + +# UZBEKISTAN (1789-1911, 1921-1989) +## 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. +- country: Uzbekistan + country_impute: Russia + year_min: 1865 + year_max: 1911 +- country: Uzbekistan + country_impute: Russia + year_min: 1921 + year_max: 1989 + +# KAZAKHSTAN (1789-1989) +## 1730-1990 imperial power Russia (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). +- country: Kazakhstan + country_impute: Russia + year_min: 1730 + year_max: 1990 + +# MOZAMBIQUE (1789-1899, 1974-1993) +## imperial power Portugal 1885-1974 (Wimmer and Min 2006); colony of Portugal 1886-1975 (Cshapes 2.0), colonized by Portugal, approximated as 1750 (Ertan et al. 2016); [I favor no imputation]. + +# CZECHIA (1789-1917) +## Imperial power Austria-Hungary 16th century-1917 (Wimmer and Min 2006), part of Austria-Hungary since at least 1886 (Cshapes 2.0), Czech part under Austrian control (Encyclopedia Britannica). +- country: Czechia + country_impute: Austria + year_min: 1789 + year_max: 1917 + +# IRAN (1789-1899) +## no imperial onset (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), not colonized (Ertan et al. 2016); [I favor no imputation]. + +# BELARUS (1789-1989) +## imperial power Russia 1795-1990 (Wimmer and Min 2006); 1886-1991 part of Russia (Cshapes 2.0), not mentioned in Ertan et al. (2016), independent since 1991 (Butcher and Griffiths 2020). +- country: Belarus + country_impute: Russia + year_min: 1795 + year_max: 1989 + +# DEMOCRATIC REPUBLIC OF CONGO (1789-1899) +## imperial power Belgium 1885-1959 (Wimmer and Min 2006), colonized in 1885 (Ertan et al. 2016); [I favor no imputation]. + +# NORTH KOREA (1789-1944) +## Korea since the 14th century until 1909, imperial power Japan 1910-1944 (Wimmer and Min 2006), independent Korea since at least 1886-1910, colony of Japan -1945 (Cshapes 2.0), not listed (Ertan et al. 2016) +- country: North Korea + country_impute: Korea + year_min: 1789 + year_max: 1910 + +# SUDAN (1789-1899) +## Egypt imperial power 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955 (CShapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020); in 1886, colony Egypt of United Kingdom covers little of today's Sudan (CShapes 2.0); Egypt invades Sudanese territory in 1820, indigenous forces surrender in 1821, Mahdists capture Khartoum from Egypt and the British in 1885 (Encyclopedia Britannica). +- country: Sudan + country_impute: Egypt + year_min: 1821 + year_max: 1884 + +# SOUTH SUDAN (1789-2010) +## not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). +- country: South Sudan + country_impute: Egypt + year_min: 1821 + year_max: 1884 +- country: South Sudan + country_impute: Sudan + year_min: 1900 + year_max: 2010 + +# IRELAND (1789-1918) +## imperial power United Kingdom 11th century-1919 (Wimmer and Min 2006), part of United Kingdom since at least 1886-1922, independent since 1922 (Butcher and Griffiths 2020). +- country: Ireland + country_impute: United Kingdom + year_min: 1789 + year_max: 1918 + +# AZERBAIJAN (1789-1989) +## imperial power Russia 1813-1917, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0) not colonized (Ertan et al. 2016). +- country: Azerbaijan + country_impute: Russia + year_min: 1813 + year_max: 1989 + + + + + + + + +# Federal Republic of Central America +- country: + - Guatemala + - Honduras + - El Salvador + - Nicaragua + - Costa Rica + country_impute: Federal Republic of Central America + year_min: 1824 + year_max: 1838 + + +# Czechoslovakia +- country: + - Slovakia + - Czechia + country_impute: Czechoslovakia + year_min: 1918 + year_max: 1992 +# Korea +## Korea from Japan Colonisation (1910 - 1945)? +- country: + - South Korea + - North Korea + country_impute: Korea (former) + year_min: 1800 + year_max: 1910 +# Great Colombia +- country: + - Venezuela + - Ecuador + - Panama + - Colombia + country_impute: Great Colombia + year_min: 1821 + year_max: 1830 +# Colombia +- country: Panama + country_impute: Colombia + year_min: 1832 + year_max: 1902 +# Yugoslavia +- country: + - Slovenia + - Croatia + - Montenegro + - Serbia + - Bosnia and Herzegovina + - Kosovo + - North Macedonia + country_impute: Yugoslavia + year_min: 1921 + year_max: 1990 +# Serbia and Montenegro +- country: + - Serbia + - Montenegro + - Kosovo + country_impute: Serbia and Montenegro + year_min: 1991 + year_max: 2005 +# Serbia (with Kosovo) +- country: Kosovo + country_impute: Serbia + year_min: 2006 + year_max: 2011 +# USSR +- country: Russia + country_impute: USSR + year_min: 1922 + year_max: 1991 +- country: + - Ukraine + - Belarus + - Azerbaijan + - Armenia + - Georgia + - Turkmenistan + - Uzbekistan + - Kazakhstan + - Tajikistan + - Kyrgyzstan + country_impute: USSR + year_min: 1922 + year_max: 1991 +- country: + - Lithuania + - Latvia + - Estonia + country_impute: USSR + year_min: 1941 + year_max: 1991 +- country: Moldova + country_impute: USSR + year_min: 1940 + year_max: 1991 + +# Russian Empire +- country: + - Belarus + - Georgia + - Turkmenistan + - Kazakhstan + country_impute: Russia + year_min: 1800 + year_max: 1921 +- country: Tajikistan + country_impute: Russia + year_min: 1868 + year_max: 1921 +- country: Kyrgyzstan + country_impute: Russia + year_min: 1868 + year_max: 1921 +- country: Uzbekistan + country_impute: Russia + year_min: 1865 + year_max: 1911 +- country: Moldova + country_impute: Russia + year_min: 1800 + year_max: 1919 +- country: Azerbaijan + country_impute: Russia + year_min: 1813 + year_max: 1921 + +# Ethopia +- country: + - Eritrea + - Ethiopia + country_impute: Ethiopia (former) + year_min: 1952 + year_max: 1992 +# Pakistan +- country: + - Pakistan + - Bangladesh + country_impute: Pakistan (former) + year_min: 1947 + year_max: 1971 diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py new file mode 100644 index 00000000000..1a42c2bdd97 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -0,0 +1,31 @@ +import numpy as np +import pandas as pd +from owid.catalog import Table + + +def expand_observations(tb: Table) -> Table: + """Expand to have a row per (year, country).""" + # Column for index + column_idx = ["country", "year"] + + # List of countries + regions = set(tb["country"]) + + # List of possible years + years = np.arange(tb["year"].min(), tb["year"].max() + 1) + + # New index + new_idx = pd.MultiIndex.from_product([regions, years], names=column_idx) + + # Add flag + tb["vdem_obs"] = 1 + + # Reset index + tb = tb.set_index(column_idx, verify_integrity=True).reindex(new_idx).sort_index().reset_index() + + # Update flag + tb["vdem_obs"] = tb["vdem_obs"].fillna(0) + + # Type of `year` + tb["year"] = tb["year"].astype("int") + return tb From bd7181e7830be973381fa95555f71ca1c9233d1b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 21 Mar 2024 15:34:50 +0100 Subject: [PATCH 14/62] wip --- .../2024-03-07/vdem/countries_impute.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml index e1b5b5c962b..9c0f5db014c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -135,12 +135,39 @@ year_min: 1813 year_max: 1989 +# ROMANIA (1789-1830, 1854-1856, 1859-1899) +## 1688-1858 imperial power Austria-Hungary (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), independent since 1878 (Butcher and Griffiths 2020), Transylvania part of Austria-Hungary, other parts under Ottoman influence; [I favor no imputation]. + +# AUSTRIA (1939-1944) +## 1938-1944 imperial power Germany (Wimmer and Min 2006), independent 1939-1944 (CShapes 2.0), independent 1918-1938 (Butcher and Griffiths 2020); [I favor no imputation]. + +# PHILIPPINES (1789-1899) +## imperial power Spain 16th century-1898, United States 1899-1945 (Wimmer and Min 2006), colony of Spain since at least 1886-1898, colony of United States 1899-1946 (Cshapes 2.0); [I favor no imputation]. + +# GREECE (1789-1821) +## imperial power Turkey 15th century - 1826, independent 1918-1919 (Wimmer and Min 2006, Cshapes 2.0); independent from 1828 to 1941 (Butcher and Griffiths 2020). +- country: Greece + country_impute: Turkey + year_min: 1789 + year_max: 1821 + +# TANZANIA (1789-1914) +## imperial power/colonized by Germany and United Kingdom (Wimmer and Min 2006, Cshapes 2.0); [I favor no imputation]. + +## GEORGIA (1789-1989) +## imperial power Russia 1801-1918, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991, not colonized (Ertan et al. 2016), independent since 1991 (Butcher and Griffiths 2020). +- country: Georgia + country_impute: Russia + year_min: 1801 + year_max: 1989 + +####################################### # Federal Republic of Central America - country: From e8019081b8b193697c34389ef86efe4517064b4e Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 21 Mar 2024 16:08:18 +0100 Subject: [PATCH 15/62] wip --- .../2024-03-07/vdem/countries_impute.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml index 9c0f5db014c..a3d128e0d01 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -162,6 +162,28 @@ year_max: 1989 +# * Slovakia 1789-1992: imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). +# replace country_name_regime_imputed = "Hungary" if country_name == "Slovakia" & year >= 1789 & year <= 1918 +# replace country_name_regime_imputed = "Czechia" if country_name == "Slovakia" & year >= 1919 & year <= 1992 +# * South Africa 1789-1899: imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); I favor no imputation. +# * Cameroon 1789-1960: imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); I favor no imputation. +# * Tajikistan 1789-1989: imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). +# replace country_name_regime_imputed = "Russia" if country_name == "Tajikistan" & year >= 1868 & year <= 1989 +# * Palestine 1949-2019: no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; I therefore favor no imputation. +# * Brazil 1824-1825: independent since 1822 (Wimmer and Min 2006, Butcher and Griffiths 2020); I favor no imputation. +# * Serbia 1789-1833, 1932-1934: imperial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); I favor no imputation for later period. +# replace country_name_regime_imputed = "Turkey" if country_name == "Serbia" & year >= 1789 & year <= 1833 + +# SLOVAKIA (1789-1992) +## imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). +- country: Slovakia + country_impute: Austria-Hungary + year_min: 1789 + year_max: 1918 +- country: Slovakia + country_impute: Czechia + year_min: 1919 + year_max: 1992 From 353548c0245797cc05528a46e28c463e53947767 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 21 Mar 2024 17:13:00 +0100 Subject: [PATCH 16/62] wip --- .../2024-03-07/vdem/countries_impute.yml | 139 ++++++++++++------ 1 file changed, 93 insertions(+), 46 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml index a3d128e0d01..fd4ee70cb45 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -13,58 +13,70 @@ # BANGLADESH (1945-1948) -## 1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0) - country: Bangladesh - country_impute: Pakistan - year_min: 1947 - year_max: 1970 -## 1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016) -- country: Bangladesh - country_impute: Pakistan - year_min: 1789 - year_max: 1946 + imputes: + - country_impute: Pakistan + year_min: 1947 + year_max: 1970 + annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" + - country: Bangladesh + country_impute: Pakistan + year_min: 1789 + year_max: 1946 + annotation: "1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016)" # UKRAINE (1789-1989) -## 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). - country: Ukraine - country_impute: Russia - year_min: 1946 - year_max: 1989 + imputes: + - country_impute: Russia + year_min: 1946 + year_max: 1989 + annotation: |- + 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). # PAKISTAN (1789-1946) -## 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) - country: Pakistan - country_impute: India - year_min: 1947 - year_max: 1970 + impute: + - country_impute: India + year_min: 1947 + year_max: 1970 + annotation: |- + 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) # POLAND -## Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); [I favor no imputation]. +- country: Poland + annotation: |- + Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); We favor no imputation. # ITALY (1789-1860) -## 1814-1860 part of Austria-Hungary (Wimmer and Min 2006) [No imputation] -## 1815-1860 part of Piedmont-Sardinia (Butcher and Griffiths 2020) - country: Italy - country_impute: Piedmont-Sardinia - year_min: 1815 - year_max: 1860 + impute: + - annotation: 1814-1860 part of Austria-Hungary (Wimmer and Min 2006). + - country_impute: Piedmont-Sardinia + year_min: 1815 + year_max: 1860 + annotation: Part of Piedmont-Sardinia (Butcher and Griffiths 2020) # NIGERIA (1789-1913) -## 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); [I favor no imputation]. +- country: Nigeria + annotation: |- + 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); We favor no imputation. # VIETNAM (1789-1944) -## 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); [I favor no imputation]. +- country: Vietnam + annotation: |- + 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); We favor no imputation. # UZBEKISTAN (1789-1911, 1921-1989) -## 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. -- country: Uzbekistan - country_impute: Russia - year_min: 1865 - year_max: 1911 +# TODO: Split. 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. - country: Uzbekistan - country_impute: Russia - year_min: 1921 - year_max: 1989 + impute: + - country_impute: Russia + year_min: 1865 + year_max: 1911 + - country_impute: Russia + year_min: 1921 + year_max: 1989 # KAZAKHSTAN (1789-1989) ## 1730-1990 imperial power Russia (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). @@ -161,19 +173,6 @@ year_min: 1801 year_max: 1989 - -# * Slovakia 1789-1992: imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). -# replace country_name_regime_imputed = "Hungary" if country_name == "Slovakia" & year >= 1789 & year <= 1918 -# replace country_name_regime_imputed = "Czechia" if country_name == "Slovakia" & year >= 1919 & year <= 1992 -# * South Africa 1789-1899: imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); I favor no imputation. -# * Cameroon 1789-1960: imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); I favor no imputation. -# * Tajikistan 1789-1989: imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). -# replace country_name_regime_imputed = "Russia" if country_name == "Tajikistan" & year >= 1868 & year <= 1989 -# * Palestine 1949-2019: no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; I therefore favor no imputation. -# * Brazil 1824-1825: independent since 1822 (Wimmer and Min 2006, Butcher and Griffiths 2020); I favor no imputation. -# * Serbia 1789-1833, 1932-1934: imperial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); I favor no imputation for later period. -# replace country_name_regime_imputed = "Turkey" if country_name == "Serbia" & year >= 1789 & year <= 1833 - # SLOVAKIA (1789-1992) ## imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). - country: Slovakia @@ -185,8 +184,56 @@ year_min: 1919 year_max: 1992 +# SOUTH AFRICA (1789-1899) +## imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); [I favor no imputation]. + +# CAMEROON (1789-1960) +## imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); [I favor no imputation]. + +# TAJIKISTAN (1789-1989) +## imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). +- country: Tajikistan + country_impute: Russia + year_min: 1868 + year_max: 1989 + +# PALESTINE (1949-2019) +## no information no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; [I therefore favor no imputation]. + +# BRAZIL (1824-1825) +# independent since 1822 (Wimmer and Min 2006, Butcher and Griffiths 2020); [I favor no imputation]. + +# SERBIA (1789-1833, 1932-1934) +## imperial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); [I favor no imputation for later period]. +- country: Serbia + country_impute: Turkey + year_min: 1789 + year_max: 1833 + +# * Croatia 1789-1940, 1945-1990: Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; I favor no imputation for earlier era. +# replace country_name_regime_imputed = "Serbia" if country_name == "Croatia" & year >= 1945 & year <= 1990 +# * Algeria 1789-1899: imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); I favor no imputation. +# * Bosnia and Herzegovina 1789-1991: imperial power Turkey 15th century-1878, Austria-Hungary 1879-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006); occupied by Austria-Hungary since at least 1886-1908, part of Austria-Hungary 1909-1918, part of Yugoslavia 1919-1992 (Cshapes 2.0); Austrian-Hungary occupation while formally still part of Ottoman Empire, not more associated with either Austria or Hungary (Encyclopedia Britannica); I therefore favor no imputation for 1909-1918. +# replace country_name_regime_imputed = "Turkey" if country_name == "Bosnia and Herzegovina" & year >= 1789 & year <= 1878 +# replace country_name_regime_imputed = "Serbia" if country_name == "Bosnia and Herzegovina" & year >= 1919 & year <= 1991 +# * Moldova 1789-1989: mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). +# replace country_name_regime_imputed = "Russia" if country_name == "Moldova" & year >= 1789 & year <= 1919 +# replace country_name_regime_imputed = "Russia" if country_name == "Moldova" & year >= 1940 & year <= 1989 +# * Kyrgyzstan 1789-1989: imperial power Russia 1876-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0), not colonized (Ertan et al. 2016), incorporated into Russia in mid-19th century (Encyclopedia Britannica). +# replace country_name_regime_imputed = "Russia" if country_name == "Kyrgyzstan" & year >= 1876 & year <= 1989 + +# CROATIA (1789-1940, 1945-1990) +## Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; [I favor no imputation for earlier era]. +- country: Croatia + country_impute: Serbia + year_min: 1945 + year_max: 1990 +# ALGERIA (1789-1899) +## imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); [I favor no imputation]. +# BOSNIA AND HERZEGOVINA (1789-1991) +## imperial power Turkey 15th century-1878, Austria-Hungary 1879-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006); occupied by Austria-Hungary since at least 1886-1908, part of Austria-Hungary 1909-1918, part of Yugoslavia 1919-1992 (Cshapes 2.0); Austrian-Hungary occupation while formally still part of Ottoman Empire, not ####################################### From 9d942404953ff03278de4d6369b9afc3e3803a6b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 21 Mar 2024 23:42:26 +0100 Subject: [PATCH 17/62] impute country list --- .../democracy/2024-03-07/vdem/__init__.py | 3 +- .../2024-03-07/vdem/countries_impute.yml | 811 ++++++++++++------ .../democracy/2024-03-07/vdem/vdem_clean.py | 18 +- 3 files changed, 539 insertions(+), 293 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index d13e81aeb1b..a92ee6d4a73 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -4,7 +4,8 @@ from typing import cast import vdem_clean as clean # VDEM's cleaning library -import vdem_impute as impute # VDEM's imputing library + +# import vdem_impute as impute # VDEM's imputing library from owid.catalog import Table from etl.data_helpers import geo diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml index fd4ee70cb45..2e9065401a2 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -6,376 +6,615 @@ # country_impute: Colombia # year_min: 1832 # year_max: 1902 +# annotation: Some text that could be surfaced in the metadata # # This means that we want to inherit the classifications for Panama from Colombia between 1832 and 1902. # # We note that `country` can also be a list of countries. +# +# Transcription from: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do + + +# ALGERIA (1789-1899) +- country: Algeria + annotation: |- + 1789-1899: imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); We favor no imputation. + +# ANGOLA (1789-1899) +- country: Angola + annotation: |- + Colony of Portugal 1886-1975 (CShapes 2.0); colony of imperial power Portugal 16th century-1974 (Wimmer and Min 2006); We favor no imputation. + +# ARMENIA (1789-1989) +- country: Armenia + country_impute: Russia + year_min: 1918 + year_max: 1989 + annotation: |- + Mixed rule 17th century-1917, imperial power Russia 1918-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); We favor no imputation for early years. +# AUSTRIA (1939-1944) +- country: Austria + annotation: |- + 1938-1944 imperial power Germany (Wimmer and Min 2006), independent 1939-1944 (CShapes 2.0), independent 1918-1938 (Butcher and Griffiths 2020); We favor no imputation. + +# AZERBAIJAN (1789-1989) +- country: Azerbaijan + country_impute: Russia + year_min: 1813 + year_max: 1989 + annotation: |- + Imperial power Russia 1813-1917, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0) not colonized (Ertan et al. 2016). # BANGLADESH (1945-1948) - country: Bangladesh - imputes: - - country_impute: Pakistan - year_min: 1947 - year_max: 1970 - annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" - - country: Bangladesh - country_impute: Pakistan - year_min: 1789 - year_max: 1946 - annotation: "1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016)" + country_impute: Pakistan + year_min: 1947 + year_max: 1970 + annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" +- country: Bangladesh + country_impute: Pakistan + year_min: 1789 + year_max: 1946 + annotation: |- + 1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016) -# UKRAINE (1789-1989) -- country: Ukraine - imputes: - - country_impute: Russia - year_min: 1946 - year_max: 1989 - annotation: |- - 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). +# BELARUS (1789-1989) +- country: Belarus + country_impute: Russia + year_min: 1795 + year_max: 1989 + annotation: |- + imperial power Russia 1795-1990 (Wimmer and Min 2006); 1886-1991 part of Russia (Cshapes 2.0), not mentioned in Ertan et al. (2016), independent since 1991 (Butcher and Griffiths 2020). -# PAKISTAN (1789-1946) -- country: Pakistan - impute: - - country_impute: India - year_min: 1947 - year_max: 1970 - annotation: |- - 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) +# BELGIUM (1789-1829) +- country: Belgium + country_impute: France + year_min: 1796 + year_max: 1813 + annotation: |- + Imperial power Netherlands 1814-1831 (Wimmer and Min 2006), part of Austria - 1794, part of France 1795-1813, part of Netherlands 1814-1831 (Encyclopedia Britannica). +- country: Belgium + country_impute: Austria + year_min: 1789 + year_max: 1790 +- country: Belgium + country_impute: Netherlands + year_min: 1814 + year_max: 1829 + +# BENIN (1789-1899) +- country: Benin + annotation: |- + 1789-1899: Colonized by France 1895-1961 (CShapes 2.0), imperial power 1863-1959 (Wimmer and Min 2006); I favor no imputation. -# POLAND -- country: Poland +# BOLIVIA (1789-1824) +- country: Bolivia annotation: |- - Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); We favor no imputation. + 1789-1824: Imperial power Spain 16th century - 1823 (Wimmer and Min 2006), independence in 1825 (Butcher and Griffiths 2020); I favor no imputation. -# ITALY (1789-1860) -- country: Italy - impute: - - annotation: 1814-1860 part of Austria-Hungary (Wimmer and Min 2006). - - country_impute: Piedmont-Sardinia - year_min: 1815 - year_max: 1860 - annotation: Part of Piedmont-Sardinia (Butcher and Griffiths 2020) +# BULGARIA (1789-1877) +- country: Bulgaria + country_impute: Turkey + year_min: 1789 + year_max: 1877 + annotation: |- + Imperial power Turkey 15th century-1878, independent in 1886 (CShapes 2.0). -# NIGERIA (1789-1913) -- country: Nigeria +# BURKINA FASO (1789-1918, 1932-1946) +- country: Burkina Faso annotation: |- - 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); We favor no imputation. + 1789-1918, 1932-1946: imperial power France 1895-1959 (Wimmer and Min 2006); colony of France 1895-1960 (Cshapes 2.0); colonized by France in 1896 (Ertan et al. 2016); I favor no imputation. -# VIETNAM (1789-1944) -- country: Vietnam +# BURUNDI (1789-1915) +- country: Burundi annotation: |- - 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); We favor no imputation. + 1789-1915: imperial power Germany 1890-1922, Belgium 1923-1961 (Wimmer and Min 2006); I favor no imputation. -# UZBEKISTAN (1789-1911, 1921-1989) -# TODO: Split. 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. -- country: Uzbekistan - impute: - - country_impute: Russia - year_min: 1865 - year_max: 1911 - - country_impute: Russia - year_min: 1921 - year_max: 1989 +# CAMEROON (1789-1960) +- country: Cameroon + annotation: |- + Imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); [I favor no imputation]. -# KAZAKHSTAN (1789-1989) -## 1730-1990 imperial power Russia (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). -- country: Kazakhstan - country_impute: Russia - year_min: 1730 +# CAMBODIA (1789-1899) +- country: Cambodia + annotation: |- + Colonized by France 1886-1953 (CShapes 2.0), imperial power France 1857-1952 (Wimmer and Min 2006), colonized in 1863 (Ertan et al. 2016); I favor no imputation. + +# CANADA (1789-1840) +- country: Canada + annotation: |- + Independent since 1886 (CShapes 2.0), imperial power United Kingdom 1763-1866, colonized by Britain and France in 1700 (Ertan et al. 2016); I favor no imputation. + +# CENTRAL AFRICAN REPUBLIC (1789-1919) +- country: Central African Republic + annotation: |- + 1789-1919: Colonized by France 1900-1961 (CShapes 2.0), imperial power France 1890-1959 (Wimmer and Min 2006), colonized by France in 1887/1903 (Ertan et al. 2016); I favor no imputation. + +# COLOMBIA (1789-1809) +- country: Colombia + annotation: |- + 1789-1809: Imperial power Spain 16th century - 1820 (Wimmer and Min 2006), independence in 1819 (Butcher and Griffiths 2020); I favor no imputation. + +# COTE D'IVOIRE (1789-1899) +- country: Cote d'Ivoire + annotation: |- + 1789-1899: colonized by France 1890-1961 (CShapes 2.0), colonized by France 1887-1959 (Wimmer and Min 2006); I favor no imputation. + +# CROATIA (1945-1990) +- country: Croatia + country_impute: Serbia + year_min: 1945 year_max: 1990 + annotation: |- + Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; I favor no imputation for earlier era. -# MOZAMBIQUE (1789-1899, 1974-1993) -## imperial power Portugal 1885-1974 (Wimmer and Min 2006); colony of Portugal 1886-1975 (Cshapes 2.0), colonized by Portugal, approximated as 1750 (Ertan et al. 2016); [I favor no imputation]. +# CHAD (1789-1919) +- country: Chad + annotation: |- + 1789-1919: colonized by France 1900-1960 (CShapes 2.0), imperial power Sudan 1805-1889, France 1890-1959 (Wimmer and Min 2006); I favor no imputation. # CZECHIA (1789-1917) -## Imperial power Austria-Hungary 16th century-1917 (Wimmer and Min 2006), part of Austria-Hungary since at least 1886 (Cshapes 2.0), Czech part under Austrian control (Encyclopedia Britannica). - country: Czechia country_impute: Austria year_min: 1789 year_max: 1917 + annotation: |- + Imperial power Austria-Hungary 16th century-1917 (Wimmer and Min 2006), part of Austria-Hungary since at least 1886 (Cshapes 2.0), Czech part under Austrian control (Encyclopedia Britannica). -# IRAN (1789-1899) -## no imperial onset (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), not colonized (Ertan et al. 2016); [I favor no imputation]. +# DEMOCRATIC REPUBLIC OF CONGO (1789-1899) +- country: Democratic Republic of Congo + annotation: |- + 1789-1899: imperial power Belgium 1885-1959 (Wimmer and Min 2006), colonized in 1885 (Ertan et al. 2016); -# BELARUS (1789-1989) -## imperial power Russia 1795-1990 (Wimmer and Min 2006); 1886-1991 part of Russia (Cshapes 2.0), not mentioned in Ertan et al. (2016), independent since 1991 (Butcher and Griffiths 2020). -- country: Belarus +# ESTONIA (1789-1917, 1940-1989) +- country: Estonia country_impute: Russia - year_min: 1795 + year_min: 1789 + year_max: 1917 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006). +- country: Estonia + country_impute: Russia + year_min: 1940 year_max: 1989 -# DEMOCRATIC REPUBLIC OF CONGO (1789-1899) -## imperial power Belgium 1885-1959 (Wimmer and Min 2006), colonized in 1885 (Ertan et al. 2016); [I favor no imputation]. +# FINLAND (1789-1862) +- country: Finland + country_impute: Sweden + year_min: 1789 + year_max: 1808 + annotation: |- + Part of Russia 1886-1916 (CShapes 2.0), imperial power Russia 1809-1916 (Wimmer and Min 2006), independence in 1917 (Butcher and Griffiths 2020), part of Sweden 14th century-1808. +- country: Finland + country_impute: Russia + year_min: 1809 + year_max: 1862 -# NORTH KOREA (1789-1944) -## Korea since the 14th century until 1909, imperial power Japan 1910-1944 (Wimmer and Min 2006), independent Korea since at least 1886-1910, colony of Japan -1945 (Cshapes 2.0), not listed (Ertan et al. 2016) -- country: North Korea - country_impute: Korea +## GEORGIA (1789-1989) +- country: Georgia + country_impute: Russia + year_min: 1801 + year_max: 1989 + annotation: |- + Imperial power Russia 1801-1918, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991, not colonized (Ertan et al. 2016), independent since 1991 (Butcher and Griffiths 2020). + +# GHANA (1789-1901) +- country: Ghana + annotation: |- + Colonized by United Kingdom 1886-1957 (CShapes 2.0), imperial power Portugal 15th century - 1823, United Kingdom 1874-1956 (Wimmer and Min 2006); I favor no imputation. + +# GREECE (1789-1821) +- country: Greece + country_impute: Turkey year_min: 1789 - year_max: 1910 + year_max: 1821 + annotation: |- + Imperial power Turkey 15th century - 1826, independent 1918-1919 (Wimmer and Min 2006, Cshapes 2.0); independent from 1828 to 1941 (Butcher and Griffiths 2020). -# SUDAN (1789-1899) -## Egypt imperial power 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955 (CShapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020); in 1886, colony Egypt of United Kingdom covers little of today's Sudan (CShapes 2.0); Egypt invades Sudanese territory in 1820, indigenous forces surrender in 1821, Mahdists capture Khartoum from Egypt and the British in 1885 (Encyclopedia Britannica). -- country: Sudan - country_impute: Egypt - year_min: 1821 - year_max: 1884 +# GUINEA (1789-1899) +- country: Guinea + annotation: |- + 1789-1899: colonized by France 1893-1958 (CShapes 2.0), imperial power France 1849-1957 (Wimmer and Min 2006); I favor no imputation. -# SOUTH SUDAN (1789-2010) -## not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). -- country: South Sudan - country_impute: Egypt - year_min: 1821 - year_max: 1884 -- country: South Sudan - country_impute: Sudan - year_min: 1900 - year_max: 2010 +# ISRAEL (1789-1947) +- country: Israel + country_impute: Turkey + year_min: 1789 + year_max: 1919 + annotation: |- + 1789-1947: Imperial power Turkey 1516-1916, United Kingdom 1917-1947 (Wimmer and Min 2006), part of Turkey 1886-1920, occupied by United Kingdom 1921-1948 (CShapes 2.0); I favor no imputation. + +# IRAQ (1789-1919) +- country: Iraq + country_impute: Turkey + year_min: 1789 + year_max: 1919 + annotation: |- + 1789-1919: part of Turkey 1886-1920, mandate of United Kingdom 1921-1933 (CShapes 2.0); imperial power Turkey 16th century-1913, imperial power United Kingdom 1914-1931 (Wimmer and Min 2006). + +# IRAN (1789-1899) +- country: Iran + annotation: |- + 1789-1899: no imperial onset (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), not colonized (Ertan et al. 2016). We favor no imputation. # IRELAND (1789-1918) -## imperial power United Kingdom 11th century-1919 (Wimmer and Min 2006), part of United Kingdom since at least 1886-1922, independent since 1922 (Butcher and Griffiths 2020). - country: Ireland country_impute: United Kingdom year_min: 1789 year_max: 1918 + annotation: |- + Imperial power United Kingdom 11th century-1919 (Wimmer and Min 2006), part of United Kingdom since at least 1886-1922, independent since 1922 (Butcher and Griffiths 2020). -# AZERBAIJAN (1789-1989) -## imperial power Russia 1813-1917, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0) not colonized (Ertan et al. 2016). -- country: Azerbaijan +# ITALY (1789-1860) +- country: Italy + country_impute: Piedmont-Sardinia + year_min: 1815 + year_max: 1860 + annotation: |- + 1814-1860 part of Austria-Hungary (Wimmer and Min 2006) or Piedmont-Sardinia since 1815 (Butcher and Griffiths 2020) + +# KAZAKHSTAN (1789-1989) +- country: Kazakhstan country_impute: Russia - year_min: 1813 - year_max: 1989 + year_min: 1789 + year_max: 1990 + annotation: |- + 1789-1989: imperial power Russia 1730-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). -# ROMANIA (1789-1830, 1854-1856, 1859-1899) -## 1688-1858 imperial power Austria-Hungary (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), independent since 1878 (Butcher and Griffiths 2020), Transylvania part of Austria-Hungary, other parts under Ottoman influence; [I favor no imputation]. +# KENYA (1789-1899) +- country: Kenya + annotation: |- + 1789-1899: protectorate of United Kingdom 1889-1920, colony of United Kingdom 1921-1963 (CShapes 2.0); imperial power United Kingdom 1895-1962 (Wimmer and Min 2006); I favor no imputation. -# AUSTRIA (1939-1944) -## 1938-1944 imperial power Germany (Wimmer and Min 2006), independent 1939-1944 (CShapes 2.0), independent 1918-1938 (Butcher and Griffiths 2020); [I favor no imputation]. +# KYRGYZSTAN (1789-1989) +- country: Kyrgyzstan + country_impute: Russia + year_min: 1876 + year_max: 1989 + annotation: |- + Imperial power Russia 1876-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0), not colonized (Ertan et al. 2016), incorporated into Russia in mid-19th century (Encyclopedia Britannica). -# PHILIPPINES (1789-1899) -## imperial power Spain 16th century-1898, United States 1899-1945 (Wimmer and Min 2006), colony of Spain since at least 1886-1898, colony of United States 1899-1946 (Cshapes 2.0); [I favor no imputation]. +# LAOS (1789-1899) +- country: Laos + country_impute: Thailand + year_min: 1789 + year_max: 1892 + annotation: |- + Part of Thailand 1886-1893, colonized by France 1894-1954 (CShapes 2.0), imperial power Thailand 1778-1889, France 1890-1952 (Wimmer and Min 2006). -# GREECE (1789-1821) -## imperial power Turkey 15th century - 1826, independent 1918-1919 (Wimmer and Min 2006, Cshapes 2.0); independent from 1828 to 1941 (Butcher and Griffiths 2020). -- country: Greece - country_impute: Turkey +# LATVIA (1789-1919, 1940-1989) +- country: Latvia + country_impute: Russia year_min: 1789 - year_max: 1821 + year_max: 1919 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006); I include 1919. +- country: Latvia + country_impute: Russia + year_min: 1940 + year_max: 1989 -# TANZANIA (1789-1914) -## imperial power/colonized by Germany and United Kingdom (Wimmer and Min 2006, Cshapes 2.0); [I favor no imputation]. +# LIBYA (1789-1899) +- country: Libya + annotation: |- + 1789-1899: Imperial power Turkey 1551-1911, Italy 1912-1942 (Wimmer and Min 2006), colonized by Italy in 1911 (Ertan et al. 2016); I favor no im -## GEORGIA (1789-1989) -## imperial power Russia 1801-1918, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991, not colonized (Ertan et al. 2016), independent since 1991 (Butcher and Griffiths 2020). -- country: Georgia +# LITHUANIA (1789-1917) +- country: Lithuania country_impute: Russia - year_min: 1801 + year_min: 1795 + year_max: 1917 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1795-1918 (Wimmer and Min 2006). +- country: Lithuania + country_impute: Russia + year_min: 1940 year_max: 1989 + annotation: |- + Imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia 1940-1991 (CShapes 2.0), independent 1918-1940, 1991- (Butcher and Griffiths 2020). -# SLOVAKIA (1789-1992) -## imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). -- country: Slovakia - country_impute: Austria-Hungary - year_min: 1789 - year_max: 1918 -- country: Slovakia - country_impute: Czechia - year_min: 1919 - year_max: 1992 +# MADAGASCAR (1789-1816) +- country: Madagascar + annotation: |- + Independent 1886-1896 (CShapes 2.0), imperial power France 1894-1959 (Wimmer and Min 2006), independent 1816-1895 (Butcher and Griffiths 2020), no indication of being part of another country 1789-1816 (Encyclopedia Britannica); I favor no imputation. -# SOUTH AFRICA (1789-1899) -## imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); [I favor no imputation]. +# MALAWI (1789-1899) +- country: Malawi + annotation: |- + 1789-1899: colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1889-1963 (Wimmer and Min 2006); I favor no imputation. -# CAMEROON (1789-1960) -## imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); [I favor no imputation]. +# MALAYSIA (1789-1899) +- country: Malaysia + annotation: |- + 1789-1899: colonized by United Kingdom 1886-1957, imperial power United Kingdom 1795-1956 (Wimmer and Min 2006); I favor no imputation. -# TAJIKISTAN (1789-1989) -## imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). -- country: Tajikistan +# MALI (1789-1899) +- country: Mali + annotation: |- + Colonized by France since 1896 (CShapes 2.0), imperial power France since 1895 (Wimmer and Min 2006); I favor no imputation. + +# MOLDOVA (1789-1989) +- country: Moldova country_impute: Russia - year_min: 1868 + year_min: 1789 + year_max: 1919 + annotation: |- + Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). +- country: Moldova + country_impute: Russia + year_min: 1940 year_max: 1989 + annotation: |- + Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). + +# MOZAMBIQUE (1789-1899, 1974-1993) +- country: Mozambique + annotation: |- + 1789-1899, 1974-1993: imperial power Portugal 1885-1974 (Wimmer and Min 2006); colony of Portugal 1886-1975 (Cshapes 2.0), colonized by Portugal, approximated as 1750 (Ertan et al. 2016); We favor no imputation. + +# NETHERLANDS (1811-1812) +- country: Netherlands + country_impute: France + year_min: 1811 + year_max: 1812 + +# NIGER (1789-1921) +- country: Niger + annotation: |- + Colony of France 1896-1960 (CShapes 2.0), imperial power France 1904-1959 (Wimmer and Min 2006); I favor no imputation. + +# NIGERIA (1789-1913) +- country: Nigeria + annotation: |- + 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); We favor no imputation. + +# NORTH KOREA (1789-1944) +- country: North Korea + country_impute: Korea + year_min: 1789 + year_max: 1910 + annotation: |- + Korea since the 14th century until 1909, imperial power Japan 1910-1944 (Wimmer and Min 2006), independent Korea since at least 1886-1910, colony of Japan -1945 (Cshapes 2.0), not listed (Ertan et al. 2016) + +# NORTH MACEDONIA (1789-1990) +- country: North Macedonia + country_impute: Turkey + year_min: 1789 + year_max: 1913 +- country: North Macedonia + country_impute: Serbia + year_min: 1914 + year_max: 1990 # PALESTINE (1949-2019) -## no information no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; [I therefore favor no imputation]. +- country: Palestine + annotation: |- + No information no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; We therefore favor no imputation. + +# PAKISTAN (1789-1946) +- country: Pakistan + country_impute: India + year_min: 1947 + year_max: 1970 + annotation: |- + 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) + +# PAPUA NEW GUINEA (1789-1899) +- country: Papua New Guinea + annotation: |- + 1789-1899: Colonized by United Kingdom 1886-1920 and Germany 1886-1914, Australia 1915-1975 (CShapes 2.0), imperial power United Kingdom 1883-1904, Australia 1905-1974 (Wimmer and Min 2006), colonized by United Kingdom and Germany in 1884 (Ertan et al. 2016); I favor no imputation. + +# PERU (1789-1820) +- country: Peru + annotation: |- + 1789-1820: Imperial power Spain 16th century - 1824 (Wimmer and Min 2006), independence in 1821 (Butcher and Griffiths 2020); I favor no imputation. + +# PHILIPPINES (1789-1899) +- country: Philippines + annotation: |- + Imperial power Spain 16th century-1898, United States 1899-1945 (Wimmer and Min 2006), colony of Spain since at least 1886-1898, colony of United States 1899-1946 (Cshapes 2.0); We favor no imputation. + +# POLAND +- country: Poland + annotation: |- + Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); We favor no imputation. + +# PUERTO RICO (1940, 1950-2021) +- country: Puerto Rico + annotation: |- + 1940, 1950-2021: colony of Spain since at least 1886-1898, colony of United States 1899- (CShapes 2.0), colony of Spain since 16th century (Encyclopedia Britannica); We favor no imputation. + +# ROMANIA (1789-1830, 1854-1856, 1859-1899) +- country: Romania + annotation: |- + 1688-1858 imperial power Austria-Hungary (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), independent since 1878 (Butcher and Griffiths 2020), Transylvania part of Austria-Hungary, other parts under Ottoman influence; We favor no imputation. -# BRAZIL (1824-1825) -# independent since 1822 (Wimmer and Min 2006, Butcher and Griffiths 2020); [I favor no imputation]. +# RWANDA (1789-1915) +- country: Rwanda + annotation: |- + Colonized by Germany 1891-1916 (CShapes 2.0), imperial power Germany 1890-1915 (Wimmer and Min 2006); I favor no imputation. + +# SAUDI ARABIA (1819-1821) +- country: Saudi Arabia + country_impute: Turkey + year_min: 1819 + year_max: 1821 + annotation: |- + Part of Turkey 1886-1919, nothing 1920-1932 (CShapes 2.0), not included (Wimmer and Min 2006), not colonized (Ertan et al. 2016), independent 1816-1818 (Butcher and Griffiths 2020), part of Ottoman Empire (Encyclopedia Britannica). + +# SENEGAL (1789-1903) +- country: Senegal + annotation: |- + 1789-1903: colonized by France 1886-1961 (CShapes 2.0), imperial power France 1854-1959 (Wimmer and Min 2006); I favor no imputation. # SERBIA (1789-1833, 1932-1934) -## imperial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); [I favor no imputation for later period]. - country: Serbia country_impute: Turkey year_min: 1789 year_max: 1833 + annotation: |- + Im perial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); We favor no imputation for later period. -# * Croatia 1789-1940, 1945-1990: Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; I favor no imputation for earlier era. -# replace country_name_regime_imputed = "Serbia" if country_name == "Croatia" & year >= 1945 & year <= 1990 -# * Algeria 1789-1899: imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); I favor no imputation. -# * Bosnia and Herzegovina 1789-1991: imperial power Turkey 15th century-1878, Austria-Hungary 1879-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006); occupied by Austria-Hungary since at least 1886-1908, part of Austria-Hungary 1909-1918, part of Yugoslavia 1919-1992 (Cshapes 2.0); Austrian-Hungary occupation while formally still part of Ottoman Empire, not more associated with either Austria or Hungary (Encyclopedia Britannica); I therefore favor no imputation for 1909-1918. -# replace country_name_regime_imputed = "Turkey" if country_name == "Bosnia and Herzegovina" & year >= 1789 & year <= 1878 -# replace country_name_regime_imputed = "Serbia" if country_name == "Bosnia and Herzegovina" & year >= 1919 & year <= 1991 -# * Moldova 1789-1989: mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). -# replace country_name_regime_imputed = "Russia" if country_name == "Moldova" & year >= 1789 & year <= 1919 -# replace country_name_regime_imputed = "Russia" if country_name == "Moldova" & year >= 1940 & year <= 1989 -# * Kyrgyzstan 1789-1989: imperial power Russia 1876-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0), not colonized (Ertan et al. 2016), incorporated into Russia in mid-19th century (Encyclopedia Britannica). -# replace country_name_regime_imputed = "Russia" if country_name == "Kyrgyzstan" & year >= 1876 & year <= 1989 - -# CROATIA (1789-1940, 1945-1990) -## Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; [I favor no imputation for earlier era]. -- country: Croatia - country_impute: Serbia - year_min: 1945 - year_max: 1990 +# SIERRA LEONE (1789-1899) +- country: Sierra Leone + annotation: |- + 1789-1899: Imperial power United Kingdom 1808-1960 (Wimmer and Min 2006), colonized by United Kingdom in 1808/1896 (Ertan et al. 2016); I favor no imputation. -# ALGERIA (1789-1899) -## imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); [I favor no imputation]. +# SLOVAKIA (1789-1992) +- country: Slovakia + country_impute: Austria-Hungary + year_min: 1789 + year_max: 1918 + annotation: |- + Imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). +- country: Slovakia + country_impute: Czechia + year_min: 1919 + year_max: 1992 + annotation: |- + Imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). -# BOSNIA AND HERZEGOVINA (1789-1991) -## imperial power Turkey 15th century-1878, Austria-Hungary 1879-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006); occupied by Austria-Hungary since at least 1886-1908, part of Austria-Hungary 1909-1918, part of Yugoslavia 1919-1992 (Cshapes 2.0); Austrian-Hungary occupation while formally still part of Ottoman Empire, not +# SLOVENIA (1789-1988) +- country: Slovenia + country_impute: Serbia + year_min: 1919 + year_max: 1988 + annotation: |- + Part of Austria-Hungary 1886-1918, of Austria 1919, of Yugoslavia 1920-1992 (CShapes 2.0), imperial power Austria-Hungary 1804-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006), appears more closely affiliated with Austria, as Hungary barely referenced (Encyclopedia Britannica). +- country: Slovenia + country_impute: Austria + year_min: 1804 + year_max: 1918 +# SOMALIA (1789-1899) +- country: Somalia + annotation: |- + 1789-1899: colonized by United Kingdom 1886-1961, Italy 1890-1941 (CShapes 2.0), imperial power Turkey 1870-1883, United Kingdom 1884-1888, mixed rule 1889-1941 (Wimmer and Min 2006), occupied by Egypt 1870-1885 (Encyclopedia Britannica); I favor no imputation. -####################################### +# SOUTH AFRICA (1789-1899) +- country: South Africa + annotation: |- + Imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); We favor no imputation. -# Federal Republic of Central America -- country: - - Guatemala - - Honduras - - El Salvador - - Nicaragua - - Costa Rica - country_impute: Federal Republic of Central America - year_min: 1824 - year_max: 1838 +# SOUTH SUDAN (1789-2010) +- country: South Sudan + country_impute: Egypt + year_min: 1821 + year_max: 1884 + annotation: |- + not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). +- country: South Sudan + country_impute: Sudan + year_min: 1900 + year_max: 2010 + anotation: |- + not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). +# SRI LANKA (1789-1899) +- country: Sri Lanka + annotation: |- + 1789-1899: colonized by United Kingdom as Ceylon (Cshapes 2.0); I favor no imputation. -# Czechoslovakia -- country: - - Slovakia - - Czechia - country_impute: Czechoslovakia - year_min: 1918 - year_max: 1992 -# Korea -## Korea from Japan Colonisation (1910 - 1945)? -- country: - - South Korea - - North Korea - country_impute: Korea (former) - year_min: 1800 - year_max: 1910 -# Great Colombia -- country: - - Venezuela - - Ecuador - - Panama - - Colombia - country_impute: Great Colombia +# SUDAN (1789-1899) +- country: Sudan + country_impute: Egypt year_min: 1821 + year_max: 1884 + annotation: |- + Egypt imperial power 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955 (CShapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020); in 1886, colony Egypt of United Kingdom covers little of today's Sudan (CShapes 2.0); Egypt invades Sudanese territory in 1820, indigenous forces surrender in 1821, Mahdists capture Khartoum from Egypt and the British in 1885 (Encyclopedia Britannica). + +# SYRIA (1789-1917, 1920-1921) +- country: Syria + country_impute: Turkey + year_min: 1789 year_max: 1830 -# Colombia -- country: Panama - country_impute: Colombia - year_min: 1832 - year_max: 1902 -# Yugoslavia -- country: - - Slovenia - - Croatia - - Montenegro - - Serbia - - Bosnia and Herzegovina - - Kosovo - - North Macedonia - country_impute: Yugoslavia - year_min: 1921 - year_max: 1990 -# Serbia and Montenegro -- country: - - Serbia - - Montenegro - - Kosovo - country_impute: Serbia and Montenegro - year_min: 1991 - year_max: 2005 -# Serbia (with Kosovo) -- country: Kosovo - country_impute: Serbia - year_min: 2006 - year_max: 2011 -# USSR -- country: Russia - country_impute: USSR - year_min: 1922 - year_max: 1991 -- country: - - Ukraine - - Belarus - - Azerbaijan - - Armenia - - Georgia - - Turkmenistan - - Uzbekistan - - Kazakhstan - - Tajikistan - - Kyrgyzstan - country_impute: USSR - year_min: 1922 - year_max: 1991 -- country: - - Lithuania - - Latvia - - Estonia - country_impute: USSR - year_min: 1941 - year_max: 1991 -- country: Moldova - country_impute: USSR - year_min: 1940 - year_max: 1991 - -# Russian Empire -- country: - - Belarus - - Georgia - - Turkmenistan - - Kazakhstan - country_impute: Russia - year_min: 1800 - year_max: 1921 + annotation: |- + Part of Turkey 1886-1920 (CShapes 2.0), imperial power Turkey 1840-1919, France 1920-1943 (Wimmer and Min 2006), colonized by France in 1920 (Ertan et al. 2016), part of of Ottoman Empire 16th century-1830, of Egypt 1831-1839 (Encyclopedia Britannica). +- country: Syria + country_impute: Egypt + year_min: 1831 + year_max: 1839 +- country: Syria + country_impute: Turkey + year_min: 1840 + year_max: 1917 + +# TAIWAN (1789-1899) +- country: Taiwan + country_impute: China + year_min: 1789 + year_max: 1894 + annotation: |- + Part of China 1886-1895, colony of Japan afterwards (CShapes 2.0), imperial power China 17th century - 1947 (Wimmer and Min 2006), colonized by Japan 1895-1945 (Ertan et al. 2016). + +# TAJIKISTAN (1789-1989) - country: Tajikistan country_impute: Russia year_min: 1868 - year_max: 1921 -- country: Kyrgyzstan + year_max: 1989 + annotation: |- + Imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). + +# TANZANIA (1789-1914) +- country: Tanzania + annotation: |- + Imperial power/colonized by Germany and United Kingdom (Wimmer and Min 2006, Cshapes 2.0); We favor no imputation. + +# TURKMENISTAN (1789-1989) +- country: Turkmenistan country_impute: Russia - year_min: 1868 - year_max: 1921 + year_min: 1896 + year_max: 1989 + annotation: |- + Imperial power Russia 1897-1990 (Wimmer and Min 2006), (mostly) part of Russia since 1886-1991, part protectorate Khiva 1886-1920 (Cshapes 2.0), not colonized (Ertan et al. 2016), resistance against Russia broken in 1881 (Encyclopedia Britannica). + +# UGANDA (1789-1899) +- country: Uganda + annotation: |- + 1789-1899: part of Kenya, protectorate of United Kingdom 1892-1894 (CShapes 2.0); own protectorate of United Kingdom 1895-1962; imperial power United Kingdom 1890-1961 (Wimmer and Min 2006); I favor no imputation. + +# UKRAINE (1789-1989) +- country: Ukraine + country_impute: Russia + year_min: 1946 + year_max: 1989 + annotation: |- + 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). + +# UZBEKISTAN (1789-1911, 1921-1989) - country: Uzbekistan country_impute: Russia year_min: 1865 year_max: 1911 -- country: Moldova - country_impute: Russia - year_min: 1800 - year_max: 1919 -- country: Azerbaijan + annotation: |- + 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. +- country: Uzbekistan country_impute: Russia - year_min: 1813 - year_max: 1921 - -# Ethopia -- country: - - Eritrea - - Ethiopia - country_impute: Ethiopia (former) - year_min: 1952 - year_max: 1992 -# Pakistan -- country: - - Pakistan - - Bangladesh - country_impute: Pakistan (former) - year_min: 1947 - year_max: 1971 + year_min: 1921 + year_max: 1989 + annotation: |- + 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. + +# VIETNAM (1789-1944) +- country: Vietnam + annotation: |- + 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); We favor no imputation. + +# YEMEN (1851-1917) +- country: Yemen + country_impute: Turkey + year_min: 1851 + year_max: 1917 + annotation: |- + Mixed rule by Turkey and United Kingdom 1849-1918, part of Turkey 1886-1918 (CShapes 2.0), United Kingdom not on CShapes map. + +# ZAMBIA (1789-1910) +- country: Zambia + annotation: |- + Colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1890-1963 (Wimmer and Min 2006); I favor no imputation. + +# ZIMBABWE (1789-1899) +- country: Zimbabwe + annotation: |- + 1789-1899: Colonized by United Kingdom 1889-1965 (CShapes 2.0), imperial power United Kingdom 1890-1964 (Wimmer and Min 2006); I favor no imputation. diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index 2d33cde799f..4a4bc7c100e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -111,7 +111,7 @@ def estimate_hos_indicators(tb: Table) -> Table: """Create indicators for multi-party head of state elections with imputed values between election-years.""" def _set_mulpar_hos(tb: Table, column_new: str, column_ex: str, column_leg: str) -> Table: - # Iniitalize new column + # Initialize new column tb[column_new] = 0 tb.loc[tb["v2x_elecreg"].isna(), column_new] = np.nan # Define mask @@ -430,7 +430,13 @@ def compare_with_row_coding(tb: Table) -> Table: # Honduras in 1934 and 1935, Kazakhstan in 1990, and Turkmenistan in 1990 can be coded because I use information from the other criteria for democracies and autocracies in the absence of information from v2x_polyarchy # 13 observations own classification identifies as electoral autocracies, whereas RoW does not provide data - # tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"].isna() & (tb["year"] > 1900)), ["country", "year", "v2x_polyarchy"]] + assert ( + tb.loc[ + (tb["regime_row_owid"] == 1) & (tb["v2x_regime"].isna() & (tb["year"] > 1900)), + ["country", "year", "v2x_polyarchy"], + ].shape[0] + == 13 + ) # Observations can be coded because I use information from the other criteria for democracies and autocracies in the absence of information from v2x_polyarchy # 141 bservations own classification identifies as closed autocracies, whereas RoW identifies them as electoral autocracies @@ -466,7 +472,7 @@ def compare_with_row_coding(tb: Table) -> Table: ) # Examples include prominent heads of government which came to office in a rebellion or were appointed by a foreign power, such as Castro (Cuba 1959) - # 21 observations coded differently because I use v2ex_legconhog above for consistency, while RoW uses v2exaphogp instead. I defer to RoW coding in these cases. It may be that their data pipeline uses date-specific data which are superior to the year-end data used here. + # NOTE: 3 -> 21 observations coded differently because I use v2ex_legconhog above for consistency, while RoW uses v2exaphogp instead. I defer to RoW coding in these cases. It may be that their data pipeline uses date-specific data which are superior to the year-end data used here. assert ( tb.loc[ (tb["regime_row_owid"] == 0) @@ -485,16 +491,16 @@ def compare_with_row_coding(tb: Table) -> Table: "regime_row_owid", ] = 1 - # 270 bservations own classification identifies as electoral autocracies, whereas RoW identifies them as closed autocracies: + # NOTE: 136 -> 270 bservations own classification identifies as electoral autocracies, whereas RoW identifies them as closed autocracies: # tb.loc[(tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 0), ["country", "year"]] - # 180 observations with chief executives that were heads of state directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (2elmulpar_osp_ex instead of v2elmulpar_osp_leg) above: + # NOTE: 130 -> 180 observations with chief executives that were heads of state directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (2elmulpar_osp_ex instead of v2elmulpar_osp_leg) above: # tb.loc[ # (tb["regime_row_owid"] == 1) & (tb["v2x_regime"] == 0) & (tb["v2ex_hosw"] <= 1) & (tb["v2ex_hosw"] > 0.5), # ["country", "year", "v2elmulpar_osp_leg_dich", "v2elmulpar_osp_hoe", "v2elmulpar_osp_ex", "v2elmulpar_osp_leg"], # ] - # 90 observations with chief executives that were heads of government directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (v2elmulpar_osp instead of v2xlg_elecreg) above: + # NOTE: 6 -> 90 observations with chief executives that were heads of government directly or indirectly elected chief executive and at least moderately multi-party elections for legislative, but which are affected by RoW's different standard filter (v2elmulpar_osp instead of v2xlg_elecreg) above: # list v2elmulpar_osp_leg v2elmulpar_osp_hoe v2elmulpar_osp v2xlg_elecreg if regime_row_owid == 1 & v2x_regime == 0 & v2ex_hosw <= 0.5 assert ( tb.loc[ From 1f0f650d26cb27a5fd6408b29df24f7dd0db065a Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 22 Mar 2024 16:17:27 +0100 Subject: [PATCH 18/62] wip --- .../democracy/2024-03-07/vdem/__init__.py | 89 ++----------------- .../2024-03-07/vdem/countries_impute.yml | 8 +- .../2024-03-07/vdem/vdem.countries.json | 13 +-- .../democracy/2024-03-07/vdem/vdem_clean.py | 79 +++++++++++++++- .../democracy/2024-03-07/vdem/vdem_impute.py | 69 +++++++++++++- .../data/meadow/democracy/2024-03-07/vdem.py | 2 + 6 files changed, 166 insertions(+), 94 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index a92ee6d4a73..381f1d8e710 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -1,14 +1,11 @@ """Load a meadow dataset and create a garden dataset.""" -from copy import deepcopy from typing import cast import vdem_clean as clean # VDEM's cleaning library - -# import vdem_impute as impute # VDEM's imputing library +import vdem_impute as impute # VDEM's imputing library from owid.catalog import Table -from etl.data_helpers import geo from etl.helpers import PathFinder, create_dataset # Get paths and naming conventions for current step. @@ -16,7 +13,7 @@ def run(dest_dir: str) -> None: - # %% Intro 1 + # %% Load data # # Load inputs. # @@ -25,100 +22,28 @@ def run(dest_dir: str) -> None: # Read table from meadow dataset. tb = ds_meadow["vdem"].reset_index() + tb = cast(Table, tb.astype({"v2exnamhos": str})) - tb = tb.astype( - { - "v2exnamhos": str, - } - ) - - # %% Intro 2 # # Process data. # - tb = cast(Table, tb) - tb = clean.initial_cleaning(tb) - - # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. - tb = clean.clean_female_flag(tb) - - # Harmonize country names - tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) - - # Sort - tb = tb.sort_values(["country", "year"]) # %% PART 1: CLEAN # The following lines (until "PART 2") are the cleaning steps. # This is a transcription from Bastian's work: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_clean.do - # Copy origins (some indicators will loose their 'origins' in metadata) - origins = deepcopy(tb["country"].metadata.origins) - - # %% Create expanded and refined Regimes of the World indicator - # (L76-L94) Create indicators for multi-party elections, and free and fair elections - tb = clean.estimate_mulpar_indicators(tb) - # (L96-L109) Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years: - tb = clean.estimate_ex_indicators(tb) - # (L109-L122) Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years - tb = clean.estimate_leg_indicators(tb) - # (L122-L141) Create indicators for multi-party head of state elections with imputed values between election-years - tb = clean.estimate_hos_indicators(tb) - # (L141-L167) Create indicators for multi-party head of government elections with imputed values between election-years - tb = clean.estimate_hog_indicators(tb) - # (L167-L175) Create indicators for multi-party executive and legislative elections with imputed values between election-years - tb = clean.estimate_exleg_indicators(tb) - # (L177-L201) Create indicator for multi-party head of executive elections with imputed values between election-years - tb = clean.estimate_hoe_indicators(tb) - # (L202-L300) Create dichotomous indicators for classification criteria - tb = clean.estimate_dichotomous_indicators(tb) - # (L302-L314) Create indicators for Regimes of the World with expanded coverage and minor changes to coding - tb = clean.estimate_row_indicators(tb) - - # %% (L322-L389) Compare our and standard RoW coding - tb = clean.compare_with_row_coding(tb) - - # %% (L389-L401) Finalize expanded and refined Regimes of the World indicator with ambiguous categories - tb = clean.add_regime_amb_row(tb) - # (L419-L424) Create reduced version of political regimes, only distinguishing between closed autocracies, electoral autocracies, and electoral democracies (including liberal democracies) - tb["regime_redux_row"] = tb["regime_row_owid"].replace({3: 2}) - - # %% Drop and rename columns - # (L416) Drop irrelevant columns now - tb = clean.drop_columns(tb) - # (L427-L669) Rename columns of interest - tb = clean.rename_columns(tb) - - # %% Ratio as share (share of adult citizens with vote right) - tb["suffr_vdem"] = tb["suffr_vdem"] * 100 - - # %% Gender indicators - # Create variable identifying gender of chief executive - tb = clean.estimate_gender_hoe_indicator(tb) - # Estimate gender of HOG - tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] - tb = tb.drop(columns=["v2exhoshog"]) - - # %% Bring origins back - columns = [col for col in tb.columns if col not in ["country", "year"]] - for col in columns: - tb[col].metadata.origins = origins + tb = clean.run(tb) # %% PART 2: IMPUTE # The following lines concern imputing steps. # Equivalent to: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do - # %% Proceed - # Expand to have observations for all years and countries - # Indicator `vdem_obs` is created to flag the original observations (though they can easily be identified by the non-missing values in the other columns) - # tb = impute.expand_observations(tb) - # %% Impute values from adjacent years # Conditions for Australia and the year 1900 condition_australia_1900 = (tb["country"] == "Australia") & (tb["year"] == 1900) # Perform replacements (is this just based on 1899?) tb.loc[condition_australia_1900, "regime_row_owid"] = 3 - tb.loc[condition_australia_1900, "regime_redux_row"] = 2 + tb.loc[condition_australia_1900, "regime_redux_row_owid"] = 2 tb.loc[condition_australia_1900, "regime_amb_row_owid"] = 8 # The following are other candidates, but we discarded them because there are too many years missing. @@ -128,6 +53,10 @@ def run(dest_dir: str) -> None: # I favor no imputation because of six years of missing data, and even though one criterion for electoral autocracy is not met, the country may have met the criteria for democracy (if unlikely), thereby overriding the former. # %% + # 0. checks + + # For each country: + # 2. # %% Set index tb = tb.set_index(["country", "year"], verify_integrity=True) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml index 2e9065401a2..2c0f3a82b34 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml @@ -53,7 +53,7 @@ year_max: 1970 annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" - country: Bangladesh - country_impute: Pakistan + country_impute: India year_min: 1789 year_max: 1946 annotation: |- @@ -371,7 +371,7 @@ # NORTH KOREA (1789-1944) - country: North Korea - country_impute: Korea + country_impute: South Korea year_min: 1789 year_max: 1910 annotation: |- @@ -463,7 +463,7 @@ # SLOVAKIA (1789-1992) - country: Slovakia - country_impute: Austria-Hungary + country_impute: Hungary year_min: 1789 year_max: 1918 annotation: |- @@ -472,8 +472,6 @@ country_impute: Czechia year_min: 1919 year_max: 1992 - annotation: |- - Imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). # SLOVENIA (1789-1988) - country: Slovenia diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json index 25b636f9780..cb8944dbf1c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -102,7 +102,6 @@ "Mauritania": "Mauritania", "Mauritius": "Mauritius", "Mexico": "Mexico", - "Modena": "Duchy of Modena and Reggio", "Moldova": "Moldova", "Mongolia": "Mongolia", "Montenegro": "Montenegro", @@ -126,7 +125,6 @@ "Parma": "Duchy of Parma and Piacenza", "Peru": "Peru", "Philippines": "Philippines", - "Piedmont-Sardinia": "Kingdom of Sardinia", "Poland": "Poland", "Portugal": "Portugal", "Qatar": "Qatar", @@ -136,7 +134,6 @@ "Rwanda": "Rwanda", "Sao Tome and Principe": "Sao Tome and Principe", "Saudi Arabia": "Saudi Arabia", - "Saxony": "Kingdom of Saxony", "Senegal": "Senegal", "Serbia": "Serbia", "Seychelles": "Seychelles", @@ -167,8 +164,8 @@ "Trinidad and Tobago": "Trinidad and Tobago", "Tunisia": "Tunisia", "Turkmenistan": "Turkmenistan", - "Tuscany": "Grand Duchy of Tuscany", - "Two Sicilies": "Kingdom of the Two Sicilies", + "Tuscany": "Tuscany", + "Two Sicilies": "Two Sicilies", "Uganda": "Uganda", "Ukraine": "Ukraine", "United Arab Emirates": "United Arab Emirates", @@ -190,6 +187,7 @@ "Hesse-Darmstadt": "Hesse Grand Ducal", "Hesse-Kassel": "Hesse Electoral", "Mecklenburg Schwerin": "Mecklenburg Schwerin", + "Nassau": "Duchy of Nassau", "Oldenburg": "Oldenburg", "Palestine/British Mandate": "Palestine", "Papal States": "Vatican", @@ -197,5 +195,8 @@ "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", "The Gambia": "Gambia", "T\u00fcrkiye": "Turkey", - "W\u00fcrtemberg": "Kingdom of Wurttemberg" + "W\u00fcrtemberg": "Wurttemberg", + "Piedmont-Sardinia": "Piedmont-Sardinia", + "Saxony": "Saxony", + "Modena": "Modena" } diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index 4a4bc7c100e..cb60f1740c9 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -1,12 +1,87 @@ """Code equivalent to clean step (STATA). -ref: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_clean.do +ref: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_do """ -from typing import Union +from copy import deepcopy +from typing import Union, cast import numpy as np from owid.catalog import Table +from etl.data_helpers import geo +from etl.helpers import PathFinder + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + + +def run(tb: Table) -> Table: + tb = cast(Table, tb) + tb = initial_cleaning(tb) + + # While the head-of-government indicators generally should refer to the one in office on December 31, v2exfemhog seems to (occasionally?) refer to other points during the year. For most purposes, it makes sense to consistently refer to December 31, so I am recoding here. + tb = clean_female_flag(tb) + + # Harmonize country names + tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) + + # Sort + tb = tb.sort_values(["country", "year"]) + + # Copy origins (some indicators will loose their 'origins' in metadata) + origins = deepcopy(tb["country"].metadata.origins) + + # %% Create expanded and refined Regimes of the World indicator + # (L76-L94) Create indicators for multi-party elections, and free and fair elections + tb = estimate_mulpar_indicators(tb) + # (L96-L109) Create indicators for multi-party executive elections, and multi-party executive elections with imputed values between election-years: + tb = estimate_ex_indicators(tb) + # (L109-L122) Create indicators for multi-party legislative elections, and multi-party legislative elections with imputed values between election-years + tb = estimate_leg_indicators(tb) + # (L122-L141) Create indicators for multi-party head of state elections with imputed values between election-years + tb = estimate_hos_indicators(tb) + # (L141-L167) Create indicators for multi-party head of government elections with imputed values between election-years + tb = estimate_hog_indicators(tb) + # (L167-L175) Create indicators for multi-party executive and legislative elections with imputed values between election-years + tb = estimate_exleg_indicators(tb) + # (L177-L201) Create indicator for multi-party head of executive elections with imputed values between election-years + tb = estimate_hoe_indicators(tb) + # (L202-L300) Create dichotomous indicators for classification criteria + tb = estimate_dichotomous_indicators(tb) + # (L302-L314) Create indicators for Regimes of the World with expanded coverage and minor changes to coding + tb = estimate_row_indicators(tb) + + # %% (L322-L389) Compare our and standard RoW coding + tb = compare_with_row_coding(tb) + + # %% (L389-L401) Finalize expanded and refined Regimes of the World indicator with ambiguous categories + tb = add_regime_amb_row(tb) + # (L419-L424) Create reduced version of political regimes, only distinguishing between closed autocracies, electoral autocracies, and electoral democracies (including liberal democracies) + tb["regime_redux_row_owid"] = tb["regime_row_owid"].replace({3: 2}) + + # %% Drop and rename columns + # (L416) Drop irrelevant columns now + tb = drop_columns(tb) + # (L427-L669) Rename columns of interest + tb = rename_columns(tb) + + # %% Ratio as share (share of adult citizens with vote right) + tb["suffr_vdem"] = tb["suffr_vdem"] * 100 + + # %% Gender indicators + # Create variable identifying gender of chief executive + tb = estimate_gender_hoe_indicator(tb) + # Estimate gender of HOG + tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] + tb = tb.drop(columns=["v2exhoshog"]) + + # %% Bring origins back + columns = [col for col in tb.columns if col not in ["country", "year"]] + for col in columns: + tb[col].metadata.origins = origins + + return tb + def initial_cleaning(tb: Table) -> Table: """Initial data cleaning.""" diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py index 1a42c2bdd97..2bc6301b13a 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -1,6 +1,27 @@ import numpy as np import pandas as pd -from owid.catalog import Table +import yaml +from owid.catalog.tables import Table, concat + +from etl.helpers import PathFinder + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + +# IMPUTE: We will infer indicator values for some countries based on their historical equivalences. +path = paths.directory / "countries_impute.yml" +COUNTRIES_IMPUTE = yaml.safe_load(path.read_text()) + +# Expected overlaps +IMPUTED_OVERLAPS_EXPECTED = { + "Belgium": 2, + "Finland": 54, + "Kazakhstan": 1, + "Pakistan": 24, + "Serbia": 29, + "Slovakia": 6, + "Uzbekistan": 47, +} def expand_observations(tb: Table) -> Table: @@ -29,3 +50,49 @@ def expand_observations(tb: Table) -> Table: # Type of `year` tb["year"] = tb["year"].astype("int") return tb + + +def impute(tb: Table) -> Table: + """Impute values.""" + tb_imputed = [] + for imp in impute.COUNTRIES_IMPUTE: + if "country_impute" in imp: + print(imp["country"]) + + # Create a new subdataframe, and checkd + tb_ = tb.loc[ + (tb["country"] == imp["country_impute"]) + & (tb["year"] >= imp["year_min"]) + & (tb["year"] <= imp["year_max"]) + ].copy() + # Sanity checks + assert tb_.shape[0] > 0, f"No data found for {imp['country_impute']}" + assert tb_["year"].max() == imp["year_max"], f"Missing years (max check) for {imp['country_impute']}" + assert tb_["year"].min() == imp["year_min"], f"Missing years (min check) for {imp['country_impute']}" + + # Finish prep of subdataframe + tb_ = tb_.rename( + columns={ + "country": "regime_imputed_country", + } + ) + tb_["regime_imputed"] = True + tb_["country"] = imp["country"] + + # Check if there are overlaps; if so, and as expected, drop + if not (merged := tb.merge(tb_, on=["country", "year"], how="inner")).empty: + assert imp["country"] in IMPUTED_OVERLAPS_EXPECTED, f"Unexpected overlap for {imp['country']}" + assert ( + len(merged) == IMPUTED_OVERLAPS_EXPECTED[imp["country"]] + ), f"Unexpected overlap for {imp['country']}" + # Drop + tb_ = tb_[~tb_["year"].isin(merged["year"])] + + tb_imputed.append(tb_) + + tb = concat(tb_imputed + [tb], ignore_index=True) + + # Check unique values + tb = tb.set_index(["country", "year"], verify_integrity=True).sort_index().reset_index() + + return tb diff --git a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py index 4f5b353c5ad..a75604d3ce1 100644 --- a/etl/steps/data/meadow/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/meadow/democracy/2024-03-07/vdem.py @@ -216,6 +216,8 @@ "v2xnp_pres", "v2xnp_pres_codehigh", "v2xnp_pres_codelow", + # Historical name + "histname", ] From fa73ac1e9a7087cf0273b858705a6175b0f1dab6 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 22 Mar 2024 16:24:08 +0100 Subject: [PATCH 19/62] hotfix --- .../data/garden/democracy/2024-03-07/vdem/vdem_impute.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py index 2bc6301b13a..a00392f48ba 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -52,10 +52,10 @@ def expand_observations(tb: Table) -> Table: return tb -def impute(tb: Table) -> Table: +def run(tb: Table) -> Table: """Impute values.""" tb_imputed = [] - for imp in impute.COUNTRIES_IMPUTE: + for imp in COUNTRIES_IMPUTE: if "country_impute" in imp: print(imp["country"]) @@ -90,9 +90,9 @@ def impute(tb: Table) -> Table: tb_imputed.append(tb_) - tb = concat(tb_imputed + [tb], ignore_index=True) + tb = concat(tb_imputed + [tb], ignore_index=True) # Check unique values - tb = tb.set_index(["country", "year"], verify_integrity=True).sort_index().reset_index() + tb.format(underscore=False).reset_index() return tb From 7cde990b83aa017af2147e12f522cfe30888e21a Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 22 Mar 2024 19:44:22 +0100 Subject: [PATCH 20/62] wip: vdem garden --- .../democracy/2024-03-07/vdem/__init__.py | 24 +- .../democracy/2024-03-07/vdem/vdem.meta.yml | 982 +++++++++++++++++- .../democracy/2024-03-07/vdem/vdem_impute.py | 18 +- .../democracy/2024-03-07/vdem/vdem_refine.py | 122 +++ 4 files changed, 1085 insertions(+), 61 deletions(-) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 381f1d8e710..84803d1d827 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -4,6 +4,7 @@ import vdem_clean as clean # VDEM's cleaning library import vdem_impute as impute # VDEM's imputing library +import vdem_refine as refine # VDEM's imputing library from owid.catalog import Table from etl.helpers import PathFinder, create_dataset @@ -38,28 +39,13 @@ def run(dest_dir: str) -> None: # The following lines concern imputing steps. # Equivalent to: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do - # %% Impute values from adjacent years - # Conditions for Australia and the year 1900 - condition_australia_1900 = (tb["country"] == "Australia") & (tb["year"] == 1900) - # Perform replacements (is this just based on 1899?) - tb.loc[condition_australia_1900, "regime_row_owid"] = 3 - tb.loc[condition_australia_1900, "regime_redux_row_owid"] = 2 - tb.loc[condition_australia_1900, "regime_amb_row_owid"] = 8 + tb = impute.run(tb) - # The following are other candidates, but we discarded them because there are too many years missing. - # - Honduras 1922-1933 (12 years missing) - # I favor no imputation because of 12 years of missing data, and the country may have met the criteria for democracy. - # - Peru 1886-1891 (6 years missing) - # I favor no imputation because of six years of missing data, and even though one criterion for electoral autocracy is not met, the country may have met the criteria for democracy (if unlikely), thereby overriding the former. - - # %% - # 0. checks - - # For each country: - # 2. + # %% PART 3: REFINE + tb = refine.run(tb) # %% Set index - tb = tb.set_index(["country", "year"], verify_integrity=True) + tb = tb.format() # %% Save # diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 8dcee25ca3f..e11dd38d6e3 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -1,53 +1,955 @@ -# NOTE: To learn more about the fields, hover over their names. definitions: common: presentation: topic_tags: - Democracy - -# Learn more about the available fields: -# http://docs.owid.io/projects/etl/architecture/metadata/reference/ dataset: + title: V-Dem Country-Year (Full + Others) update_period_days: 365 - tables: vdem: + title: V-Dem Country-Year (Full + Others) + description: |- + The Varieties of Democracy (V-Dem) project publishes data and research on democracy and human rights. + + It acknowledges that democracy can be characterized differently and measures electoral, liberal, participatory, deliberative, and egalitarian characterizations of democracy. + + The project relies on evaluations by around 3,500 country experts and supplementary work by its researchers to assess political institutions and the protection of rights. + + The project is managed by the V-Dem Institute, based at the University of Gothenburg in Sweden. + + This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. variables: - # testing_variable: - # title: Testing variable title - # unit: arbitrary units - # short_unit: au - # description_short: Short description of testing variable. - # description_processing: Description of processing of testing variable. - # description_key: List of key points about the indicator. - # description_from_producer: Description of testing variable from producer. - # processing_level: minor - # presentation: - # attribution: - # attribution_short: - # faqs: - # grapher_config: - # title_public: - # title_variant: - # topic_tags: - # display: - # color: - # conversionFactor: 1 - # description: - # entityAnnotationsMap: Test annotation - # includeInTable: - # isProjection: false - # name: Testing variable - # numDecimalPlaces: 0 - # shortUnit: au - # tableDisplay: - # hideAbsoluteChange: - # hideRelativeChange: - # tolerance: 0 - # unit: arbitrary units - # yearIsDay: false - # zeroDay: - {} + regime_imputed_country: + unit: '' + + histname: + unit: '' + + electdem_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + electdem_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + electdem_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + libdem_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + libdem_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + libdem_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + participdem_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + participdem_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + participdem_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + delibdem_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + delibdem_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + delibdem_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + egaldem_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + egaldem_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + egaldem_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + freeexpr_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + freeexpr_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + freeexpr_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + freeassoc_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + freeassoc_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + freeassoc_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + suffr_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + electfreefair_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + electfreefair_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + electfreefair_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + electoff_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + lib_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + lib_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + lib_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + indiv_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + indiv_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + indiv_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + judicial_constr_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + judicial_constr_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + judicial_constr_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + legis_constr_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + legis_constr_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + legis_constr_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + particip_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + particip_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + particip_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + civsoc_particip_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + civsoc_particip_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + civsoc_particip_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + dirpop_vote_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + locelect_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + locelect_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + locelect_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + regelect_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + regelect_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + regelect_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + delib_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + delib_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + delib_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + egal_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + egal_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + egal_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + equal_rights_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + equal_rights_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + equal_rights_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + equal_access_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + equal_access_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + equal_access_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + equal_res_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + equal_res_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + equal_res_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + turnout_vdem: + unit: '' + display: + numDecimalPlaces: 2 + + wom_hos_vdem: + unit: '' + display: + numDecimalPlaces: 0 + + wom_hog_vdem: + unit: '' + display: + numDecimalPlaces: 0 + + corr_leg_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + corr_leg_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + corr_leg_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + wom_parl_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + justified_polch_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + justified_polch_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + justified_polch_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + justcomgd_polch_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + justcomgd_polch_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + justcomgd_polch_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + counterarg_polch_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + counterarg_polch_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + counterarg_polch_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + elitecons_polch_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + elitecons_polch_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + elitecons_polch_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + soccons_polch_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + soccons_polch_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + soccons_polch_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + corr_jud_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + corr_jud_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + corr_jud_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + public_admin_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + public_admin_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + public_admin_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_civ_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_civ_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_civ_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + dom_auton_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + dom_auton_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + dom_auton_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + int_auton_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + int_auton_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + int_auton_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + terr_contr_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + terr_contr_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + terr_contr_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_pow_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_pow_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + socgr_pow_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + personalism_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + personalism_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + personalism_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + civ_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + civ_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + civ_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + priv_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + priv_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + priv_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + pol_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + pol_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + pol_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + phys_integr_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + phys_integr_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + phys_integr_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + corruption_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + corruption_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + corruption_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + corr_publsec_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + corr_publsec_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + corr_publsec_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + corr_exec_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + corr_exec_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + corr_exec_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + wom_emp_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + wom_emp_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + wom_emp_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_libs_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_libs_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_libs_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_soc_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_soc_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_soc_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + wom_pol_par_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + wom_pol_par_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + wom_pol_par_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + rule_of_law_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + rule_of_law_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + rule_of_law_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + civ_soc_str_vdem: + unit: '' + display: + numDecimalPlaces: 3 + + civ_soc_str_vdem_low: + unit: '' + display: + numDecimalPlaces: 3 + + civ_soc_str_vdem_high: + unit: '' + display: + numDecimalPlaces: 3 + + goveffective_vdem_wbgi: + unit: '' + display: + numDecimalPlaces: 3 + + corruption_cpi: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_hoe_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_hoe_high_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_hoe_low_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electdem_dich_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electdem_dich_high_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electdem_dich_low_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + electfreefair_row: + unit: '' + display: + numDecimalPlaces: 0 + + electfreefair_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + electfreefair_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + lib_dich_row: + unit: '' + display: + numDecimalPlaces: 0 + + lib_dich_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + lib_dich_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_m_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_m_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_m_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_w_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_w_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_w_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + transplaws_row: + unit: '' + display: + numDecimalPlaces: 0 + + transplaws_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + transplaws_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_leg_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_leg_high_row: + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_leg_low_row: + unit: '' + display: + numDecimalPlaces: 0 + + regime_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + regime_amb_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + regime_redux_row_owid: + unit: '' + display: + numDecimalPlaces: 0 + + wom_hoe_vdem: + unit: '' + display: + numDecimalPlaces: 0 + + regime_imputed: + unit: '' + display: + numDecimalPlaces: 0 diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py index a00392f48ba..8d43d2cb419 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -54,11 +54,24 @@ def expand_observations(tb: Table) -> Table: def run(tb: Table) -> Table: """Impute values.""" + # %% Impute values from adjacent years + # Conditions for Australia and the year 1900 + condition_australia_1900 = (tb["country"] == "Australia") & (tb["year"] == 1900) + # Perform replacements (is this just based on 1899?) + tb.loc[condition_australia_1900, "regime_row_owid"] = 3 + tb.loc[condition_australia_1900, "regime_redux_row_owid"] = 2 + tb.loc[condition_australia_1900, "regime_amb_row_owid"] = 8 + + # The following are other candidates, but we discarded them because there are too many years missing. + # - Honduras 1922-1933 (12 years missing) + # I favor no imputation because of 12 years of missing data, and the country may have met the criteria for democracy. + # - Peru 1886-1891 (6 years missing) + # I favor no imputation because of six years of missing data, and even though one criterion for electoral autocracy is not met, the country may have met the criteria for democracy (if unlikely), thereby overriding the former. + + # %% Impute values based on historical equivalences tb_imputed = [] for imp in COUNTRIES_IMPUTE: if "country_impute" in imp: - print(imp["country"]) - # Create a new subdataframe, and checkd tb_ = tb.loc[ (tb["country"] == imp["country_impute"]) @@ -81,6 +94,7 @@ def run(tb: Table) -> Table: # Check if there are overlaps; if so, and as expected, drop if not (merged := tb.merge(tb_, on=["country", "year"], how="inner")).empty: + paths.log.info(f"Imputing data for {imp['country']}") assert imp["country"] in IMPUTED_OVERLAPS_EXPECTED, f"Unexpected overlap for {imp['country']}" assert ( len(merged) == IMPUTED_OVERLAPS_EXPECTED[imp["country"]] diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py new file mode 100644 index 00000000000..db63586a24e --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py @@ -0,0 +1,122 @@ +import numpy as np +import pandas as pd +from owid.catalog import Table, Variable + + +def run(tb: Table) -> Table: + tb = add_years_in_democracy(tb) + tb = add_categories_years_in_democracy(tb) + tb = add_categories_women_in_parliament(tb) + return tb + + +def add_years_in_democracy(tb: Table) -> Table: + """Add years in democracy. + + Two types of counters are generated: + - Number of years consecutively: Counts number of years consecutively in democracy. + - Number of years: Counts all the years that the country has been a democracy. + + We consider two types of democracies: + + - Electoral democracy + - Liberal democracy + """ + + def _add_regime_type(tb: Table, column_new: str, threshold: int) -> Table: + tb[column_new] = tb["regime_row_owid"] + tb.loc[tb["regime_row_owid"] <= threshold, column_new] = 0 + tb.loc[tb["regime_row_owid"] > threshold, column_new] = 1 + return tb + + # Add flags + tb = _add_regime_type(tb, "regime_electdem", 1) + tb = _add_regime_type(tb, "regime_libdem", 2) + + # Add age of democracy + tb["num_years_in_electdem_consecutive"] = tb.groupby(["country", tb["regime_electdem"].fillna(0).eq(0).cumsum()])[ + "regime_electdem" + ].cumsum() + tb["num_years_in_libdem_consecutive"] = tb.groupby(["country", tb["regime_libdem"].fillna(0).eq(0).cumsum()])[ + "regime_libdem" + ].cumsum() + # Add experience with democracy + tb["num_years_in_electdem"] = tb.groupby("country")["regime_electdem"].cumsum() + tb["num_years_in_libdem"] = tb.groupby("country")["regime_libdem"].cumsum() + + return tb + + +def add_categories_years_in_democracy(tb: Table) -> Table: + """Add categories for "years in democracy" indicators. + + We group countries in categories based on how long they've been - consecutively - a democracy (liberal and electoral). + """ + bins = [ + 0, + 18, + 30, + 60, + 90, + np.inf, + ] + labels = [ + "1-18", + "19-30", + "31-60", + "61-90", + "91+", + ] + # 1. Create variable for age group of electoral demcoracies: + column = "num_years_in_electdem" + column_cat = f"{column}_cat" + tb[column_cat] = pd.cut(tb[column], bins=bins, labels=labels) + tb[column_cat] = Variable(tb[column_cat]).copy_metadata(tb.loc[:, column]) + + ## Add additional categories + tb[column_cat] = tb[column_cat].cat.add_categories(["electoral autocracy", "closed autocracy"]) + tb.loc[(tb["regime_row_owid"] == 1) & tb[column_cat].isna(), column_cat] = "electoral autocracy" + tb.loc[(tb["regime_row_owid"] == 0) & tb[column_cat].isna(), column_cat] = "closed autocracy" + + # 2. Create variable for age group of liberal democracies + column = "num_years_in_libdem" + column_cat = f"{column}_cat" + tb[column_cat] = pd.cut(tb[column], bins=bins, labels=labels) + tb[column_cat] = Variable(tb[column_cat]).copy_metadata(tb.loc[:, column]) + + ## Add additional categories + tb[column_cat] = tb[column_cat].cat.add_categories( + ["electoral democracy", "electoral autocracy", "closed autocracy"] + ) + tb.loc[(tb["regime_row_owid"] == 2) & tb[column_cat].isna(), column_cat] = "electoral democracy" + tb.loc[(tb["regime_row_owid"] == 1) & tb[column_cat].isna(), column_cat] = "electoral autocracy" + tb.loc[(tb["regime_row_owid"] == 0) & tb[column_cat].isna(), column_cat] = "closed autocracy" + + return tb + + +def add_categories_women_in_parliament(tb: Table) -> Table: + """Add categorical variable on the percentage of women in parliament.""" + bins = [ + 0, + 10, + 20, + 30, + 40, + 50, + np.inf, + ] + labels = [ + "0-10% women", + "10-20% women", + "20-30% women", + "30-40% women", + "40-50% women", + "50%+ women", + ] + column = "wom_parl_vdem" + column_cat = f"{column}_cat" + tb[column_cat] = pd.cut(tb[column], bins=bins, labels=labels) + tb[column_cat] = Variable(tb[column_cat]).copy_metadata(tb.loc[:, column]) + + return tb From 40b41935520b63bafdc8c664d9a408b669b553c7 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 22 Mar 2024 19:52:08 +0100 Subject: [PATCH 21/62] wip: grapher --- dag/democracy.yml | 2 + .../data/grapher/democracy/2024-03-07/vdem.py | 42 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 etl/steps/data/grapher/democracy/2024-03-07/vdem.py diff --git a/dag/democracy.yml b/dag/democracy.yml index b880f94d4f0..14f7435c2d3 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -14,3 +14,5 @@ steps: - snapshot://democracy/2024-03-18/vdem.zip data://garden/democracy/2024-03-07/vdem: - data://meadow/democracy/2024-03-07/vdem + data://grapher/democracy/2024-03-07/vdem: + - data://garden/democracy/2024-03-07/vdem diff --git a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py new file mode 100644 index 00000000000..3d7ef032707 --- /dev/null +++ b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py @@ -0,0 +1,42 @@ +"""Load a garden dataset and create a grapher dataset.""" + +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + + +def run(dest_dir: str) -> None: + # + # Load inputs. + # + # Load garden dataset. + ds_garden = paths.load_dataset("vdem") + + # Read table from garden dataset. + tb = ds_garden["vdem"] + + # + # Process data. + # + ## Special indicator values renamings + ## We add labels for these indicators. Otherwise they'd have the value zero (which is correct). Labelling makes them more informative. + tb["num_years_in_electdem_consecutive"] = tb["num_years_in_electdem_consecutive"].astype("string") + tb.loc[tb["regime_row_owid"] == 0, "num_years_in_electdem_consecutive"] = "closed autocracy" + tb.loc[tb["regime_row_owid"] == 1, "num_years_in_electdem_consecutive"] = "electoral autocracy" + + tb["num_years_in_libdem_consecutive"] = tb["num_years_in_libdem_consecutive"].astype("string") + tb.loc[tb["regime_row_owid"] == 0, "num_years_in_libdem_consecutive"] = "closed autocracy" + tb.loc[tb["regime_row_owid"] == 1, "num_years_in_libdem_consecutive"] = "electoral autocracy" + tb.loc[tb["regime_row_owid"] == 2, "num_years_in_libdem_consecutive"] = "electoral democracy" + + # + # Save outputs. + # + # Create a new grapher dataset with the same metadata as the garden dataset. + ds_grapher = create_dataset( + dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_garden.metadata + ) + + # Save changes in the new grapher dataset. + ds_grapher.save() From 9fa4386bb679c18086df51b74dda85a6d29a5c16 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Sat, 23 Mar 2024 00:07:50 +0100 Subject: [PATCH 22/62] wip --- dag/democracy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dag/democracy.yml b/dag/democracy.yml index 14f7435c2d3..384ded03abc 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -14,5 +14,5 @@ steps: - snapshot://democracy/2024-03-18/vdem.zip data://garden/democracy/2024-03-07/vdem: - data://meadow/democracy/2024-03-07/vdem - data://grapher/democracy/2024-03-07/vdem: - - data://garden/democracy/2024-03-07/vdem + # data://grapher/democracy/2024-03-07/vdem: + # - data://garden/democracy/2024-03-07/vdem From 705dae8a74ffb0b9ccf23ed65c3157d0bdac851f Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 27 Mar 2024 00:47:24 +0100 Subject: [PATCH 23/62] wip: metadata --- .../democracy/2024-03-07/vdem/__init__.py | 61 ++ .../democracy/2024-03-07/vdem/vdem.meta.yml | 659 +++++++++++++++++- snapshots/democracy/2024-03-18/vdem.zip.dvc | 4 +- 3 files changed, 718 insertions(+), 6 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 84803d1d827..4f8725bfd4b 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -44,6 +44,9 @@ def run(dest_dir: str) -> None: # %% PART 3: REFINE tb = refine.run(tb) + # %% Tweak citation full for some indicators + tb = add_citation_full(tb) + # %% Set index tb = tb.format() @@ -61,3 +64,61 @@ def run(dest_dir: str) -> None: # %% +def add_citation_full(tb: Table) -> Table: + """Add additional citations. + + Some indicators require additional citation information. + """ + CITATION_COPPEDGE = "Coppedge et al. (2015, V-Dem Working Paper Series 2015:6)" + CITATION_PEMSTEIN = "Pemstein et al. (2024, V-Dem Working Paper Series 2024:21)" + CITATION_SIGMAN = "Sigman et al. (2015, V-Dem Working Paper Series 2015:22)" + DIMENSIONS = ["", "_low", "_high"] + citation_coppedge = [ + *[f"libdem_vdem{dim}" for dim in DIMENSIONS], + *[f"participdem_vdem{dim}" for dim in DIMENSIONS], + *[f"delibdem_vdem{dim}" for dim in DIMENSIONS], + *[f"lib_vdem{dim}" for dim in DIMENSIONS], + *[f"particip_vdem{dim}" for dim in DIMENSIONS], + *[f"delib_vdem{dim}" for dim in DIMENSIONS], + ] + citation_pemstein = [ + *[f"freeexpr_vdem{dim}" for dim in DIMENSIONS], + *[f"freeassoc_vdem{dim}" for dim in DIMENSIONS], + *[f"electfreefair_vdem{dim}" for dim in DIMENSIONS], + *[f"indiv_libs_vdem{dim}" for dim in DIMENSIONS], + *[f"judicial_constr_vdem{dim}" for dim in DIMENSIONS], + *[f"legis_constr_vdem{dim}" for dim in DIMENSIONS], + *[f"civsoc_particip_vdem{dim}" for dim in DIMENSIONS], + *[f"corr_leg_vdem{dim}" for dim in DIMENSIONS], + *[f"justified_polch_vdem{dim}" for dim in DIMENSIONS], + *[f"justcomgd_polch_vdem{dim}" for dim in DIMENSIONS], + *[f"counterarg_polch_vdem{dim}" for dim in DIMENSIONS], + *[f"elitecons_polch_vdem{dim}" for dim in DIMENSIONS], + *[f"soccons_polch_vdem{dim}" for dim in DIMENSIONS], + *[f"corr_jud_vdem{dim}" for dim in DIMENSIONS], + *[f"public_admin_vdem{dim}" for dim in DIMENSIONS], + *[f"socgr_civ_libs_vdem{dim}" for dim in DIMENSIONS], + *[f"dom_auton_vdem{dim}" for dim in DIMENSIONS], + *[f"int_auton_vdem{dim}" for dim in DIMENSIONS], + *[f"socgr_pow_vdem{dim}" for dim in DIMENSIONS], + *[f"priv_libs_vdem{dim}" for dim in DIMENSIONS], + *[f"pol_libs_vdem{dim}" for dim in DIMENSIONS], + ] + citation_full = { + **{f"electdem_vdem{dim}": "Teorell et al. (2019)" for dim in DIMENSIONS}, + **{f"egaldem_vdem{dim}": CITATION_SIGMAN for dim in DIMENSIONS}, + **{f"egal_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_COPPEDGE}" for dim in DIMENSIONS}, + **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017); {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"equal_res_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{ + f"description_from_producer{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" + for dim in DIMENSIONS + }, + **{i: CITATION_COPPEDGE for i in citation_coppedge}, + **{i: CITATION_PEMSTEIN for i in citation_pemstein}, + } + for indicator_name, citation_additional in citation_full.items(): + tb[indicator_name].metadata.origins[0].citation_full += f";\n\n{citation_additional}" + + return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index e11dd38d6e3..19068775988 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -23,932 +23,1583 @@ tables: This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. variables: regime_imputed_country: + title: '' unit: '' histname: + title: '' unit: '' + # 2.1 V-Dem High-Level Democracy Indices + + ## 2.1.1 Electoral democracy index electdem_vdem: + title: Electoral democracy index + description_short: '' + description_from_producer: &description_prod_electdem_vdem |- + Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? + Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate’s approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 electdem_vdem_low: + title: "{tables.vdem.variables.electdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_electdem_vdem unit: '' display: numDecimalPlaces: 3 electdem_vdem_high: + title: "{tables.vdem.variables.electdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_electdem_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.1.2 Liberal democracy index libdem_vdem: + title: '' + description_from_producer: &description_prod_libdem_vdem |- + Question: To what extent is the ideal of liberal democracy achieved? + + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 libdem_vdem_low: + title: "{tables.vdem.variables.libdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_libdem_vdem unit: '' display: numDecimalPlaces: 3 libdem_vdem_high: + title: "{tables.vdem.variables.libdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_libdem_vdem unit: '' display: numDecimalPlaces: 3 + # 2.1.3 Participatory democracy index participdem_vdem: + title: Participatory democracy index + description_from_producer: &description_prod_participdem_vdem |- + Question: To what extent is the ideal of participatory democracy achieved? + + Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 participdem_vdem_low: + title: "{tables.vdem.variables.participdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_participdem_vdem unit: '' display: numDecimalPlaces: 3 participdem_vdem_high: + title: "{tables.vdem.variables.participdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_participdem_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.1.4 Deliberative democracy index delibdem_vdem: + title: Deliberative democracy index + description_from_producer: &description_prod_delibdem_vdem |- + Question: To what extent is the ideal of deliberative democracy achieved? + + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 delibdem_vdem_low: + title: "{tables.vdem.variables.delibdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_delibdem_vdem unit: '' display: numDecimalPlaces: 3 delibdem_vdem_high: + title: "{tables.vdem.variables.delibdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_delibdem_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.1.5 Egalitarian democracy index egaldem_vdem: + title: Egalitarian democracy index + description_from_producer: &description_prod_egaldem_vdem |- + Question: To what extent is the ideal of egalitarian democracy achieved? + + Clarification: + The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 egaldem_vdem_low: + title: "{tables.vdem.variables.egaldem_vdem.title} (lower bound)" + description_from_producer: *description_prod_egaldem_vdem unit: '' display: numDecimalPlaces: 3 egaldem_vdem_high: + title: "{tables.vdem.variables.egaldem_vdem.title} (upper bound)" + description_from_producer: *description_prod_egaldem_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.3 Freedom of Expression and Alternative Sources of Information index freeexpr_vdem: + title: Freedom of Expression and Alternative Sources of Information index + description_from_producer: &description_prod_freexpr_vdem |- + Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? + + Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 freeexpr_vdem_low: + title: "{tables.vdem.variables.freeexpr_vdem.title} (lower bound)" + description_from_producer: *description_prod_freexpr_vdem unit: '' display: numDecimalPlaces: 3 freeexpr_vdem_high: + title: "{tables.vdem.variables.freeexpr_vdem.title} (upper bound)" + description_from_producer: *description_prod_freexpr_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.4 Freedom of association thick index freeassoc_vdem: + title: Freedom of association thick index + description_from_producer: &description_prod_freeassoc_vdem |- + Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 freeassoc_vdem_low: + title: "{tables.vdem.variables.freeassoc_vdem.title} (lower bound)" + description_from_producer: *description_prod_freeassoc_vdem unit: '' display: numDecimalPlaces: 3 freeassoc_vdem_high: + title: "{tables.vdem.variables.freeassoc_vdem.title} (upper bound)" + description_from_producer: *description_prod_freeassoc_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.5 Share of population with suffrage suffr_vdem: - unit: '' + title: Share of population with suffrage + description_from_producer: |- + Question: What share of adult citizens as defined by statute has the legal right to vote in national elections? + + Clarification: + This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or ’economic independence’, estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. + unit: '%' display: numDecimalPlaces: 3 + ## 2.2.6 Clean elections index electfreefair_vdem: + title: Clean elections index + description_from_producer: &description_prod_electfreefair_vdem |- + Question: To what extent are elections free and fair? + + Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 electfreefair_vdem_low: + title: "{tables.vdem.variables.electfreefair_vdem.title} (lower bound)" + description_from_producer: *description_prod_electfreefair_vdem unit: '' display: numDecimalPlaces: 3 electfreefair_vdem_high: + title: "{tables.vdem.variables.electfreefair_vdem.title} (upper bound)" + description_from_producer: *description_prod_electfreefair_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.7 Elected officials index electoff_vdem: + title: Elected officials index + description_from_producer: |- + Question: Is the chief executive and legislature appointed through popular elections? + + Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. unit: '' display: numDecimalPlaces: 3 + ## 2.2.8 Liberal component index lib_vdem: + title: Liberal component index + description_from_producer: &description_prod_lib_vdem |- + Question: To what extent is the liberal principle of democracy achieved? + + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 lib_vdem_low: + title: "{tables.vdem.variables.lib_vdem.title} (lower bound)" + description_from_producer: *description_prod_lib_vdem unit: '' display: numDecimalPlaces: 3 lib_vdem_high: + title: "{tables.vdem.variables.lib_vdem.title} (upper bound)" + description_from_producer: *description_prod_lib_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.9 Equality before the law and individual liberty index indiv_libs_vdem: + title: Equality before the law and individual liberty index + description_from_producer: &description_prod_indiv_libs_vdem |- + Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 indiv_libs_vdem_low: + title: "{tables.vdem.variables.indiv_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_indiv_libs_vdem unit: '' display: numDecimalPlaces: 3 indiv_libs_vdem_high: + title: "{tables.vdem.variables.indiv_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_indiv_libs_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.10 Judicial constraints on the executive index judicial_constr_vdem: + title: "Judicial constraints on the executive index" + description_from_producer: &description_prod_judicial_constr_vdem_low |- + Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 judicial_constr_vdem_low: + title: "{tables.vdem.variables.judicial_constr_vdem_low.title} (upper bound)" + description_from_producer: *description_prod_judicial_constr_vdem_low unit: '' display: numDecimalPlaces: 3 judicial_constr_vdem_high: + title: "{tables.vdem.variables.judicial_constr_vdem_low.title} (lower bound)" + description_from_producer: *description_prod_judicial_constr_vdem_low unit: '' display: numDecimalPlaces: 3 + ## 2.2.11 Legislative constraints on the executive index legis_constr_vdem: + title: Legislative constraints on the executive index + description_from_producer: &description_prod_legis_constr_vdem |- + Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? + + Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 legis_constr_vdem_low: + title: "{tables.vdem.variables.legis_constr_vdem.title} (lower bound)" + description_from_producer: *description_prod_legis_constr_vdem unit: '' display: numDecimalPlaces: 3 legis_constr_vdem_high: + title: "{tables.vdem.variables.legis_constr_vdem.title} (upper bound)" + description_from_producer: *description_prod_legis_constr_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.12 Participatory component index particip_vdem: + title: Participatory component index + description_from_producer: &description_prod_particip_vdem |- + Question: To what extent is the participatory principle achieved? + + Clarification: + The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 particip_vdem_low: + title: "{tables.vdem.variables.particip_vdem.title} (lower bound)" + description_from_producer: *description_prod_particip_vdem unit: '' display: numDecimalPlaces: 3 particip_vdem_high: + title: "{tables.vdem.variables.particip_vdem.title} (upper bound)" + description_from_producer: *description_prod_particip_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.13 Civil society participation index civsoc_particip_vdem: + title: Civil society participation index + description_from_producer: &description_prod_civsoc_particip_vdem |- + Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? + + Clarification: + The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + + Scale: + Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 civsoc_particip_vdem_low: + title: "{tables.vdem.variables.civsoc_particip_vdem.title} (lower bound)" + description_from_producer: *description_prod_civsoc_particip_vdem unit: '' display: numDecimalPlaces: 3 civsoc_particip_vdem_high: + title: "{tables.vdem.variables.civsoc_particip_vdem.title} (upper bound)" + description_from_producer: *description_prod_civsoc_particip_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.14 Direct popular vote index dirpop_vote_vdem: + title: Direct popular vote index + description_from_producer: |- + Question: To what extent is the direct popular vote utilized? + + Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 + ## 2.2.15 Local government index locelect_vdem: + title: "Local government index" + description_from_producer: &description_prod_locelect_vdem |- + Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? + + Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 locelect_vdem_low: + title: "{tables.vdem.variables.locelect_vdem.title} (lower bound)" + description_from_producer: *description_prod_locelect_vdem unit: '' display: numDecimalPlaces: 3 locelect_vdem_high: + title: "{tables.vdem.variables.locelect_vdem.title} (upper bound)" + description_from_producer: *description_prod_locelect_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.16 Regional government index regelect_vdem: + title: Regional government index + description_from_producer: &description_prod_regelect_vdem |- + Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? + + Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 regelect_vdem_low: + title: "{tables.vdem.variables.regelect_vdem.title} (lower bound)" + description_from_producer: *description_prod_regelect_vdem unit: '' display: numDecimalPlaces: 3 regelect_vdem_high: + title: "{tables.vdem.variables.regelect_vdem.title} (upper bound)" + description_from_producer: *description_prod_regelect_vdem unit: '' display: numDecimalPlaces: 3 + # 2.2.17 Deliberative component index delib_vdem: + title: Deliberative component index + description_from_producer: &description_prod_delib_vdem |- + Question: To what extent is the deliberative principle of democracy achieved? + + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. + + To measure these features of a polity we try to determine the extent to which political elites give public justifications for their positions on matters of public policy, justify their positions in terms of the public good, acknowledge and respect counter-arguments; and how wide the range of consultation is at elite levels. + + Scale: + Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 delib_vdem_low: + title: "{tables.vdem.variables.delib_vdem.title} (lower bound)" + description_from_producer: *description_prod_delib_vdem unit: '' display: numDecimalPlaces: 3 delib_vdem_high: + title: "{tables.vdem.variables.delib_vdem.title} (upper bound)" + description_from_producer: *description_prod_delib_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.18 Egalitarian component index egal_vdem: + title: Egalitarian component index + description_from_producer: &description_prod_egal_vdem |- + Question: To what extent is the egalitarian principle achieved? + + Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 egal_vdem_low: + title: "{tables.vdem.variables.egal_vdem.title} (lower bound)" + description_from_producer: *description_prod_egal_vdem unit: '' display: numDecimalPlaces: 3 egal_vdem_high: + title: "{tables.vdem.variables.egal_vdem.title} (upper bound)" + description_from_producer: *description_prod_egal_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.19 Equal protection index equal_rights_vdem: + title: Equal protection index + description_from_producer: &description_prod_equal_rights_vdem |- + Question: How equal is the protection of rights and freedoms across social groups by the state? + + Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 equal_rights_vdem_low: + title: "{tables.vdem.variables.equal_rights_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_rights_vdem unit: '' display: numDecimalPlaces: 3 equal_rights_vdem_high: + title: "{tables.vdem.variables.equal_rights_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_rights_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.20 Equal access index equal_access_vdem: + title: Equal access index + description_from_producer: &description_prod_equal_access_vdem |- + Question: How equal is access to power? + + Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 equal_access_vdem_low: + title: "{tables.vdem.variables.equal_access_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_access_vdem unit: '' display: numDecimalPlaces: 3 equal_access_vdem_high: + title: "{tables.vdem.variables.equal_access_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_access_vdem unit: '' display: numDecimalPlaces: 3 + ## 2.2.21 Equal distribution of resources index equal_res_vdem: + title: Equal distribution of resources index + description_from_producer: &description_prod_equal_res_vdem |- + Question: How equal is the distribution of resources? + + Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 equal_res_vdem_low: + title: "{tables.vdem.variables.equal_res_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_res_vdem unit: '' display: numDecimalPlaces: 3 equal_res_vdem_high: + title: "{tables.vdem.variables.equal_res_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_res_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.1.3.3 Election turnout turnout_vdem: - unit: '' + title: Election turnout + description_from_producer: |- + Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? + unit: '%' display: numDecimalPlaces: 2 + # 3.4.2.18 HOS female wom_hos_vdem: + title: HOS female + description_from_producer: |- + If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. unit: '' display: numDecimalPlaces: 0 + ## 3.4.3.16 HOG female wom_hog_vdem: + title: HOG female + description_from_producer: |- + Question: What is the gender of the head of government? + + Clarification: If the head of government is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + + Responses: + 0: Male + 1: Female unit: '' display: numDecimalPlaces: 0 + ## 3.5.1.6 Legislature corrupt activities corr_leg_vdem: + title: Legislature corrupt activities + description_from_producer: &description_prod_corr_leg_vdem |- + Question: Do members of the legislature abuse their position for financial gain? + + Clarification: + This includes any of the following: (a) accepting bribes, (b) helping to obtain government contracts for firms that the legislator (or his/her family/friends/political supporters) own, (c) doing favors for firms in exchange for the opportunity of employment after leaving the legislature, (d) stealing money from the state or from campaign donations for personal use. + + Please make your best estimate, based upon what is known or suspected to be true. + + For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. + + Responses: + 0: Commonly. Most legislators probably engage in these activities. + 1: Often. Many legislators probably engage in these activities. + 2: Sometimes. Some legislators probably engage in these activities. + 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. + 4: Never, or hardly ever. unit: '' display: numDecimalPlaces: 3 corr_leg_vdem_low: + title: "{tables.vdem.variables.corr_leg_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_leg_vdem unit: '' display: numDecimalPlaces: 3 corr_leg_vdem_high: + title: "{tables.vdem.variables.corr_leg_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_leg_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.5.3.7 Lower chamber female legislators wom_parl_vdem: - unit: '' + title: Lower chamber female legislators + description_from_producer: |- + Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? + unit: '%' display: numDecimalPlaces: 3 + ## 3.6.0.1 Reasoned justification justified_polch_vdem: + title: Reasoned justification + description_from_producer: &description_prod_justified_polch_vdem |- + Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + + 0: No justification. Elites almost always only dictate that something should or should not be done, but no reasoning about justification is given. For example, "We must cut spending." + 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] + 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." + 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." unit: '' display: numDecimalPlaces: 3 justified_polch_vdem_low: + title: "{tables.vdem.variables.justified_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_justified_polch_vdem unit: '' display: numDecimalPlaces: 3 justified_polch_vdem_high: + title: "{tables.vdem.variables.justified_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_justified_polch_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.6.0.2 Common good justcomgd_polch_vdem: + title: Common good + description_from_producer: &description_prod_justcomgd_polch_vdem |- + Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + 0: Little or no justification in terms of the common good is usually offered. + 1: Specific business, geographic, group, party, or constituency interests are for the most part offered as justifications. + 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. + 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. + 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. unit: '' display: numDecimalPlaces: 3 justcomgd_polch_vdem_low: + title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_justcomgd_polch_vdem unit: '' display: numDecimalPlaces: 3 justcomgd_polch_vdem_high: + title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_justcomgd_polch_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.6.0.3 Respect counterarguments counterarg_polch_vdem: + title: Respect counterarguments + description_from_producer: &description_prod_counterarg_polch_vdem |- + Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + 0: Counterarguments are not allowed or if articulated, punished. + 1: Counterarguments are allowed at least from some parties, but almost always are ignored. 2: Elites tend to acknowledge counterarguments but then explicitly degrade them by making a negative statement about them or the individuals and groups that propose them. + 3: Elites tend to acknowledge counterarguments without making explicit negative or positive statements about them. + 4: Elites almost always acknowledge counterarguments and explicitly value them, even if they ultimately reject them for the most part. + 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 counterarg_polch_vdem_low: + title: "{tables.vdem.variables.counterarg_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_counterarg_polch_vdem unit: '' display: numDecimalPlaces: 3 counterarg_polch_vdem_high: + title: "{tables.vdem.variables.counterarg_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_counterarg_polch_vdem unit: '' display: numDecimalPlaces: 3 + ### 3.6.0.4 Range of consultation elitecons_polch_vdem: + title: Range of consultation + description_from_producer: &description_prod_elitecons_polch_vdem |- + Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? + + Clarification: Because practices vary greatly from policy to policy, base your answer on the style that is most typical of policymaking. + + Responses: + 0: No consultation. The leader or a very small group (e.g. military council) makes authoritative decisions on their own. + 1: Very little and narrow. Consultation with only a narrow circle of loyal party/ruling elites. 2: Consultation includes the former plus a larger group that is loyal to the government, such as the ruling party's or parties' local executives and/or women, youth and other branches. + 3: Consultation includes the former plus leaders of other parties. + 4: Consultation includes the former plus a select range of society/labor/business representatives. + 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 elitecons_polch_vdem_low: + title: "{tables.vdem.variables.elitecons_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_elitecons_polch_vdem unit: '' display: numDecimalPlaces: 3 elitecons_polch_vdem_high: + title: "{tables.vdem.variables.elitecons_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_elitecons_polch_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.6.0.5 Engaged society soccons_polch_vdem: + title: Engaged society + description_from_producer: &description_prod_soccons_polch_vdem |- + Question: When important policy changes are being considered, how wide and how independent are public deliberations? + + Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. + + Responses: + 0: Public deliberation is never, or almost never allowed. + 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. + 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. + 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. + 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. + 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 soccons_polch_vdem_low: + title: "{tables.vdem.variables.soccons_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_soccons_polch_vdem unit: '' display: numDecimalPlaces: 3 soccons_polch_vdem_high: + title: "{tables.vdem.variables.soccons_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_soccons_polch_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.7.0.6 Judicial corruption decision corr_jud_vdem: + title: Judicial corruption decision + description_from_producer: &description_prod_corr_jud_vdem |- + Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? + + Responses: + 0: Always. + 1: Usually. + 2: About half of the time. 3: Not usually. + 4: Never. + + Scale: Ordinal, converted to interval by the measurement model. + + Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. unit: '' display: numDecimalPlaces: 3 corr_jud_vdem_low: + title: "{tables.vdem.variables.corr_jud_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_jud_vdem unit: '' display: numDecimalPlaces: 3 corr_jud_vdem_high: + title: "{tables.vdem.variables.corr_jud_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_jud_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.8.2.2 Rigorous and impartial public administration public_admin_vdem: + title: Rigorous and impartial public administration + description_from_producer: &description_prod_public_admin_vdem |- + Question: Are public officials rigorous and impartial in the performance of their duties? + + Clarification: + This question focuses on the extent to which public officials generally abide by the law and treat like cases alike, or conversely, the extent to which public administration is characterized by arbitrariness and biases (i.e., nepotism, cronyism, or discrimination). + + The question covers the public officials that handle the cases of ordinary people. If no functioning public administration exists, the lowest score (0) applies. + + Responses: + 0: The law is not respected by public officials. Arbitrary or biased administration of the law is rampant. + 1: The law is weakly respected by public officials. Arbitrary or biased administration of the law is widespread. + 2: The law is modestly respected by public officials. Arbitrary or biased administration of the law is moderate. + 3: The law is mostly respected by public officials. Arbitrary or biased administration of the law is limited. + 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 public_admin_vdem_low: + title: "{tables.vdem.variables.public_admin_vdem.title} (lower bound)" + description_from_producer: *description_prod_public_admin_vdem unit: '' display: numDecimalPlaces: 3 public_admin_vdem_high: + title: "{tables.vdem.variables.public_admin_vdem.title} (upper bound)" + description_from_producer: *description_prod_public_admin_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.8.2.6 Social group equality in respect for civil liberties socgr_civ_libs_vdem: + title: '' + description_from_producer: &description_prod_socgr_civ_libs_vdem |- + Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? + + Clarification: Here, civil liberties are understood to include access to justice, private property rights, freedom of movement, and freedom from forced labor. + + Responses: + 0: Members of some social groups enjoy much fewer civil liberties than the general population. 1: Members of some social groups enjoy substantially fewer civil liberties than the general population. + 2: Members of some social groups enjoy moderately fewer civil liberties than the general population. + 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 socgr_civ_libs_vdem_low: + title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_socgr_civ_libs_vdem unit: '' display: numDecimalPlaces: 3 socgr_civ_libs_vdem_high: + title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_socgr_civ_libs_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.9.0.1 Domestic autonomy dom_auton_vdem: + title: Domestic autonomy + description_from_producer: &description_prod_dom_auton_vdem |- + Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? + + Clarification: The question of domestic autonomy does not include restrictions emanating from treaties (e.g., NATO), international organizations (e.g., the WTO), or confederations (e.g., the European Union) if these agreements are freely negotiated by the state and if the state is free to exit from that treaty, organization, or confederation. Nor does it include restrictions on policymaking emanating from international market forces and trans-national corporations. + + Responses: + 0: Non-autonomous. National level authority is exercised by an external power, either by law or in practice. The most common examples of this are direct colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). It also includes situations in which domestic actors provide de jure cover for de facto control by a foreign power (e.g. Vichy France). However, control of some part of the territory of a state by an enemy during war is not considered control by external actors if the sovereign government remains on scene and continues to wage conventional war (e.g., the USSR during WW II). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to rule, decides who can or cannot rule through formal rules or informal understandings, or precludes certain policies through explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples include Soviet "satellite" states in Eastern Europe, and situations where colonial powers grant limited powers of national self- government to their possessions (e.g., protectorates and limited home government). + 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. + + Scale: Ordinal, converted to interval by the measurement model. unit: '' display: numDecimalPlaces: 3 dom_auton_vdem_low: + title: "{tables.vdem.variables.dom_auton_vdem.title} (lower bound)" + description_from_producer: *description_prod_dom_auton_vdem unit: '' display: numDecimalPlaces: 3 dom_auton_vdem_high: + title: "{tables.vdem.variables.dom_auton_vdem.title} (upper bound)" + description_from_producer: *description_prod_dom_auton_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.9.0.2 International autonomy int_auton_vdem: + title: International autonomy + description_from_producer: &description_prod_int_auton_vdem |- + Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? + + Responses: + 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). + 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. unit: '' display: numDecimalPlaces: 3 int_auton_vdem_low: + title: "{tables.vdem.variables.int_auton_vdem.title} (lower bound)" + description_from_producer: *description_prod_int_auton_vdem unit: '' display: numDecimalPlaces: 3 int_auton_vdem_high: + title: "{tables.vdem.variables.int_auton_vdem.title} (upper bound)" + description_from_producer: *description_prod_int_auton_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.9.0.3 State authority over territory terr_contr_vdem: - unit: '' + title: State authority over territory + description_from_producer: &description_prod_terr_contr_vdem |- + Question: Over what percentage (%) of the territory does the state have effective control? + + Clarification: + With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. + + By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. + unit: '%' display: numDecimalPlaces: 3 terr_contr_vdem_low: + title: "{tables.vdem.variables.terr_contr_vdem.title} (lower bound)" + description_from_producer: *description_prod_terr_contr_vdem unit: '' display: numDecimalPlaces: 3 terr_contr_vdem_high: + title: "{tables.vdem.variables.terr_contr_vdem.title} (upper bound)" + description_from_producer: *description_prod_terr_contr_vdem unit: '' display: numDecimalPlaces: 3 + ## 3.12.0.2 Power distributed by social group socgr_pow_vdem: + title: Power distributed by social group + description_from_producer: &description_prod_socgr_pow_vdem |- + Question: Is political power distributed according to social groups? + + Clarification: A social group is differentiated within a country by caste, ethnicity, language, race, region, religion, or some combination thereof. (It does not include identities grounded in sexual orientation or socioeconomic status.) Social group identity is contextually defined and is likely to vary across countries and through time. Social group identities are also likely to cross-cut, so that a given person could be defined in multiple ways, i.e., as part of multiple groups. Nonetheless, at any given point in time there are social groups within a society that are understood — by those residing within that society — to be different, in ways that may be politically relevant. + + Responses: + 0: Political power is monopolized by one social group comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 1: Political power is monopolized by several social groups comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. + 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. unit: '' display: numDecimalPlaces: 3 socgr_pow_vdem_low: + title: "{tables.vdem.variables.socgr_pow_vdem.title} (lower bound)" + description_from_producer: *description_prod_socgr_pow_vdem unit: '' display: numDecimalPlaces: 3 socgr_pow_vdem_high: + title: "{tables.vdem.variables.socgr_pow_vdem.title} (upper bound)" + description_from_producer: *description_prod_socgr_pow_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.4.3 Presidentialism Index personalism_vdem: + title: Presidentialism Index + description_from_producer: &description_prod_personalism_vdem |- + Question: To what extent is the regime characterized by presidentialism? + + Clarification: + Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem’s index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 personalism_vdem_low: + title: "{tables.vdem.variables.personalism_vdem.title} (lower bound)" + description_from_producer: *description_prod_personalism_vdem unit: '' display: numDecimalPlaces: 3 personalism_vdem_high: + title: "{tables.vdem.variables.personalism_vdem.title} (upper bound)" + description_from_producer: *description_prod_personalism_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.5.1 Civil liberties index civ_libs_vdem: + title: Civil liberties index + description_from_producer: &description_prod_civ_libs_dem |- + Question: To what extent is civil liberty respected? + + Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 civ_libs_vdem_low: + title: "{tables.vdem.variables.civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_civ_libs_dem unit: '' display: numDecimalPlaces: 3 civ_libs_vdem_high: + title: "{tables.vdem.variables.civ_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_civ_libs_dem unit: '' display: numDecimalPlaces: 3 + ## 5.5.4 Private civil liberties index priv_libs_vdem: + title: Private civil liberties index + description_from_producer: &description_prod_priv_libs_vdem |- + Question: To what extent are private liberties respected? + + Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 priv_libs_vdem_low: + title: "{tables.vdem.variables.priv_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_priv_libs_vdem unit: '' display: numDecimalPlaces: 3 priv_libs_vdem_high: + title: "{tables.vdem.variables.priv_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_priv_libs_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.5.3 Political civil liberties index pol_libs_vdem: + title: Political civil liberties index + description_from_producer: &description_prod_pol_libs_vdem |- + Question: To what extent are political liberties respected? + + Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). unit: '' display: numDecimalPlaces: 3 pol_libs_vdem_low: + title: "{tables.vdem.variables.pol_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_pol_libs_vdem unit: '' display: numDecimalPlaces: 3 pol_libs_vdem_high: + title: "{tables.vdem.variables.pol_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_pol_libs_vdem unit: '' display: numDecimalPlaces: 3 + ## phys_integr_libs_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 phys_integr_libs_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 phys_integr_libs_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 + ## corruption_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 corruption_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 corruption_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 + ## corr_publsec_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 corr_publsec_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 corr_publsec_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 corr_exec_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 corr_exec_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 corr_exec_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 wom_emp_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 wom_emp_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 wom_emp_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_libs_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_libs_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_libs_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_soc_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_soc_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 wom_civ_soc_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 wom_pol_par_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 wom_pol_par_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 wom_pol_par_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 rule_of_law_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 rule_of_law_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 rule_of_law_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 civ_soc_str_vdem: + title: '' unit: '' display: numDecimalPlaces: 3 civ_soc_str_vdem_low: + title: '' unit: '' display: numDecimalPlaces: 3 civ_soc_str_vdem_high: + title: '' unit: '' display: numDecimalPlaces: 3 goveffective_vdem_wbgi: + title: '' unit: '' display: numDecimalPlaces: 3 corruption_cpi: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_hoe_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_hoe_high_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_hoe_low_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 electdem_dich_row_owid: + title: 'Electoral democracy' unit: '' display: numDecimalPlaces: 0 electdem_dich_high_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 electdem_dich_low_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 electfreefair_row: + title: '' unit: '' display: numDecimalPlaces: 0 electfreefair_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 electfreefair_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 lib_dich_row: + title: '' unit: '' display: numDecimalPlaces: 0 lib_dich_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 lib_dich_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_m_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_m_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_m_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_w_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_w_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 accessjust_w_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 transplaws_row: + title: '' unit: '' display: numDecimalPlaces: 0 transplaws_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 transplaws_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_leg_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_leg_high_row: + title: '' unit: '' display: numDecimalPlaces: 0 electmulpar_leg_low_row: + title: '' unit: '' display: numDecimalPlaces: 0 regime_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 regime_amb_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 regime_redux_row_owid: + title: '' unit: '' display: numDecimalPlaces: 0 wom_hoe_vdem: + title: '' unit: '' display: numDecimalPlaces: 0 regime_imputed: + title: '' unit: '' display: numDecimalPlaces: 0 diff --git a/snapshots/democracy/2024-03-18/vdem.zip.dvc b/snapshots/democracy/2024-03-18/vdem.zip.dvc index c86adf9c30a..178ad9e8337 100644 --- a/snapshots/democracy/2024-03-18/vdem.zip.dvc +++ b/snapshots/democracy/2024-03-18/vdem.zip.dvc @@ -20,10 +20,10 @@ meta: # Citation producer: V-Dem citation_full: |- - Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan I. Lindberg, Jan Teorell, David Altman, Fabio Angiolillo, Michael Bernhard, Cecilia Borella, Agnes Cornell, M. Steven Fish, Linnea Fox, Lisa Gastaldi, Haakon Gjerløw, Adam Glynn, Ana Good God, Sandra Grahn, Allen Hicken, Katrin Kinzelbach, Joshua Krusell, Kyle L. Marquardt, Kelly McMann, Valeriya Mechkova, Juraj Medzihorsky, Natalia Natsika, Anja Neundorf, Pamela Paxton, Daniel Pemstein, Josefine Pernes, Oskar Rydén, Johannes von Römer, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Aksel Sundström, Eitan Tzelgov, Yi-ting Wang, Tore Wig, Steven Wilson and Daniel Ziblatt. 2024. "V-Dem Country-Year Dataset v14" Varieties of Democracy (V-Dem) Project. https://doi.org/10.23696/mcwt-fr58. + Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan I. Lindberg, Jan Teorell, David Altman, Fabio Angiolillo, Michael Bernhard, Cecilia Borella, Agnes Cornell, M. Steven Fish, Linnea Fox, Lisa Gastaldi, Haakon Gjerløw, Adam Glynn, Ana Good God, Sandra Grahn, Allen Hicken, Katrin Kinzelbach, Joshua Krusell, Kyle L. Marquardt, Kelly McMann, Valeriya Mechkova, Juraj Medzihorsky, Natalia Natsika, Anja Neundorf, Pamela Paxton, Daniel Pemstein, Josefine Pernes, Oskar Rydén, Johannes von Römer, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Aksel Sundström, Eitan Tzelgov, Yi-ting Wang, Tore Wig, Steven Wilson and Daniel Ziblatt. 2024. "V-Dem Country-Year Dataset v14" Varieties of Democracy (V-Dem) Project. https://doi.org/10.23696/mcwt-fr58; - Pemstein, Daniel, Kyle L. Marquardt, Eitan Tzelgov, Yi-ting Wang, Juraj Medzihorsky, Joshua Krusell, Farhad Miri, and Johannes von Römer. 2024. “The V-Dem Measurement Model: Latent Variable Analysis for Cross-National and Cross-Temporal Expert-Coded Data”. V-Dem Working Paper No. 21. 9th edition. University of Gothenburg: Varieties of Democracy Institute. + Pemstein, Daniel, Kyle L. Marquardt, Eitan Tzelgov, Yi-ting Wang, Juraj Medzihorsky, Joshua Krusell, Farhad Miri, and Johannes von Römer. 2024. “The V-Dem Measurement Model: Latent Variable Analysis for Cross-National and Cross-Temporal Expert-Coded Data”. V-Dem Working Paper No. 21. 9th edition. University of Gothenburg: Varieties of Democracy Institute # Files url_main: http://v-dem.net/vdemds.html From 35a2882aa8dbe42cad03a2dbe0f6f25259384649 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 27 Mar 2024 21:21:29 +0100 Subject: [PATCH 24/62] wip: metadata descriptions --- .../democracy/2024-03-07/vdem/__init__.py | 18 +- .../democracy/2024-03-07/vdem/vdem.meta.yml | 273 +++++++++++++++--- 2 files changed, 254 insertions(+), 37 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 4f8725bfd4b..15aa798094e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -72,6 +72,8 @@ def add_citation_full(tb: Table) -> Table: CITATION_COPPEDGE = "Coppedge et al. (2015, V-Dem Working Paper Series 2015:6)" CITATION_PEMSTEIN = "Pemstein et al. (2024, V-Dem Working Paper Series 2024:21)" CITATION_SIGMAN = "Sigman et al. (2015, V-Dem Working Paper Series 2015:22)" + CITATION_MCMANN = "McMann et al. (2016, V-Dem Working Paper Series 2016:23)" + CITATION_SUNDSTROM = "Sundström et al. (2017, V-Dem Working Paper Series 2017:19)" DIMENSIONS = ["", "_low", "_high"] citation_coppedge = [ *[f"libdem_vdem{dim}" for dim in DIMENSIONS], @@ -104,9 +106,21 @@ def add_citation_full(tb: Table) -> Table: *[f"priv_libs_vdem{dim}" for dim in DIMENSIONS], *[f"pol_libs_vdem{dim}" for dim in DIMENSIONS], ] + citation_mcmann = [ + *[f"corruption_vdem{dim}" for dim in DIMENSIONS], + *[f"corr_publsec_vdem{dim}" for dim in DIMENSIONS], + *[f"corr_exec_vdem{dim}" for dim in DIMENSIONS], + ] citation_full = { + # Single citations + **{i: CITATION_COPPEDGE for i in citation_coppedge}, + **{i: CITATION_PEMSTEIN for i in citation_pemstein}, + **{i: CITATION_MCMANN for i in citation_mcmann}, **{f"electdem_vdem{dim}": "Teorell et al. (2019)" for dim in DIMENSIONS}, **{f"egaldem_vdem{dim}": CITATION_SIGMAN for dim in DIMENSIONS}, + **{f"wom_emp_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, + **{f"wom_pol_par_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, + # Combined citations **{f"egal_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_COPPEDGE}" for dim in DIMENSIONS}, **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017); {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, @@ -115,8 +129,8 @@ def add_citation_full(tb: Table) -> Table: f"description_from_producer{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" for dim in DIMENSIONS }, - **{i: CITATION_COPPEDGE for i in citation_coppedge}, - **{i: CITATION_PEMSTEIN for i in citation_pemstein}, + **{f"wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"wom_civ_soc_vdem{dim}": f"{CITATION_SUNDSTROM}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, } for indicator_name, citation_additional in citation_full.items(): tb[indicator_name].metadata.origins[0].citation_full += f";\n\n{citation_additional}" diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 19068775988..2e86d9aa255 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -41,6 +41,8 @@ tables: Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate’s approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_polyarchy` unit: '' display: numDecimalPlaces: 3 @@ -68,6 +70,8 @@ tables: Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_libdem` unit: '' display: numDecimalPlaces: 3 @@ -95,6 +99,8 @@ tables: Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_partipdem` unit: '' display: numDecimalPlaces: 3 @@ -123,6 +129,8 @@ tables: The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_delibdem` unit: '' display: numDecimalPlaces: 3 @@ -151,6 +159,8 @@ tables: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_egaldem` unit: '' display: numDecimalPlaces: 3 @@ -178,6 +188,8 @@ tables: Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_freexp_altinf` unit: '' display: numDecimalPlaces: 3 @@ -203,6 +215,8 @@ tables: Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_frassoc_thick` unit: '' display: numDecimalPlaces: 3 @@ -228,7 +242,10 @@ tables: Question: What share of adult citizens as defined by statute has the legal right to vote in national elections? Clarification: - This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or ’economic independence’, estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. + This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or 'economic independence', estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. + + Indicator name: `v2x_suffr` + description_processing: Converted ratio (0-1) into share (0-100%). unit: '%' display: numDecimalPlaces: 3 @@ -242,6 +259,8 @@ tables: Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_frefair` unit: '' display: numDecimalPlaces: 3 @@ -267,6 +286,8 @@ tables: Question: Is the chief executive and legislature appointed through popular elections? Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. + + Indicator name: `v2x_elecoff` unit: '' display: numDecimalPlaces: 3 @@ -280,6 +301,8 @@ tables: Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_liberal` unit: '' display: numDecimalPlaces: 3 @@ -305,6 +328,8 @@ tables: Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? Scale: Interval, from low to high (0-1). + + Indicator name: `v2xcl_rol` unit: '' display: numDecimalPlaces: 3 @@ -330,6 +355,8 @@ tables: Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_jucon` unit: '' display: numDecimalPlaces: 3 @@ -357,6 +384,8 @@ tables: Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? Scale: Interval, from low to high (0-1). + + Indicator name: `v2xlg_legcon` unit: '' display: numDecimalPlaces: 3 @@ -385,6 +414,8 @@ tables: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_partip` unit: '' display: numDecimalPlaces: 3 @@ -416,6 +447,8 @@ tables: Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_cspart` unit: '' display: numDecimalPlaces: 3 @@ -443,6 +476,8 @@ tables: Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xdd_dd` unit: '' display: numDecimalPlaces: 3 @@ -456,6 +491,8 @@ tables: Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_locelec` unit: '' display: numDecimalPlaces: 3 @@ -483,6 +520,8 @@ tables: Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_regelec` unit: '' display: numDecimalPlaces: 3 @@ -514,6 +553,8 @@ tables: Scale: Interval, from low to high (0-1). + + Indicator name: `v2xdl_delib` unit: '' display: numDecimalPlaces: 3 @@ -541,6 +582,8 @@ tables: Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_egal` unit: '' display: numDecimalPlaces: 3 @@ -568,6 +611,8 @@ tables: Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqprotec` unit: '' display: numDecimalPlaces: 3 @@ -595,6 +640,8 @@ tables: Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqaccess` unit: '' display: numDecimalPlaces: 3 @@ -622,6 +669,8 @@ tables: Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqdr` unit: '' display: numDecimalPlaces: 3 @@ -645,6 +694,8 @@ tables: title: Election turnout description_from_producer: |- Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? + + Indicator name: `v2eltrnout` unit: '%' display: numDecimalPlaces: 2 @@ -654,6 +705,8 @@ tables: title: HOS female description_from_producer: |- If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + + Indicator name: `v2exfemhos` unit: '' display: numDecimalPlaces: 0 @@ -669,6 +722,8 @@ tables: Responses: 0: Male 1: Female + + Indicator name: `v2exfemhog` unit: '' display: numDecimalPlaces: 0 @@ -692,6 +747,8 @@ tables: 2: Sometimes. Some legislators probably engage in these activities. 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. 4: Never, or hardly ever. + + Indicator name: `v2lgcrrpt` unit: '' display: numDecimalPlaces: 3 @@ -715,6 +772,8 @@ tables: title: Lower chamber female legislators description_from_producer: |- Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? + + Indicator name: `v2lgfemleg` unit: '%' display: numDecimalPlaces: 3 @@ -733,6 +792,8 @@ tables: 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." + + Indicator name: `v2dlreason` unit: '' display: numDecimalPlaces: 3 @@ -765,6 +826,8 @@ tables: 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. + + Indicator name: `v2dlcommon` unit: '' display: numDecimalPlaces: 3 @@ -799,6 +862,8 @@ tables: 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlcountr` unit: '' display: numDecimalPlaces: 3 @@ -833,6 +898,8 @@ tables: 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlconslt` unit: '' display: numDecimalPlaces: 3 @@ -868,6 +935,8 @@ tables: 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlengage` unit: '' display: numDecimalPlaces: 3 @@ -901,6 +970,8 @@ tables: Scale: Ordinal, converted to interval by the measurement model. Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. + + Indicator name: `v2jucorrdc` unit: '' display: numDecimalPlaces: 3 @@ -938,6 +1009,8 @@ tables: 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clrspct` unit: '' display: numDecimalPlaces: 3 @@ -970,6 +1043,8 @@ tables: 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clsocgrp` unit: '' display: numDecimalPlaces: 3 @@ -1002,6 +1077,8 @@ tables: 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2svdomaut` unit: '' display: numDecimalPlaces: 3 @@ -1030,6 +1107,8 @@ tables: 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. + + Indicator name: `v2svinlaut` unit: '' display: numDecimalPlaces: 3 @@ -1058,6 +1137,8 @@ tables: With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. + + Indicator name: `v2svstterr` unit: '%' display: numDecimalPlaces: 3 @@ -1090,6 +1171,8 @@ tables: 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. + + Indicator name: `v2pepwrsoc` unit: '' display: numDecimalPlaces: 3 @@ -1118,6 +1201,8 @@ tables: Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem’s index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. Scale: Interval, from low to high (0-1). + + Indicator name: `v2xnp_pres` unit: '' display: numDecimalPlaces: 3 @@ -1145,6 +1230,8 @@ tables: Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_civlib` unit: '' display: numDecimalPlaces: 3 @@ -1172,6 +1259,8 @@ tables: Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clpriv` unit: '' display: numDecimalPlaces: 3 @@ -1199,6 +1288,8 @@ tables: Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clpol` unit: '' display: numDecimalPlaces: 3 @@ -1217,191 +1308,303 @@ tables: display: numDecimalPlaces: 3 - ## + ## 5.5.2 Physical violence index phys_integr_libs_vdem: - title: '' + title: Physical violence index + description_from_producer: &description_prod_phys_integr_libs_vdem |- + Question: To what extent is physical integrity respected? + + Clarification: Physical integrity is understood as freedom from political killings and torture by the government. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect violence committed by government agents and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clphy` unit: '' display: numDecimalPlaces: 3 phys_integr_libs_vdem_low: - title: '' + title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_phys_integr_libs_vdem unit: '' display: numDecimalPlaces: 3 phys_integr_libs_vdem_high: - title: '' + title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_phys_integr_libs_vdem unit: '' display: numDecimalPlaces: 3 - ## + ## 5.7.1 Political corruption index corruption_vdem: - title: '' + title: Political corruption index + description_from_producer: &description_prod_corruption_vdem |- + Question: How pervasive is political corruption? + + Clarification: The directionality of the V-Dem corruption index runs from less corrupt to more corrupt unlike the other V-Dem variables that generally run from less democratic to more democratic situation. The corruption index includes measures of six distinct types of corruption that cover both different areas and levels of the polity realm, distinguishing between executive, legislative and judicial corruption. Within the executive realm, the measures also distinguish between corruption mostly pertaining to bribery and corruption due to embezzlement. Finally, they differentiate between corruption in the highest echelons of the executive at the level of the rulers/cabinet on the one hand, and in the public sector at large on the other. The measures thus tap into several distinguished types of corruption: both 'petty' and 'grand'; both bribery and theft; both corruption aimed and influencing law making and that affecting implementation. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_corr` unit: '' display: numDecimalPlaces: 3 corruption_vdem_low: - title: '' + title: "{tables.vdem.variables.corruption_vdem.title} (lower bound)" + description_from_producer: *description_prod_corruption_vdem unit: '' display: numDecimalPlaces: 3 corruption_vdem_high: - title: '' + title: "{tables.vdem.variables.corruption_vdem.title} (upper bound)" + description_from_producer: *description_prod_corruption_vdem unit: '' display: numDecimalPlaces: 3 - ## + ## 5.7.3 Public sector corruption index corr_publsec_vdem: - title: '' + title: Public sector corruption index + description_from_producer: &description_prod_corr_publsec_vdem |- + Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? + + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_pubcorr` unit: '' display: numDecimalPlaces: 3 corr_publsec_vdem_low: - title: '' + title: "{tables.vdem.variables.corr_publsec_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_publsec_vdem unit: '' display: numDecimalPlaces: 3 corr_publsec_vdem_high: - title: '' + title: "{tables.vdem.variables.corr_publsec_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_publsec_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.7.2 Executive corruption index corr_exec_vdem: - title: '' + title: Executive corruption index + description_from_producer: &description_prod_corr_exec_vdem |- + Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? + + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_execorr` unit: '' display: numDecimalPlaces: 3 corr_exec_vdem_low: - title: '' + title: "{tables.vdem.variables.corr_exec_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_exec_vdem unit: '' display: numDecimalPlaces: 3 corr_exec_vdem_high: - title: '' + title: "{tables.vdem.variables.corr_exec_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_exec_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.8.1 Women political empowerment index wom_emp_vdem: - title: '' + title: Women political empowerment index + description_from_producer: &description_prod_wom_emp_vdem |- + Question: How politically empowered are women? + + Clarification: Women’s political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women’s open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gender` unit: '' display: numDecimalPlaces: 3 wom_emp_vdem_low: - title: '' + title: "{tables.vdem.variables.wom_emp_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_emp_vdem unit: '' display: numDecimalPlaces: 3 wom_emp_vdem_high: - title: '' + title: "{tables.vdem.variables.wom_emp_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_emp_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.8.2 Women civil liberties index wom_civ_libs_vdem: - title: '' + title: Women civil liberties index + description_from_producer: &description_prod_wom_civ_libs_vdem |- + Question: Do women have the ability to make meaningful decisions in key areas of their lives? + + Clarification: Women’s civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gencl` unit: '' display: numDecimalPlaces: 3 wom_civ_libs_vdem_low: - title: '' + title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_civ_libs_vdem unit: '' display: numDecimalPlaces: 3 wom_civ_libs_vdem_high: - title: '' + title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_civ_libs_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.8.3 Women civil society participation index wom_civ_soc_vdem: - title: '' + title: Women civil society participation index + description_from_producer: &description_prod_wom_civ_soc_vdem |- + Question: Do women have the ability to express themselves and to form and participate in groups? + + Clarification: Women’s civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gencs` unit: '' display: numDecimalPlaces: 3 wom_civ_soc_vdem_low: - title: '' + title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_civ_soc_vdem unit: '' display: numDecimalPlaces: 3 wom_civ_soc_vdem_high: - title: '' + title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_civ_soc_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.8.4 Women political participation index wom_pol_par_vdem: - title: '' + title: Women political participation index + description_from_producer: &description_prod_wom_pol_par_vdem |- + Question: Are women descriptively represented in formal political positions? + + Clarification: Women's political participation is understood to include women's descriptive representation in the legislature and an equal share in the overall distribution of power. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_genpp` unit: '' display: numDecimalPlaces: 3 wom_pol_par_vdem_low: - title: '' + title: "{tables.vdem.variables.wom_pol_par_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_pol_par_vdem unit: '' display: numDecimalPlaces: 3 wom_pol_par_vdem_high: - title: '' + title: "{tables.vdem.variables.wom_pol_par_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_pol_par_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.9.1 Rule of law index rule_of_law_vdem: - title: '' + title: Rule of law index + description_from_producer: &description_prod_rule_of_law_vdem |- + Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_rule` unit: '' display: numDecimalPlaces: 3 rule_of_law_vdem_low: - title: '' + title: "{tables.vdem.variables.rule_of_law_vdem.title} (lower bound)" + description_from_producer: *description_prod_rule_of_law_vdem unit: '' display: numDecimalPlaces: 3 rule_of_law_vdem_high: - title: '' + title: "{tables.vdem.variables.rule_of_law_vdem.title} (upper bound)" + description_from_producer: *description_prod_rule_of_law_vdem unit: '' display: numDecimalPlaces: 3 + ## 5.11.1 Core civil society index civ_soc_str_vdem: - title: '' + title: Core civil society index + description_from_producer: &description_prod_civ_soc_str_vdem |- + Question: How robust is civil society? + + Clarification: The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xcs_ccsi` unit: '' display: numDecimalPlaces: 3 civ_soc_str_vdem_low: - title: '' + title: "{tables.vdem.variables.civ_soc_str_vdem.title} (lower bound)" + description_from_producer: *description_prod_civ_soc_str_vdem unit: '' display: numDecimalPlaces: 3 civ_soc_str_vdem_high: - title: '' + title: "{tables.vdem.variables.civ_soc_str_vdem.title} (upper bound)" + description_from_producer: *description_prod_civ_soc_str_vdem unit: '' display: numDecimalPlaces: 3 + ## 9.4.2 Government effectiveness goveffective_vdem_wbgi: - title: '' + title: Government effectiveness + description_from_producer: &description_prod_goveffective_vdem_wbgi |- + "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government’s commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. + + Indicator name: `e_wbgi_gee` unit: '' display: numDecimalPlaces: 3 From 83ec5d292dbdcd2d773d70ce37657a706ba26c15 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 28 Mar 2024 00:25:19 +0100 Subject: [PATCH 25/62] wip: metadata --- .../democracy/2024-03-07/vdem/__init__.py | 46 ++- .../democracy/2024-03-07/vdem/vdem.meta.yml | 264 ++++++++++++++---- .../democracy/2024-03-07/vdem/vdem_clean.py | 4 +- 3 files changed, 262 insertions(+), 52 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 15aa798094e..d918ed7ca57 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -64,7 +64,19 @@ def run(dest_dir: str) -> None: # %% -def add_citation_full(tb: Table) -> Table: +def adjust_citation_full(tb: Table) -> Table: + """Adjust the citation_full metadata field for some indicators.""" + tb = replace_citation_full(tb) + tb = append_citation_full(tb) + return tb + + +def replace_citation_full(tb: Table) -> Table: + """Replace the citation_full metadata field for some indicators.""" + return tb + + +def append_citation_full(tb: Table) -> Table: """Add additional citations. Some indicators require additional citation information. @@ -74,6 +86,8 @@ def add_citation_full(tb: Table) -> Table: CITATION_SIGMAN = "Sigman et al. (2015, V-Dem Working Paper Series 2015:22)" CITATION_MCMANN = "McMann et al. (2016, V-Dem Working Paper Series 2016:23)" CITATION_SUNDSTROM = "Sundström et al. (2017, V-Dem Working Paper Series 2017:19)" + CITATION_TEORELL = "Teorell et al. (2019)" + CITATION_LUHRMANN = "Lührmann, Anna, Marcus Tannnberg, and Staffan Lindberg. 2018. Regimes of the World (RoW): Opening New Avenues for the Comparative Study of Political Regimes. Politics and Governance 6(1): 60-77." DIMENSIONS = ["", "_low", "_high"] citation_coppedge = [ *[f"libdem_vdem{dim}" for dim in DIMENSIONS], @@ -82,6 +96,8 @@ def add_citation_full(tb: Table) -> Table: *[f"lib_vdem{dim}" for dim in DIMENSIONS], *[f"particip_vdem{dim}" for dim in DIMENSIONS], *[f"delib_vdem{dim}" for dim in DIMENSIONS], + # row indicators + *[f"lib_dich{dim}_row" for dim in DIMENSIONS], ] citation_pemstein = [ *[f"freeexpr_vdem{dim}" for dim in DIMENSIONS], @@ -105,18 +121,30 @@ def add_citation_full(tb: Table) -> Table: *[f"socgr_pow_vdem{dim}" for dim in DIMENSIONS], *[f"priv_libs_vdem{dim}" for dim in DIMENSIONS], *[f"pol_libs_vdem{dim}" for dim in DIMENSIONS], + # row indicators + *[f"transplaws{dim}_row" for dim in DIMENSIONS], + *[f"accessjust_w{dim}_row" for dim in DIMENSIONS], + *[f"accessjust_m{dim}_row" for dim in DIMENSIONS], + *[f"electfreefair{dim}_row" for dim in DIMENSIONS], + *[f"electmulpar{dim}_row" for dim in DIMENSIONS], ] citation_mcmann = [ *[f"corruption_vdem{dim}" for dim in DIMENSIONS], *[f"corr_publsec_vdem{dim}" for dim in DIMENSIONS], *[f"corr_exec_vdem{dim}" for dim in DIMENSIONS], ] + citation_teorell = [ + *[f"electdem_vdem{dim}" for dim in DIMENSIONS], + # row indicators + *[f"electdem_dich{dim}_row_owid" for dim in DIMENSIONS], + ] + citation_full = { # Single citations **{i: CITATION_COPPEDGE for i in citation_coppedge}, **{i: CITATION_PEMSTEIN for i in citation_pemstein}, **{i: CITATION_MCMANN for i in citation_mcmann}, - **{f"electdem_vdem{dim}": "Teorell et al. (2019)" for dim in DIMENSIONS}, + **{i: CITATION_TEORELL for i in citation_teorell}, **{f"egaldem_vdem{dim}": CITATION_SIGMAN for dim in DIMENSIONS}, **{f"wom_emp_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, **{f"wom_pol_par_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, @@ -135,4 +163,18 @@ def add_citation_full(tb: Table) -> Table: for indicator_name, citation_additional in citation_full.items(): tb[indicator_name].metadata.origins[0].citation_full += f";\n\n{citation_additional}" + # Add citation for Luhrmann (at the beginning of the citation full) + citation_luhrmann = [ + *[f"transplaws{dim}_row" for dim in DIMENSIONS], + *[f"accessjust_w{dim}_row" for dim in DIMENSIONS], + *[f"accessjust_m{dim}_row" for dim in DIMENSIONS], + *[f"lib_dich{dim}_row" for dim in DIMENSIONS], + *[f"electfreefair{dim}_row" for dim in DIMENSIONS], + *[f"electdem_dich{dim}_row_owid" for dim in DIMENSIONS], + *[f"electmulpar{dim}_row" for dim in DIMENSIONS], + ] + for indicator_name in citation_luhrmann: + tb[indicator_name].metadata.origins[0].citation_full = ( + f"{CITATION_LUHRMANN};\n\n" + tb[indicator_name].metadata.origins[0].citation_full + ) return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 2e86d9aa255..9f077ed19e6 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -1601,7 +1601,7 @@ tables: ## 9.4.2 Government effectiveness goveffective_vdem_wbgi: title: Government effectiveness - description_from_producer: &description_prod_goveffective_vdem_wbgi |- + description_from_producer: |- "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government’s commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. Indicator name: `e_wbgi_gee` @@ -1609,12 +1609,60 @@ tables: display: numDecimalPlaces: 3 + ## 9.9.3 Corruption perception index corruption_cpi: - title: '' + title: Corruption perception index + description_from_producer: |- + The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). + + Notes: The data spans 2012–present due to the methodological incomparability with the data prior 2012. + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty + electmulpar_row: + title: Elections multiparty (re-estimate) + description_short: |- + Best estimate of whether national multi-party elections were held or not. + description_from_producer: &description_prod_electmulpar_vdem |- + Question: Question: Was this national election multiparty? + + Responses: + 0: No. No-party or single-party and there is no meaningful competition (includes situations where a few parties are legal but they are all de facto controlled by the dominant party). + 1: Not really. No-party or single-party (defined as above) but multiple candidates from the same party and/or independents contest legislative seats or the presidency. + 2: Constrained. At least one real opposition party is allowed to contest but competition is highly constrained — legally or informally. + 3: Almost. Elections are multiparty in principle but either one main opposition party is prevented (de jure or de facto) from contesting, or conditions such as civil unrest (excluding natural disasters) prevent competition in a portion of the territory. + 4: Yes. Elections are multiparty, even though a few marginal parties may not be permitted to contest (e.g. far-right/left extremist parties, anti-democratic religious or ethnic parties). + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_electmulpar_row |- + We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 + electmulpar_high_row: + title: "{tables.vdem.variables.electmulpar_row.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether national multi-party elections were held or not. + description_from_producer: *description_prod_electmulpar_vdem + description_processing: *description_processing_electmulpar_row + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_low_row: + title: "{tables.vdem.variables.electmulpar_row.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether national multi-party elections were held or not. + description_from_producer: *description_prod_electmulpar_vdem + description_processing: *description_processing_electmulpar_row + unit: '' + display: + numDecimalPlaces: 0 + + ## v2elmulpar_osp_hoe. TODO: extract from v2elmulpar_osp_hos, v2elmulpar_osp_hog electmulpar_hoe_row_owid: title: '' unit: '' @@ -1633,150 +1681,276 @@ tables: display: numDecimalPlaces: 0 - electdem_dich_row_owid: - title: 'Electoral democracy' + ## v2elmulpar_osp_leg_dich. TODO: from v2elmulpar_osp_leg + electmulpar_leg_row: + title: '' unit: '' display: numDecimalPlaces: 0 - electdem_dich_high_row_owid: + electmulpar_leg_high_row: title: '' unit: '' display: numDecimalPlaces: 0 - electdem_dich_low_row_owid: + electmulpar_leg_low_row: title: '' unit: '' display: numDecimalPlaces: 0 - electfreefair_row: - title: '' + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index + electdem_dich_row_owid: + title: Electoral democracy (re-estimate) + description_short: |- + Best estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + description_processing: |- + We use a threshold of 0.5 on `v2x_polyarchy_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 - electfreefair_high_row: - title: '' + electdem_dich_high_row_owid: + title: "{tables.vdem.variables.electdem_dich_row_owid.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem unit: '' display: numDecimalPlaces: 0 - electfreefair_low_row: - title: '' + electdem_dich_low_row_owid: + title: "{tables.vdem.variables.electdem_dich_row_owid.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem unit: '' display: numDecimalPlaces: 0 - electmulpar_row: - title: '' + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair + electfreefair_row: + title: Election free and fair (re-estimate) + description_short: Best estimate of whether national elections were free and fair or not. + description_from_producer: &description_prod_electfreefair_row |- + Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? + + Clarification: The only thing that should not be considered in coding this is the extent of suffrage (by law). Thus, a free and fair election may occur even if the law excludes significant groups (an issue measured separately). + + Responses: + 0: No, not at all. The elections were fundamentally flawed and the official results had little if anything to do with the 'will of the people' (i.e., who became president; or who won the legislative majority). + 1: Not really. While the elections allowed for some competition, the irregularities in the end affected the outcome of the election (i.e., who became president; or who won the legislative majority). + 2: Ambiguous. There was substantial competition and freedom of participation but there were also significant irregularities. It is hard to determine whether the irregularities affected the outcome or not (as defined above). + 3: Yes, somewhat. There were deficiencies and some degree of fraud and irregularities but these did not in the end affect the outcome (as defined above). + 4: Yes. There was some amount of human error and logistical restrictions but these were largely unintentional and without significant consequences. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_electfreefair_row |- + We use a threshold of 2 on `v2elfrfair_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 - electmulpar_high_row: - title: '' + electfreefair_high_row: + title: "{tables.vdem.variables.electfreefair_row.title} (upper bound)" + description_short: Upper-bound estimate of whether national elections were free and fair or not. + description_from_producer: *description_prod_electfreefair_row + description_processing: *description_processing_electfreefair_row unit: '' display: numDecimalPlaces: 0 - electmulpar_low_row: - title: '' + electfreefair_low_row: + title: "{tables.vdem.variables.electfreefair_row.title} (lower bound)" + description_short: Lower-bound estimate of whether national elections were free and fair or not. + description_from_producer: *description_prod_electfreefair_row + description_processing: *description_processing_electfreefair_row unit: '' display: numDecimalPlaces: 0 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index lib_dich_row: - title: '' + title: Liberal component (re-estimate) + description_short: Best estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: &description_processing_lib_dich_row |- + We use a threshold of 0.8 on `v2x_liberal` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 lib_dich_high_row: - title: '' + title: "{tables.vdem.variables.lib_dich_row.title} (upper bound)" + description_short: Upper-bound estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: *description_processing_lib_dich_row unit: '' display: numDecimalPlaces: 0 lib_dich_low_row: - title: '' + title: "{tables.vdem.variables.lib_dich_row.title} (lower bound)" + description_short: Lower-bound estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: *description_processing_lib_dich_row unit: '' display: numDecimalPlaces: 0 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men accessjust_m_row: - title: '' + title: Access to justice for women (re-estimate) + description_short: Best estimate of whether men have access to justice or not. + description_from_producer: &description_prod_accessjust_m_row |- + Question: Do men enjoy secure and effective access to justice? + + Clarification: This question specifies the extent to which men can bring cases before the courts without risk to their personal safety, trials are fair, and men have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. + + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. + + Responses: + 0: Secure and effective access to justice for men is non-existent. + 1: Secure and effective access to justice for men is usually not established or widely respected. 2: Secure and effective access to justice for men is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for men is usually observed. + 4: Secure and effective access to justice for men is almost always observed. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_accessjust_m_row |- + We use a threshold of 3 on `v2clacjstm_osp*` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 accessjust_m_high_row: - title: '' + title: "{tables.vdem.variables.accessjust_m_high_row.title} (upper bound)" + description_short: Upper-bound estimate of whether men have access to justice or not. + description_from_producer: *description_prod_accessjust_m_row + description_processing: *description_processing_accessjust_m_row unit: '' display: numDecimalPlaces: 0 accessjust_m_low_row: - title: '' + title: "{tables.vdem.variables.accessjust_m_high_row.title} (lower bound)" + description_short: Lower-bound estimate of whether men have access to justice or not. + description_from_producer: *description_prod_accessjust_m_row + description_processing: *description_processing_accessjust_m_row unit: '' display: numDecimalPlaces: 0 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women accessjust_w_row: - title: '' + title: Access to justice for women (re-estimate) + description_short: Best estimate of whether women have access to justice or not. + description_from_producer: &description_prod_accessjust_w_row |- + Question: Do women enjoy equal, secure, and effective access to justice? + + Clarification: This question specifies the extent to which women can bring cases before the courts without risk to their personal safety, trials are fair, and women have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. + + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. + + Responses: + 0: Secure and effective access to justice for women is non-existent. + 1: Secure and effective access to justice for women is usually not established or widely respected. 2: Secure and effective access to justice for women is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for women is usually observed. + 4: Secure and effective access to justice for women is almost always observed. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_accessjust_w_row |- + We use a threshold of 3 on `v2clacjstw_osp*` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 accessjust_w_high_row: - title: '' + title: "{tables.vdem.variables.accessjust_w_high_row.title} (upper bound)" + description_short: Upper-bound estimate of whether women have access to justice or not. + description_from_producer: *description_prod_accessjust_w_row + description_processing: *description_processing_accessjust_w_row unit: '' display: numDecimalPlaces: 0 accessjust_w_low_row: - title: '' + title: "{tables.vdem.variables.accessjust_w_low_row.title} (lower bound)" + description_short: Lower-bound estimate of whether women have access to justice or not. + description_from_producer: *description_prod_accessjust_w_row + description_processing: *description_processing_accessjust_w_row unit: '' display: numDecimalPlaces: 0 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement transplaws_row: - title: '' + title: Transparent laws with predictable enforcement (re-estimate) + description_short: |- + Best estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: &description_prod_transplaws |- + Question: Are the laws of the land clear, well publicized, coherent (consistent with each other), relatively stable from year to year, and enforced in a predictable manner? + + Clarification: This question focuses on the transparency and predictability of the laws of the land. + + Responses: + 0: Transparency and predictability are almost non-existent. The laws of the land are created and/or enforced in completely arbitrary fashion. + 1: Transparency and predictability are severely limited. The laws of the land are more often than not created and/or enforced in arbitrary fashion. + 2: Transparency and predictability are somewhat limited. The laws of the land are mostly created in a non-arbitrary fashion but enforcement is rather arbitrary in some parts of the country. + 3: Transparency and predictability are fairly strong. The laws of the land are usually created and enforced in a non-arbitrary fashion. + 4: Transparency and predictability are very strong. The laws of the land are created and enforced in a non-arbitrary fashion. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_transplaws |- + We use a threshold of 3 on `v2cltrnslw_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. unit: '' display: numDecimalPlaces: 0 transplaws_high_row: - title: '' + title: "{tables.vdem.variables.transplaws_row.title} (upper bound)" + description_short: |- + Upper estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: *description_prod_transplaws + description_processing: *description_processing_transplaws unit: '' display: numDecimalPlaces: 0 transplaws_low_row: - title: '' + title: "{tables.vdem.variables.transplaws_row.title} (lower bound)" + description_short: |- + Lower estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: *description_prod_transplaws + description_processing: *description_processing_transplaws unit: '' display: numDecimalPlaces: 0 - electmulpar_leg_row: - title: '' - unit: '' - display: - numDecimalPlaces: 0 + ## HOE female (custom) + # NOTE: Add adjustment in citation_full + wom_hoe_vdem: + title: HOE female + description_short: |- + The variable denotes whether the chief executive of government in office on December 31 is a woman. + description_processing: |- + Assigns the value based on the gender of the most powerful chief: either Head of state or Head of government. - electmulpar_leg_high_row: - title: '' - unit: '' - display: - numDecimalPlaces: 0 + Uses gender from HOS: + - If head of state is more powerful than head of government, and head of state is the head of the executive. + - If head of state is also head of government. + - If head of government is less powerful than head of state. - electmulpar_leg_low_row: - title: '' + Uses HOG if: + - If head of state is less powerful than head of government + + We derive this indicator from V-Dem indicators: v2exfemhos, v2exfemhog, v2ex_hosw, and v2ex_hogw. unit: '' display: numDecimalPlaces: 0 + ## Other regime indicators regime_row_owid: title: '' unit: '' @@ -1795,12 +1969,6 @@ tables: display: numDecimalPlaces: 0 - wom_hoe_vdem: - title: '' - unit: '' - display: - numDecimalPlaces: 0 - regime_imputed: title: '' unit: '' diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index cb60f1740c9..e01790afee3 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -410,7 +410,7 @@ def _set_dich( def estimate_row_indicators(tb: Table) -> Table: - "Create indicators for Regimes of the World with expanded coverage and minor changes to coding." + """Create indicators for Regimes of the World with expanded coverage and minor changes to coding.""" column_new = "regime_row_owid" tb[column_new] = np.nan @@ -1023,7 +1023,7 @@ def standardise_country_names(tb: Table) -> Table: def estimate_gender_hoe_indicator(tb: Table) -> Table: """Create variable identifying gender of chief executive.""" tb["wom_hoe_vdem"] = np.nan - # # If head of state is more powerful than head of government, and head of state is the head of the executive, then update wom_hoe_vdem accordingly + # If head of state is more powerful than head of government, and head of state is the head of the executive, then update wom_hoe_vdem accordingly tb.loc[(tb["v2ex_hosw"] <= 1) & (tb["v2ex_hosw"] > 0.5) & (tb["wom_hos_vdem"].notna()), "wom_hoe_vdem"] = tb[ "wom_hos_vdem" ] From 6ef92fa20dc3482cd87f1218544425ecbf73905b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 28 Mar 2024 17:58:56 +0100 Subject: [PATCH 26/62] wip: add missing metadata --- dag/democracy.yml | 4 +- .../democracy/2024-03-07/vdem/__init__.py | 20 +- .../democracy/2024-03-07/vdem/vdem.meta.yml | 330 +++++++++++++++--- .../democracy/2024-03-07/vdem/vdem_clean.py | 8 - .../democracy/2024-03-07/vdem/vdem_refine.py | 2 + 5 files changed, 298 insertions(+), 66 deletions(-) diff --git a/dag/democracy.yml b/dag/democracy.yml index 384ded03abc..14f7435c2d3 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -14,5 +14,5 @@ steps: - snapshot://democracy/2024-03-18/vdem.zip data://garden/democracy/2024-03-07/vdem: - data://meadow/democracy/2024-03-07/vdem - # data://grapher/democracy/2024-03-07/vdem: - # - data://garden/democracy/2024-03-07/vdem + data://grapher/democracy/2024-03-07/vdem: + - data://garden/democracy/2024-03-07/vdem diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index d918ed7ca57..0e3eeac6e57 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -1,5 +1,6 @@ """Load a meadow dataset and create a garden dataset.""" +from copy import deepcopy from typing import cast import vdem_clean as clean # VDEM's cleaning library @@ -28,6 +29,9 @@ def run(dest_dir: str) -> None: # # Process data. # + # %% Copy origins + # Copy origins (some indicators will loose their 'origins' in metadata) + origins = deepcopy(tb["country"].metadata.origins) # %% PART 1: CLEAN # The following lines (until "PART 2") are the cleaning steps. @@ -44,8 +48,14 @@ def run(dest_dir: str) -> None: # %% PART 3: REFINE tb = refine.run(tb) - # %% Tweak citation full for some indicators - tb = add_citation_full(tb) + # %% Add origins in case any was lost, adjust citation full + # Bring origins back + columns = [col for col in tb.columns if col not in ["country", "year"]] + for col in columns: + tb[col].metadata.origins = origins + + # Tweak citation full for some indicators + tb = adjust_citation_full(tb) # %% Set index tb = tb.format() @@ -145,6 +155,7 @@ def append_citation_full(tb: Table) -> Table: **{i: CITATION_PEMSTEIN for i in citation_pemstein}, **{i: CITATION_MCMANN for i in citation_mcmann}, **{i: CITATION_TEORELL for i in citation_teorell}, + ## **{f"egaldem_vdem{dim}": CITATION_SIGMAN for dim in DIMENSIONS}, **{f"wom_emp_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, **{f"wom_pol_par_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, @@ -152,9 +163,10 @@ def append_citation_full(tb: Table) -> Table: **{f"egal_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_COPPEDGE}" for dim in DIMENSIONS}, **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017); {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + ## **{f"equal_res_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, **{ - f"description_from_producer{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" + f"personalism_vdem{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" for dim in DIMENSIONS }, **{f"wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, @@ -172,6 +184,8 @@ def append_citation_full(tb: Table) -> Table: *[f"electfreefair{dim}_row" for dim in DIMENSIONS], *[f"electdem_dich{dim}_row_owid" for dim in DIMENSIONS], *[f"electmulpar{dim}_row" for dim in DIMENSIONS], + *[f"electmulpar_hoe{dim}_row_owid" for dim in DIMENSIONS], + *[f"electmulpar_leg{dim}_row" for dim in DIMENSIONS], ] for indicator_name in citation_luhrmann: tb[indicator_name].metadata.origins[0].citation_full = ( diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 9f077ed19e6..9baca6cbe85 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -3,6 +3,15 @@ definitions: presentation: topic_tags: - Democracy + description_processing: |- + We expand the years covered by V-Dem further: To expand the time coverage of today's countries and include more of the period when they were still non-sovereign territories, we identified the historical entity they were a part of and used that regime's data whenever available + + For example, V-Dem only provides regime data since Bangladesh's independence in 1971. There is, however, regime data for Pakistan and the colony of India, both of which the current territory of Bangladesh was a part. We, therefore, use the regime data of Pakistan for Bangladesh from 1947 to 1970, and the regime data of India from 1789 to 1946. We did so for all countries with a past or current population of more than one million. + auxiliary: + description_processing_row: |- + While RoW covers the years since 1900, we use V-Dem's historical data from 1789 to 1899 to expand the classification's coverage back in time. + + {definitions.common.description_processing} dataset: title: V-Dem Country-Year (Full + Others) @@ -23,11 +32,11 @@ tables: This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. variables: regime_imputed_country: - title: '' + title: 'Country name (imputed country)' unit: '' histname: - title: '' + title: 'Historical country name' unit: '' # 2.1 V-Dem High-Level Democracy Indices @@ -35,10 +44,11 @@ tables: ## 2.1.1 Electoral democracy index electdem_vdem: title: Electoral democracy index - description_short: '' + description_short: |- + Best estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: &description_prod_electdem_vdem |- Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? - Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate’s approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. + Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate's approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. Scale: Interval, from low to high (0-1). @@ -49,6 +59,8 @@ tables: electdem_vdem_low: title: "{tables.vdem.variables.electdem_vdem.title} (lower bound)" + description_short: |- + Lower-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: *description_prod_electdem_vdem unit: '' display: @@ -56,6 +68,8 @@ tables: electdem_vdem_high: title: "{tables.vdem.variables.electdem_vdem.title} (upper bound)" + description_short: |- + Upper-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: *description_prod_electdem_vdem unit: '' display: @@ -63,7 +77,9 @@ tables: ## 2.1.2 Liberal democracy index libdem_vdem: - title: '' + title: Liberal democracy index + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. description_from_producer: &description_prod_libdem_vdem |- Question: To what extent is the ideal of liberal democracy achieved? @@ -78,6 +94,8 @@ tables: libdem_vdem_low: title: "{tables.vdem.variables.libdem_vdem.title} (lower bound)" + description_short: |- + Lower-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. description_from_producer: *description_prod_libdem_vdem unit: '' display: @@ -85,6 +103,8 @@ tables: libdem_vdem_high: title: "{tables.vdem.variables.libdem_vdem.title} (upper bound)" + description_short: |- + Upper-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. description_from_producer: *description_prod_libdem_vdem unit: '' display: @@ -93,6 +113,8 @@ tables: # 2.1.3 Participatory democracy index participdem_vdem: title: Participatory democracy index + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. description_from_producer: &description_prod_participdem_vdem |- Question: To what extent is the ideal of participatory democracy achieved? @@ -122,6 +144,8 @@ tables: ## 2.1.4 Deliberative democracy index delibdem_vdem: title: Deliberative democracy index + description_short: + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. description_from_producer: &description_prod_delibdem_vdem |- Question: To what extent is the ideal of deliberative democracy achieved? @@ -152,6 +176,8 @@ tables: ## 2.1.5 Egalitarian democracy index egaldem_vdem: title: Egalitarian democracy index + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: &description_prod_egaldem_vdem |- Question: To what extent is the ideal of egalitarian democracy achieved? @@ -182,6 +208,8 @@ tables: ## 2.2.3 Freedom of Expression and Alternative Sources of Information index freeexpr_vdem: title: Freedom of Expression and Alternative Sources of Information index + description_short: |- + Best estimate of the extent to which people can discuss political matters at home and in the public sphere, the press and media are free and can present different political perspectives, and the freedom of academic and cultural expression. description_from_producer: &description_prod_freexpr_vdem |- Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? @@ -211,6 +239,8 @@ tables: ## 2.2.4 Freedom of association thick index freeassoc_vdem: title: Freedom of association thick index + description_short: |- + Best estimate of the extent to which parties, including opposition parties, are allowed to form and participate in elections, and the extent to which civil society organizations are allowed to form and operate freely. description_from_producer: &description_prod_freeassoc_vdem |- Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? @@ -238,6 +268,8 @@ tables: ## 2.2.5 Share of population with suffrage suffr_vdem: title: Share of population with suffrage + description_short: |- + Share of adult citizens which have the legal right to vote in national elections. description_from_producer: |- Question: What share of adult citizens as defined by statute has the legal right to vote in national elections? @@ -245,7 +277,10 @@ tables: This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or 'economic independence', estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. Indicator name: `v2x_suffr` - description_processing: Converted ratio (0-1) into share (0-100%). + description_processing: |- + Converted ratio (0-1) into share (0-100%). + + {definitions.common.description_processing} unit: '%' display: numDecimalPlaces: 3 @@ -253,6 +288,8 @@ tables: ## 2.2.6 Clean elections index electfreefair_vdem: title: Clean elections index + description_short: |- + Best estimate of the extent to which registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence are absent, and the election management body is autonomous and has enough staff and resources. description_from_producer: &description_prod_electfreefair_vdem |- Question: To what extent are elections free and fair? @@ -282,6 +319,8 @@ tables: ## 2.2.7 Elected officials index electoff_vdem: title: Elected officials index + description_short: |- + Measures the extent to which the legislature is chosen through broad elections, and the chief executive is elected directly or indirectly (appointed by a popularly elected legislature). description_from_producer: |- Question: Is the chief executive and legislature appointed through popular elections? @@ -295,6 +334,8 @@ tables: ## 2.2.8 Liberal component index lib_vdem: title: Liberal component index + description_short: |- + Best estimate of the extent of individual and minority rights, equality before the law, and executive constraints. description_from_producer: &description_prod_lib_vdem |- Question: To what extent is the liberal principle of democracy achieved? @@ -324,6 +365,8 @@ tables: ## 2.2.9 Equality before the law and individual liberty index indiv_libs_vdem: title: Equality before the law and individual liberty index + description_short: |- + Best estimate of the extent to which extent to which citizens enjoy physical integrity rights, freedoms of religion, of movement, and from forced labor, as well as access to justice, laws are transparent and public administration is impartial. description_from_producer: &description_prod_indiv_libs_vdem |- Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? @@ -351,7 +394,9 @@ tables: ## 2.2.10 Judicial constraints on the executive index judicial_constr_vdem: title: "Judicial constraints on the executive index" - description_from_producer: &description_prod_judicial_constr_vdem_low |- + description_short: |- + Best estimate of the extent to which the executive respects the constitution, complies with the judiciary and high courts, and higher and lower courts are independent. + description_from_producer: &description_prod_judicial_constr_vdem |- Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? Scale: Interval, from low to high (0-1). @@ -362,15 +407,15 @@ tables: numDecimalPlaces: 3 judicial_constr_vdem_low: - title: "{tables.vdem.variables.judicial_constr_vdem_low.title} (upper bound)" - description_from_producer: *description_prod_judicial_constr_vdem_low + title: "{tables.vdem.variables.judicial_constr_vdem.title} (upper bound)" + description_from_producer: *description_prod_judicial_constr_vdem unit: '' display: numDecimalPlaces: 3 judicial_constr_vdem_high: - title: "{tables.vdem.variables.judicial_constr_vdem_low.title} (lower bound)" - description_from_producer: *description_prod_judicial_constr_vdem_low + title: "{tables.vdem.variables.judicial_constr_vdem.title} (lower bound)" + description_from_producer: *description_prod_judicial_constr_vdem unit: '' display: numDecimalPlaces: 3 @@ -378,6 +423,8 @@ tables: ## 2.2.11 Legislative constraints on the executive index legis_constr_vdem: title: Legislative constraints on the executive index + description_short: |- + Best estimate of the extent to which the legislature, including opposition parties, questions executive officials and oversees and investigates the executive. description_from_producer: &description_prod_legis_constr_vdem |- Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? @@ -407,6 +454,8 @@ tables: ## 2.2.12 Participatory component index particip_vdem: title: Participatory component index + description_short: |- + Best estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. description_from_producer: &description_prod_particip_vdem |- Question: To what extent is the participatory principle achieved? @@ -437,6 +486,8 @@ tables: ## 2.2.13 Civil society participation index civsoc_particip_vdem: title: Civil society participation index + description_short: |- + Best estimate of the extent to which major civil society organization are routinely consulted by policymakers, how many people are involved in them, women can participate, and candidate nomination for the legislature within parties is decentralized or made through primaries. description_from_producer: &description_prod_civsoc_particip_vdem |- Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? @@ -470,6 +521,8 @@ tables: ## 2.2.14 Direct popular vote index dirpop_vote_vdem: title: Direct popular vote index + description_short: |- + Measures the extent of how easy it is for citizens to vote on specific issues themselves in popular initiatives, referendums, and plebiscites. description_from_producer: |- Question: To what extent is the direct popular vote utilized? @@ -485,6 +538,8 @@ tables: ## 2.2.15 Local government index locelect_vdem: title: "Local government index" + description_short: |- + Best estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. description_from_producer: &description_prod_locelect_vdem |- Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? @@ -514,6 +569,8 @@ tables: ## 2.2.16 Regional government index regelect_vdem: title: Regional government index + description_short: |- + Best estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. description_from_producer: &description_prod_regelect_vdem |- Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? @@ -543,6 +600,8 @@ tables: # 2.2.17 Deliberative component index delib_vdem: title: Deliberative component index + description_short: |- + Best estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. description_from_producer: &description_prod_delib_vdem |- Question: To what extent is the deliberative principle of democracy achieved? @@ -576,6 +635,8 @@ tables: ## 2.2.18 Egalitarian component index egal_vdem: title: Egalitarian component index + description_short: |- + Best estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: &description_prod_egal_vdem |- Question: To what extent is the egalitarian principle achieved? @@ -605,6 +666,8 @@ tables: ## 2.2.19 Equal protection index equal_rights_vdem: title: Equal protection index + description_short: |- + Best estimate of the extent to which the state protects the rights and freedoms across social groups equally. description_from_producer: &description_prod_equal_rights_vdem |- Question: How equal is the protection of rights and freedoms across social groups by the state? @@ -634,6 +697,8 @@ tables: ## 2.2.20 Equal access index equal_access_vdem: title: Equal access index + description_short: |- + Best estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. description_from_producer: &description_prod_equal_access_vdem |- Question: How equal is access to power? @@ -663,6 +728,8 @@ tables: ## 2.2.21 Equal distribution of resources index equal_res_vdem: title: Equal distribution of resources index + description_short: |- + Best estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. description_from_producer: &description_prod_equal_res_vdem |- Question: How equal is the distribution of resources? @@ -692,6 +759,9 @@ tables: ## 3.1.3.3 Election turnout turnout_vdem: title: Election turnout + description_short: |- + Denotes the voter turnout as a share of all registered voters in the national election according to official results. + description_from_producer: |- Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? @@ -703,6 +773,8 @@ tables: # 3.4.2.18 HOS female wom_hos_vdem: title: HOS female + description_short: |- + Denotes whether the head of state in office on December 31 is a woman. description_from_producer: |- If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. @@ -714,6 +786,8 @@ tables: ## 3.4.3.16 HOG female wom_hog_vdem: title: HOG female + description_short: |- + Denotes whether the head of government in office on December 31 is a woman. description_from_producer: |- Question: What is the gender of the head of government? @@ -770,6 +844,8 @@ tables: ## 3.5.3.7 Lower chamber female legislators wom_parl_vdem: title: Lower chamber female legislators + description_short: |- + Percentage of women in the lower or single chamber of the legislature. description_from_producer: |- Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? @@ -781,6 +857,8 @@ tables: ## 3.6.0.1 Reasoned justification justified_polch_vdem: title: Reasoned justification + description_short: |- + Best estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. description_from_producer: &description_prod_justified_polch_vdem |- Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? @@ -815,6 +893,8 @@ tables: ## 3.6.0.2 Common good justcomgd_polch_vdem: title: Common good + description_short: |- + Best estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. description_from_producer: &description_prod_justcomgd_polch_vdem |- Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? @@ -849,6 +929,8 @@ tables: ## 3.6.0.3 Respect counterarguments counterarg_polch_vdem: title: Respect counterarguments + description_short: |- + Best estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. description_from_producer: &description_prod_counterarg_polch_vdem |- Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? @@ -885,6 +967,8 @@ tables: ### 3.6.0.4 Range of consultation elitecons_polch_vdem: title: Range of consultation + description_short: |- + Best estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. description_from_producer: &description_prod_elitecons_polch_vdem |- Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? @@ -921,6 +1005,8 @@ tables: ## 3.6.0.5 Engaged society soccons_polch_vdem: title: Engaged society + description_short: |- + Best estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. description_from_producer: &description_prod_soccons_polch_vdem |- Question: When important policy changes are being considered, how wide and how independent are public deliberations? @@ -993,6 +1079,8 @@ tables: ## 3.8.2.2 Rigorous and impartial public administration public_admin_vdem: title: Rigorous and impartial public administration + description_short: |- + Best estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. description_from_producer: &description_prod_public_admin_vdem |- Question: Are public officials rigorous and impartial in the performance of their duties? @@ -1031,7 +1119,9 @@ tables: ## 3.8.2.6 Social group equality in respect for civil liberties socgr_civ_libs_vdem: - title: '' + title: Social group equality in respect for civil liberties + description_short: |- + Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. description_from_producer: &description_prod_socgr_civ_libs_vdem |- Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? @@ -1066,6 +1156,8 @@ tables: ## 3.9.0.1 Domestic autonomy dom_auton_vdem: title: Domestic autonomy + description_short: |- + Best estimate of the extent to which domestic policy is free from the interference of other states. description_from_producer: &description_prod_dom_auton_vdem |- Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? @@ -1100,6 +1192,8 @@ tables: ## 3.9.0.2 International autonomy int_auton_vdem: title: International autonomy + description_short: |- + Best estimate of the extent to which foreign policy is free from the interference of other states. description_from_producer: &description_prod_int_auton_vdem |- Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? @@ -1130,6 +1224,8 @@ tables: ## 3.9.0.3 State authority over territory terr_contr_vdem: title: State authority over territory + description_short: |- + Best estimate of the percentage of territory controlled by the government. description_from_producer: &description_prod_terr_contr_vdem |- Question: Over what percentage (%) of the territory does the state have effective control? @@ -1160,6 +1256,8 @@ tables: ## 3.12.0.2 Power distributed by social group socgr_pow_vdem: title: Power distributed by social group + description_short: |- + Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. description_from_producer: &description_prod_socgr_pow_vdem |- Question: Is political power distributed according to social groups? @@ -1194,11 +1292,13 @@ tables: ## 5.4.3 Presidentialism Index personalism_vdem: title: Presidentialism Index + description_short: |- + Best estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. description_from_producer: &description_prod_personalism_vdem |- Question: To what extent is the regime characterized by presidentialism? Clarification: - Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem’s index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem's index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. Scale: Interval, from low to high (0-1). @@ -1224,6 +1324,8 @@ tables: ## 5.5.1 Civil liberties index civ_libs_vdem: title: Civil liberties index + description_short: |- + Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. description_from_producer: &description_prod_civ_libs_dem |- Question: To what extent is civil liberty respected? @@ -1253,6 +1355,8 @@ tables: ## 5.5.4 Private civil liberties index priv_libs_vdem: title: Private civil liberties index + description_short: |- + Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. description_from_producer: &description_prod_priv_libs_vdem |- Question: To what extent are private liberties respected? @@ -1282,6 +1386,8 @@ tables: ## 5.5.3 Political civil liberties index pol_libs_vdem: title: Political civil liberties index + description_short: |- + Central estimate of the extent to which people enjoy the freedoms of expression and association. description_from_producer: &description_prod_pol_libs_vdem |- Question: To what extent are political liberties respected? @@ -1311,6 +1417,8 @@ tables: ## 5.5.2 Physical violence index phys_integr_libs_vdem: title: Physical violence index + description_short: |- + Central estimate of the extent to which people are free from government torture and political killings. description_from_producer: &description_prod_phys_integr_libs_vdem |- Question: To what extent is physical integrity respected? @@ -1340,6 +1448,8 @@ tables: ## 5.7.1 Political corruption index corruption_vdem: title: Political corruption index + description_short: |- + Best estimate of the extent to which a country is affected by political corruption. description_from_producer: &description_prod_corruption_vdem |- Question: How pervasive is political corruption? @@ -1366,7 +1476,7 @@ tables: display: numDecimalPlaces: 3 - ## 5.7.3 Public sector corruption index + ## 5.7.3 Public sector corruption index [Not in use] corr_publsec_vdem: title: Public sector corruption index description_from_producer: &description_prod_corr_publsec_vdem |- @@ -1395,7 +1505,7 @@ tables: display: numDecimalPlaces: 3 - ## 5.7.2 Executive corruption index + ## 5.7.2 Executive corruption index [Not in use] corr_exec_vdem: title: Executive corruption index description_from_producer: &description_prod_corr_exec_vdem |- @@ -1427,10 +1537,12 @@ tables: ## 5.8.1 Women political empowerment index wom_emp_vdem: title: Women political empowerment index + description_short: |- + Best estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. description_from_producer: &description_prod_wom_emp_vdem |- Question: How politically empowered are women? - Clarification: Women’s political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women’s open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. + Clarification: Women's political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women's open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. Scale: Interval, from low to high (0-1). @@ -1456,10 +1568,12 @@ tables: ## 5.8.2 Women civil liberties index wom_civ_libs_vdem: title: Women civil liberties index + description_short: |- + Best estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. description_from_producer: &description_prod_wom_civ_libs_vdem |- Question: Do women have the ability to make meaningful decisions in key areas of their lives? - Clarification: Women’s civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. + Clarification: Women's civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. Scale: Interval, from low to high (0-1). @@ -1476,7 +1590,7 @@ tables: numDecimalPlaces: 3 wom_civ_libs_vdem_high: - title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" + title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (upper bound)" description_from_producer: *description_prod_wom_civ_libs_vdem unit: '' display: @@ -1485,10 +1599,12 @@ tables: ## 5.8.3 Women civil society participation index wom_civ_soc_vdem: title: Women civil society participation index + description_short: |- + Best estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. description_from_producer: &description_prod_wom_civ_soc_vdem |- Question: Do women have the ability to express themselves and to form and participate in groups? - Clarification: Women’s civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. + Clarification: Women's civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. Scale: Interval, from low to high (0-1). @@ -1514,6 +1630,8 @@ tables: ## 5.8.4 Women political participation index wom_pol_par_vdem: title: Women political participation index + description_short: |- + Best estimate of the extent to which women are represented in the legislature and have an equal share of political power. description_from_producer: &description_prod_wom_pol_par_vdem |- Question: Are women descriptively represented in formal political positions? @@ -1543,6 +1661,8 @@ tables: ## 5.9.1 Rule of law index rule_of_law_vdem: title: Rule of law index + description_short: |- + Best estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. description_from_producer: &description_prod_rule_of_law_vdem |- Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? @@ -1567,7 +1687,7 @@ tables: display: numDecimalPlaces: 3 - ## 5.11.1 Core civil society index + ## 5.11.1 Core civil society index [not in use] civ_soc_str_vdem: title: Core civil society index description_from_producer: &description_prod_civ_soc_str_vdem |- @@ -1601,21 +1721,24 @@ tables: ## 9.4.2 Government effectiveness goveffective_vdem_wbgi: title: Government effectiveness + description_short: |- + Denotes perceptions of the quality of public services, the civil service, and policy formulation and implementation (positive values mean higher effectiveness) based on the data from the World Governance Indicators. + description_from_producer: |- - "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government’s commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. + "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government's commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. Indicator name: `e_wbgi_gee` unit: '' display: numDecimalPlaces: 3 - ## 9.9.3 Corruption perception index + ## 9.9.3 Corruption perception index [not in use] corruption_cpi: title: Corruption perception index description_from_producer: |- The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). - Notes: The data spans 2012–present due to the methodological incomparability with the data prior 2012. + Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. unit: '' display: numDecimalPlaces: 0 @@ -1638,6 +1761,8 @@ tables: Scale: Ordinal, converted to interval by the measurement model. description_processing: &description_processing_electmulpar_row |- We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 @@ -1662,40 +1787,62 @@ tables: display: numDecimalPlaces: 0 - ## v2elmulpar_osp_hoe. TODO: extract from v2elmulpar_osp_hos, v2elmulpar_osp_hog + ## [CUSTOM] electmulpar_hoe_row_owid: - title: '' + title: Multi-party elections for government's chief executive + description_short: |- + unit: '' + description_processing: &description_processing_electmulpar_hoe_row_owid |- + {definitions.auxiliary.description_processing_row} + + Finally, we make some additional minor changes to the coding rules. + + The two most consequential changes we make relate to RoW's identification of whether a country's chief executive is elected. First, one way RoW considers a chief executive to have been elected — even if they are not directly elected or appointed by the legislature — is if they are the head of state, they depend on the approval of the legislature, and there were multi-party elections for the executive. This last part is likely a coding error because to be consistent with RoW's other definitions, this should depend on multi-party legislative, not executive, elections. Only if the legislature has been chosen in multi-party elections does it make an otherwise unelected chief executive—who must be approved by that legislature—dependent on multi-party elections. We correct this error. + + Second, RoW considers a chief executive to have been elected if the country had chosen both its legislature and executive in multi-party elections. But this considers some chief executives as elected even if they came to power through force after elections were previously held. Examples include the coup d'états led by Fulgencio Batista in Cuba in 1952 and by Muhammadu Buhari in Nigeria in 1983. We instead consider such chief executives as unelected. display: numDecimalPlaces: 0 electmulpar_hoe_high_row_owid: - title: '' + title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (upper bound)" unit: '' + description_processing: *description_processing_electmulpar_hoe_row_owid display: numDecimalPlaces: 0 electmulpar_hoe_low_row_owid: - title: '' + title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (lower bound)" unit: '' + description_processing: *description_processing_electmulpar_hoe_row_owid display: numDecimalPlaces: 0 - ## v2elmulpar_osp_leg_dich. TODO: from v2elmulpar_osp_leg + ## [CUSTOM, based on `v2elmulpar_osp`] electmulpar_leg_row: - title: '' + title: Multiparty elections for legislature + description_short: |- + Best estimate of whether multi-party elections for the national legislature were held or not. + description_processing: &description_proc_electmulpar_leg_row |- + Use the value from `v2elmulpar_osp` whenever `v2eltype` is 0, 1, 4 or 5. Otherwise the value is missing. unit: '' display: numDecimalPlaces: 0 electmulpar_leg_high_row: - title: '' + title: "{tables.vdem.variables.electmulpar_leg_row.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether multi-party elections for the national legislature were held or not. + description_processing: *description_proc_electmulpar_leg_row unit: '' display: numDecimalPlaces: 0 electmulpar_leg_low_row: - title: '' + title: "{tables.vdem.variables.electmulpar_leg_row.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether multi-party elections for the national legislature were held or not. + description_processing: *description_proc_electmulpar_leg_row unit: '' display: numDecimalPlaces: 0 @@ -1707,7 +1854,9 @@ tables: Best estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: *description_prod_electdem_vdem description_processing: |- - We use a threshold of 0.5 on `v2x_polyarchy_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 0.5 to classify the original indicator (`v2x_polyarchy_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 @@ -1748,7 +1897,9 @@ tables: Scale: Ordinal, converted to interval by the measurement model. description_processing: &description_processing_electfreefair_row |- - We use a threshold of 2 on `v2elfrfair_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 2 to classify the original indicator (`v2elfrfair_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 @@ -1777,7 +1928,9 @@ tables: description_short: Best estimate of whether the country has meaningfully liberal political institutions description_from_producer: *description_prod_lib_vdem description_processing: &description_processing_lib_dich_row |- - We use a threshold of 0.8 on `v2x_liberal` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 @@ -1802,7 +1955,7 @@ tables: ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men accessjust_m_row: - title: Access to justice for women (re-estimate) + title: Access to justice for men (re-estimate) description_short: Best estimate of whether men have access to justice or not. description_from_producer: &description_prod_accessjust_m_row |- Question: Do men enjoy secure and effective access to justice? @@ -1819,13 +1972,15 @@ tables: Scale: Ordinal, converted to interval by the measurement model. description_processing: &description_processing_accessjust_m_row |- - We use a threshold of 3 on `v2clacjstm_osp*` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstm_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 accessjust_m_high_row: - title: "{tables.vdem.variables.accessjust_m_high_row.title} (upper bound)" + title: "{tables.vdem.variables.accessjust_m_row.title} (upper bound)" description_short: Upper-bound estimate of whether men have access to justice or not. description_from_producer: *description_prod_accessjust_m_row description_processing: *description_processing_accessjust_m_row @@ -1834,7 +1989,7 @@ tables: numDecimalPlaces: 0 accessjust_m_low_row: - title: "{tables.vdem.variables.accessjust_m_high_row.title} (lower bound)" + title: "{tables.vdem.variables.accessjust_m_row.title} (lower bound)" description_short: Lower-bound estimate of whether men have access to justice or not. description_from_producer: *description_prod_accessjust_m_row description_processing: *description_processing_accessjust_m_row @@ -1842,7 +1997,7 @@ tables: display: numDecimalPlaces: 0 - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women + # [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women accessjust_w_row: title: Access to justice for women (re-estimate) description_short: Best estimate of whether women have access to justice or not. @@ -1861,13 +2016,15 @@ tables: Scale: Ordinal, converted to interval by the measurement model. description_processing: &description_processing_accessjust_w_row |- - We use a threshold of 3 on `v2clacjstw_osp*` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 accessjust_w_high_row: - title: "{tables.vdem.variables.accessjust_w_high_row.title} (upper bound)" + title: "{tables.vdem.variables.accessjust_w_row.title} (upper bound)" description_short: Upper-bound estimate of whether women have access to justice or not. description_from_producer: *description_prod_accessjust_w_row description_processing: *description_processing_accessjust_w_row @@ -1876,7 +2033,7 @@ tables: numDecimalPlaces: 0 accessjust_w_low_row: - title: "{tables.vdem.variables.accessjust_w_low_row.title} (lower bound)" + title: "{tables.vdem.variables.accessjust_w_row.title} (lower bound)" description_short: Lower-bound estimate of whether women have access to justice or not. description_from_producer: *description_prod_accessjust_w_row description_processing: *description_processing_accessjust_w_row @@ -1903,7 +2060,9 @@ tables: Scale: Ordinal, converted to interval by the measurement model. description_processing: &description_processing_transplaws |- - We use a threshold of 3 on `v2cltrnslw_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2cltrnslw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 @@ -1945,33 +2104,98 @@ tables: Uses HOG if: - If head of state is less powerful than head of government - We derive this indicator from V-Dem indicators: v2exfemhos, v2exfemhog, v2ex_hosw, and v2ex_hogw. + We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. unit: '' display: numDecimalPlaces: 0 ## Other regime indicators - regime_row_owid: - title: '' - unit: '' - display: - numDecimalPlaces: 0 - regime_amb_row_owid: - title: '' + title: Political regime (inc. ambiguous categories) unit: '' + description_short: |- + Political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg, including ambiguous categories. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 3), electoral democracies (score 6), and liberal democracies (score 9) as the main types. + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). + description_processing: "{definitions.auxiliary.description_processing_row}" display: numDecimalPlaces: 0 regime_redux_row_owid: - title: '' + title: Political regime + description_short: |- + Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 1), and electoral democracies (score 2, including liberal democracies). + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + description_processing: "{definitions.auxiliary.description_processing_row}" unit: '' display: numDecimalPlaces: 0 + # NEW + num_years_in_electdem_consecutive: # electdem_age_row_owid + title: Age of electoral democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_electdem + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + unit: years + + num_years_in_electdem: # electdem_exp_row_owid + title: Experience with electoral democracy + description_short: Number of total years in electoral democracy. It sums all periods of electoral democracy. + description_key: *description_key_num_electdem + unit: years + + num_years_in_electdem_cat: # electdem_age_group_row_owid + title: Electoral democracy age group + description_short: Category of electoral democracies based on the country's age of electoral democracy. + description_key: *description_key_num_electdem + unit: '' + + num_years_in_libdem_consecutive: # libdem_age_row_owid + title: Age of liberal democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_libdem + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + unit: years + + num_years_in_libdem: # libdem_exp_row_owid + title: Experience with liberal democracy + description_processing: Number of total years in liberal democracy. It sums all periods of liberal democracy. + description_key: *description_key_num_libdem + unit : years + + num_years_in_libdem_cat: # libdem_age_group_row_owid + title: Liberal democracy age group + description_short: Category of liberal democracies based on the country's age of liberal democracy. + description_processing: Number of consecutive years in liberal democracy. + description_key: *description_key_num_libdem + unit : '' + + + wom_parl_vdem_cat: + title: wom_parl_vdem_cat + description_short: '' + unit: '' + + # Not used regime_imputed: - title: '' + title: 'Data imputed from another country' + description_short: Denotes whether we imputed regime information from another country this one was historically a part of. unit: '' display: numDecimalPlaces: 0 + regime_row_owid: + title: regime_row_owid + unit: '' + display: + numDecimalPlaces: 0 diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index e01790afee3..8557edc4e0c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -28,9 +28,6 @@ def run(tb: Table) -> Table: # Sort tb = tb.sort_values(["country", "year"]) - # Copy origins (some indicators will loose their 'origins' in metadata) - origins = deepcopy(tb["country"].metadata.origins) - # %% Create expanded and refined Regimes of the World indicator # (L76-L94) Create indicators for multi-party elections, and free and fair elections tb = estimate_mulpar_indicators(tb) @@ -75,11 +72,6 @@ def run(tb: Table) -> Table: tb.loc[(tb["wom_hos_vdem"].notna()) & (tb["v2exhoshog"] == 1), "wom_hog_vdem"] = tb["wom_hos_vdem"] tb = tb.drop(columns=["v2exhoshog"]) - # %% Bring origins back - columns = [col for col in tb.columns if col not in ["country", "year"]] - for col in columns: - tb[col].metadata.origins = origins - return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py index db63586a24e..4ccf1a12ea6 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py @@ -44,6 +44,8 @@ def _add_regime_type(tb: Table, column_new: str, threshold: int) -> Table: tb["num_years_in_electdem"] = tb.groupby("country")["regime_electdem"].cumsum() tb["num_years_in_libdem"] = tb.groupby("country")["regime_libdem"].cumsum() + # Drop unused columns + tb = tb.drop(columns=["regime_electdem", "regime_libdem"]) return tb From 1d88e9bfc4bd07687b82796789711d4336148a63 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 28 Mar 2024 18:54:22 +0100 Subject: [PATCH 27/62] wip --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 83 +++++++++---------- .../democracy/2024-03-07/vdem/vdem_impute.py | 3 + 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 9baca6cbe85..fe1b0461e1c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -112,7 +112,7 @@ tables: # 2.1.3 Participatory democracy index participdem_vdem: - title: Participatory democracy index + title: Extent of direct popular votes description_short: |- Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. description_from_producer: &description_prod_participdem_vdem |- @@ -453,7 +453,7 @@ tables: ## 2.2.12 Participatory component index particip_vdem: - title: Participatory component index + title: Participatory political institutions description_short: |- Best estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. description_from_producer: &description_prod_particip_vdem |- @@ -537,7 +537,7 @@ tables: ## 2.2.15 Local government index locelect_vdem: - title: "Local government index" + title: "Elected local governments" description_short: |- Best estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. description_from_producer: &description_prod_locelect_vdem |- @@ -568,7 +568,7 @@ tables: ## 2.2.16 Regional government index regelect_vdem: - title: Regional government index + title: Elected regional governments description_short: |- Best estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. description_from_producer: &description_prod_regelect_vdem |- @@ -599,7 +599,7 @@ tables: # 2.2.17 Deliberative component index delib_vdem: - title: Deliberative component index + title: Deliberative political institutions index description_short: |- Best estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. description_from_producer: &description_prod_delib_vdem |- @@ -634,7 +634,7 @@ tables: ## 2.2.18 Egalitarian component index egal_vdem: - title: Egalitarian component index + title: Egalitarian political institutions index description_short: |- Best estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: &description_prod_egal_vdem |- @@ -665,7 +665,7 @@ tables: ## 2.2.19 Equal protection index equal_rights_vdem: - title: Equal protection index + title: Equal rights protection index description_short: |- Best estimate of the extent to which the state protects the rights and freedoms across social groups equally. description_from_producer: &description_prod_equal_rights_vdem |- @@ -696,7 +696,7 @@ tables: ## 2.2.20 Equal access index equal_access_vdem: - title: Equal access index + title: Equal access to power index description_short: |- Best estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. description_from_producer: &description_prod_equal_access_vdem |- @@ -727,7 +727,7 @@ tables: ## 2.2.21 Equal distribution of resources index equal_res_vdem: - title: Equal distribution of resources index + title: Equal resource distribution index description_short: |- Best estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. description_from_producer: &description_prod_equal_res_vdem |- @@ -758,7 +758,7 @@ tables: ## 3.1.3.3 Election turnout turnout_vdem: - title: Election turnout + title: Voter turnout description_short: |- Denotes the voter turnout as a share of all registered voters in the national election according to official results. @@ -771,8 +771,8 @@ tables: numDecimalPlaces: 2 # 3.4.2.18 HOS female - wom_hos_vdem: - title: HOS female + wom_hos_vdem: # wom_hos_vdem_owid + title: Woman head of state description_short: |- Denotes whether the head of state in office on December 31 is a woman. description_from_producer: |- @@ -784,8 +784,8 @@ tables: numDecimalPlaces: 0 ## 3.4.3.16 HOG female - wom_hog_vdem: - title: HOG female + wom_hog_vdem: # wom_hog_vdem_owid + title: Woman head of government description_short: |- Denotes whether the head of government in office on December 31 is a woman. description_from_producer: |- @@ -804,7 +804,7 @@ tables: ## 3.5.1.6 Legislature corrupt activities corr_leg_vdem: - title: Legislature corrupt activities + title: Legislative corruption description_from_producer: &description_prod_corr_leg_vdem |- Question: Do members of the legislature abuse their position for financial gain? @@ -856,7 +856,7 @@ tables: ## 3.6.0.1 Reasoned justification justified_polch_vdem: - title: Reasoned justification + title: Justified political positions description_short: |- Best estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. description_from_producer: &description_prod_justified_polch_vdem |- @@ -892,7 +892,7 @@ tables: ## 3.6.0.2 Common good justcomgd_polch_vdem: - title: Common good + title: Common good justifications description_short: |- Best estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. description_from_producer: &description_prod_justcomgd_polch_vdem |- @@ -928,7 +928,7 @@ tables: ## 3.6.0.3 Respect counterarguments counterarg_polch_vdem: - title: Respect counterarguments + title: Respect for counterarguments description_short: |- Best estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. description_from_producer: &description_prod_counterarg_polch_vdem |- @@ -966,7 +966,7 @@ tables: ### 3.6.0.4 Range of consultation elitecons_polch_vdem: - title: Range of consultation + title: Elite consultation description_short: |- Best estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. description_from_producer: &description_prod_elitecons_polch_vdem |- @@ -1043,7 +1043,7 @@ tables: ## 3.7.0.6 Judicial corruption decision corr_jud_vdem: - title: Judicial corruption decision + title: Judicial corruption description_from_producer: &description_prod_corr_jud_vdem |- Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? @@ -1119,7 +1119,7 @@ tables: ## 3.8.2.6 Social group equality in respect for civil liberties socgr_civ_libs_vdem: - title: Social group equality in respect for civil liberties + title: Equality of civil liberties across social groups description_short: |- Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. description_from_producer: &description_prod_socgr_civ_libs_vdem |- @@ -1155,7 +1155,7 @@ tables: ## 3.9.0.1 Domestic autonomy dom_auton_vdem: - title: Domestic autonomy + title: Domestic policymaking free from foreign influence description_short: |- Best estimate of the extent to which domestic policy is free from the interference of other states. description_from_producer: &description_prod_dom_auton_vdem |- @@ -1191,7 +1191,7 @@ tables: ## 3.9.0.2 International autonomy int_auton_vdem: - title: International autonomy + title: Foreign policymaking free from foreign influence description_short: |- Best estimate of the extent to which foreign policy is free from the interference of other states. description_from_producer: &description_prod_int_auton_vdem |- @@ -1223,7 +1223,7 @@ tables: ## 3.9.0.3 State authority over territory terr_contr_vdem: - title: State authority over territory + title: Territory under state control description_short: |- Best estimate of the percentage of territory controlled by the government. description_from_producer: &description_prod_terr_contr_vdem |- @@ -1255,7 +1255,7 @@ tables: ## 3.12.0.2 Power distributed by social group socgr_pow_vdem: - title: Power distributed by social group + title: Equality of political power across social groups description_short: |- Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. description_from_producer: &description_prod_socgr_pow_vdem |- @@ -1416,7 +1416,7 @@ tables: ## 5.5.2 Physical violence index phys_integr_libs_vdem: - title: Physical violence index + title: Physical integrity liberties description_short: |- Central estimate of the extent to which people are free from government torture and political killings. description_from_producer: &description_prod_phys_integr_libs_vdem |- @@ -1536,7 +1536,7 @@ tables: ## 5.8.1 Women political empowerment index wom_emp_vdem: - title: Women political empowerment index + title: Women's political empowerment index description_short: |- Best estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. description_from_producer: &description_prod_wom_emp_vdem |- @@ -1567,7 +1567,7 @@ tables: ## 5.8.2 Women civil liberties index wom_civ_libs_vdem: - title: Women civil liberties index + title: Women's civil rights index description_short: |- Best estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. description_from_producer: &description_prod_wom_civ_libs_vdem |- @@ -1598,7 +1598,7 @@ tables: ## 5.8.3 Women civil society participation index wom_civ_soc_vdem: - title: Women civil society participation index + title: Women's civil society participation index description_short: |- Best estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. description_from_producer: &description_prod_wom_civ_soc_vdem |- @@ -1629,7 +1629,7 @@ tables: ## 5.8.4 Women political participation index wom_pol_par_vdem: - title: Women political participation index + title: Women's political participation index description_short: |- Best estimate of the extent to which women are represented in the legislature and have an equal share of political power. description_from_producer: &description_prod_wom_pol_par_vdem |- @@ -1660,7 +1660,7 @@ tables: ## 5.9.1 Rule of law index rule_of_law_vdem: - title: Rule of law index + title: Rule of Law index description_short: |- Best estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. description_from_producer: &description_prod_rule_of_law_vdem |- @@ -1734,7 +1734,7 @@ tables: ## 9.9.3 Corruption perception index [not in use] corruption_cpi: - title: Corruption perception index + title: Corruption perceptions index description_from_producer: |- The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). @@ -1745,7 +1745,7 @@ tables: ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty electmulpar_row: - title: Elections multiparty (re-estimate) + title: Multiparty elections (re-estimate) description_short: |- Best estimate of whether national multi-party elections were held or not. description_from_producer: &description_prod_electmulpar_vdem |- @@ -1881,7 +1881,7 @@ tables: ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair electfreefair_row: - title: Election free and fair (re-estimate) + title: Free and fair elections (re-estimate) description_short: Best estimate of whether national elections were free and fair or not. description_from_producer: &description_prod_electfreefair_row |- Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? @@ -1924,7 +1924,7 @@ tables: ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index lib_dich_row: - title: Liberal component (re-estimate) + title: Liberal political institutions (re-estimate) description_short: Best estimate of whether the country has meaningfully liberal political institutions description_from_producer: *description_prod_lib_vdem description_processing: &description_processing_lib_dich_row |- @@ -2089,8 +2089,8 @@ tables: ## HOE female (custom) # NOTE: Add adjustment in citation_full - wom_hoe_vdem: - title: HOE female + wom_hoe_vdem: # wom_hoe_vdem_owid + title: Woman head of executive description_short: |- The variable denotes whether the chief executive of government in office on December 31 is a woman. description_processing: |- @@ -2180,15 +2180,14 @@ tables: description_key: *description_key_num_libdem unit : '' - - wom_parl_vdem_cat: - title: wom_parl_vdem_cat - description_short: '' + wom_parl_vdem_cat: # wom_parl_gr_vdem_owid + title: Women in parliament (category) + description_short: Categorisation of women's political representation in parliament unit: '' # Not used regime_imputed: - title: 'Data imputed from another country' + title: Data imputed from another country description_short: Denotes whether we imputed regime information from another country this one was historically a part of. unit: '' display: diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py index 8d43d2cb419..5ae0d6eef4b 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -106,6 +106,9 @@ def run(tb: Table) -> Table: tb = concat(tb_imputed + [tb], ignore_index=True) + # Fill NaNs with False + tb["regime_imputed"] = tb["regime_imputed"].fillna(False) + # Check unique values tb.format(underscore=False).reset_index() From 9d0e28f55f31a9e2a0c1fa314285ae6fd11b0409 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 28 Mar 2024 18:55:07 +0100 Subject: [PATCH 28/62] wip --- etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index 8557edc4e0c..a695d2c6511 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -2,7 +2,6 @@ ref: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_do """ -from copy import deepcopy from typing import Union, cast import numpy as np From beef8ec5219ad908d4a497d3ddbbb5790fd63b49 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 29 Mar 2024 13:28:52 +0100 Subject: [PATCH 29/62] wip --- dag/democracy.yml | 6 + .../democracy/2024-03-07/vdem/__init__.py | 41 + .../2024-03-07/vdem/vdem.countries.json | 6 +- .../democracy/2024-03-08/vdem/__init__.py | 246 ++ .../2024-03-08/vdem/countries_impute.yml | 618 ++++ .../2024-03-08/vdem/debug.overlaps.json | 3069 +++++++++++++++++ .../2024-03-08/vdem/vdem.countries.json | 202 ++ .../vdem/vdem.excluded_countries.json | 2 + .../democracy/2024-03-08/vdem/vdem.meta.yml | 2200 ++++++++++++ 9 files changed, 6387 insertions(+), 3 deletions(-) create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json create mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml diff --git a/dag/democracy.yml b/dag/democracy.yml index 14f7435c2d3..680b81a2500 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -14,5 +14,11 @@ steps: - snapshot://democracy/2024-03-18/vdem.zip data://garden/democracy/2024-03-07/vdem: - data://meadow/democracy/2024-03-07/vdem + - data://garden/regions/2023-01-01/regions + - data://garden/demography/2023-03-31/population + data://garden/democracy/2024-03-08/vdem: + - data://garden/democracy/2024-03-07/vdem + - data://garden/regions/2023-01-01/regions + - data://garden/demography/2023-03-31/population data://grapher/democracy/2024-03-07/vdem: - data://garden/democracy/2024-03-07/vdem diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 0e3eeac6e57..e7d2282e760 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -8,11 +8,50 @@ import vdem_refine as refine # VDEM's imputing library from owid.catalog import Table +from etl.data_helpers import geo from etl.helpers import PathFinder, create_dataset # Get paths and naming conventions for current step. paths = PathFinder(__file__) +# REGION AGGREGATES +REGIONS = { + "Africa": { + "additional_members": [ + "Somaliland", + "Zanzibar", + ] + }, + "Asia": { + "additional_members": [ + "Palestine/Gaza", + "Palestine/West Bank", + ] + }, + "North America": {}, + "South America": {}, + "Europe": { + "additional_members": [ + "Brunswick", + "Duchy of Nassau", + "Hamburg", + "Hanover", + "Hesse Electoral", + "Hesse Grand Ducal", + "Mecklenburg Schwerin", + "Modena", + "Oldenburg", + "Piedmont-Sardinia", + "Saxe-Weimar-Eisenach", + "Saxony", + "Tuscany", + "Two Sicilies", + "Wurttemberg", + ] + }, + "Oceania": {}, +} + def run(dest_dir: str) -> None: # %% Load data @@ -21,6 +60,8 @@ def run(dest_dir: str) -> None: # # Load meadow dataset. ds_meadow = paths.load_dataset("vdem") + ds_regions = paths.load_dataset("regions") + ds_population = paths.load_dataset("population") # Read table from meadow dataset. tb = ds_meadow["vdem"].reset_index() diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json index cb8944dbf1c..7336203866c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -8,11 +8,9 @@ "Australia": "Australia", "Austria": "Austria", "Azerbaijan": "Azerbaijan", - "Baden": "Grand Duchy of Baden", "Bahrain": "Bahrain", "Bangladesh": "Bangladesh", "Barbados": "Barbados", - "Bavaria": "Kingdom of Bavaria", "Belarus": "Belarus", "Belgium": "Belgium", "Benin": "Benin", @@ -122,7 +120,6 @@ "Panama": "Panama", "Papua New Guinea": "Papua New Guinea", "Paraguay": "Paraguay", - "Parma": "Duchy of Parma and Piacenza", "Peru": "Peru", "Philippines": "Philippines", "Poland": "Poland", @@ -180,6 +177,8 @@ "Zambia": "Zambia", "Zanzibar": "Zanzibar", "Zimbabwe": "Zimbabwe", + "Baden": "Baden", + "Bavaria": "Bavaria", "Brunswick": "Brunswick", "Burma/Myanmar": "Myanmar", "Hamburg": "Hamburg", @@ -196,6 +195,7 @@ "The Gambia": "Gambia", "T\u00fcrkiye": "Turkey", "W\u00fcrtemberg": "Wurttemberg", + "Parma": "Parma", "Piedmont-Sardinia": "Piedmont-Sardinia", "Saxony": "Saxony", "Modena": "Modena" diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py new file mode 100644 index 00000000000..4bc2bb6670f --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py @@ -0,0 +1,246 @@ +"""Load a meadow dataset and create a garden dataset.""" +from typing import cast + +import pandas as pd +from owid.catalog import Table +from owid.catalog.processing import concat + +from etl.data_helpers import geo +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + +# REGION AGGREGATES +REGIONS = { + "Africa": { + "additional_members": [ + "Somaliland", + "Zanzibar", + ] + }, + "Asia": { + "additional_members": [ + "Palestine/Gaza", + "Palestine/West Bank", + ] + }, + "North America": {}, + "South America": {}, + "Europe": { + "additional_members": [ + "Brunswick", + "Duchy of Nassau", + "Hamburg", + "Hanover", + "Hesse Electoral", + "Hesse Grand Ducal", + "Mecklenburg Schwerin", + "Modena", + "Oldenburg", + "Piedmont-Sardinia", + "Saxe-Weimar-Eisenach", + "Saxony", + "Tuscany", + "Two Sicilies", + "Wurttemberg", + ] + }, + "Oceania": {}, +} + + +def run(dest_dir: str) -> None: + # %% Load data + # + # Load inputs. + # + # Load meadow dataset. + ds_meadow = paths.load_dataset("vdem") + ds_regions = paths.load_dataset("regions") + ds_population = paths.load_dataset("population") + + # Read table from meadow dataset. + tb = ds_meadow["vdem"].reset_index() + + # + # Process data. + # + # %% Aggregate: mean and sum of countries + tb_ = tb.loc[~tb["regime_imputed"]].copy() + + # %% Sanity check: all countries are in the regions + members_tracked = set() + for region, region_props in REGIONS.items(): + members_tracked |= set( + geo.list_members_of_region(region, ds_regions, additional_members=region_props.get("additional_members")) + ) + assert tb_["country"].isin(members_tracked).all(), "Some countries are not in the regions!" + + # %% Dummies + tb_ = make_table_with_dummies(tb_) + + # %% Get aggregates + tb_ = geo.add_regions_to_table( + tb_, + ds_regions, + regions=REGIONS, + # accepted_overlaps=COUNTRIES_OVERLAP, + ) + # tb_ = tb_.loc[tb_["country"].isin(REGIONS.keys())] + + # tb_w = tb_.groupby("year", as_index=False).sum().assign(country="World") + # tb_ = concat([tb_, tb_w], ignore_index=True, short_name="region_counts") + + # %% Set index + tb = tb.format() + + # %% Save + # + # Save outputs. + # + # Create a new garden dataset with the same metadata as the meadow dataset. + ds_garden = create_dataset( + dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata + ) + + # Save changes in the new garden dataset. + ds_garden.save() + + +# %% +def make_table_with_dummies(tb: Table) -> Table: + """Format table to have dummy indicators. + + From a table with categorical indicators, create a new table with dummy indicator for each indicator-category pair. + + Example input: + + | year | country | regime | regime_amb | + |------|---------|-----------|------------| + | 2000 | USA | 1 | 0 | + | 2000 | CAN | 0 | 1 | + | 2000 | DEU | NaN | NaN | + + + Example output: + + | year | country | regime_0 | regime_1 | regime_-1 | regime_amb_0 | regime_amb_0 | regime_amb_-1 | + |------|---------|----------|----------|-----------|--------------|--------------|---------------| + | 2000 | USA | 0 | 1 | 0 | 1 | 0 | 0 | + | 2000 | CAN | 1 | 0 | 0 | 0 | 1 | 0 | + | 2000 | DEU | 0 | 0 | 1 | 0 | 0 | 1 | + + Note that '-1' denotes NA (missing value) category. + + """ + tb_ = tb.copy() + + # Define indicators for which we will create dummies + indicators = [ + { + "name": "regime_row_owid", + "values_expected": set(map(str, range(4))), + "has_na": True, + }, + { + "name": "regime_amb_row_owid", + "values_expected": set(map(str, range(10))), + "has_na": True, + }, + { + "name": "num_years_in_electdem_cat", + "values_expected": { + "closed autocracy", + "electoral autocracy", + "1-18", + "19-30", + "31-60", + "61-90", + "91+", + }, + "has_na": True, + }, + { + "name": "num_years_in_libdem_cat", + "values_expected": { + "closed autocracy", + "electoral autocracy", + "electoral democracy", + "1-18", + "19-30", + "31-60", + "61-90", + "91+", + }, + "has_na": True, + }, + { + "name": "wom_parl_vdem_cat", + "values_expected": { + "0-10% women", + "10-20% women", + "20-30% women", + "30-40% women", + "40-50% women", + "50%+ women", + }, + "has_na": True, + }, + { + "name": "wom_hog_vdem", + "values_expected": {"0", "1"}, + "has_na": True, + }, + { + "name": "wom_hos_vdem", + "values_expected": {"0", "1"}, + "has_na": True, + }, + { + "name": "wom_hoe_vdem", + "values_expected": {"0", "1"}, + "has_na": True, + }, + ] + + # Convert to string + indicator_names = [indicator["name"] for indicator in indicators] + tb_[indicator_names] = tb_[indicator_names].astype("string") + + # Sanity check that the categories for each indicator are as expected + for indicator in indicators: + values_expected = indicator["values_expected"] + # Check and fix NA (convert NAs to -1 category) + if indicator["has_na"]: + # Assert that there are actually NaNs + assert tb_[indicator["name"]].isna().any(), "No NA found!" + # If NA, we should not have category '-1', otherwise these would get merged! + assert "-1" not in set( + tb_[indicator["name"]].unique() + ), f"Error for indicator `{indicator['name']}`. Found -1, which is not allowed when `has_na=True`!" + tb_[indicator["name"]] = tb_[indicator["name"]].fillna("-1") + # Add '-1' as a possible category + values_expected |= {"-1"} + else: + assert not tb_[indicator["name"]].isna().any(), "NA found!" + + values_found = set(tb_[indicator["name"]].unique()) + assert ( + values_found == values_expected + ), f"Error for indicator `{indicator['name']}`. Expected {indicator['values_expected']} but found {values_found}" + + ## Get dummy indicator table + tb_ = cast(Table, pd.get_dummies(tb_, dummy_na=True, columns=indicator_names)) + + ## Add missing metadata to dummy indicators + dummy_cols = [] + for indicator in indicators: + for col in (_dummy_cols := [f"{indicator['name']}_{v}" for v in indicator["values_expected"]]): + tb_[col].metadata = tb[indicator["name"]].metadata + dummy_cols.extend(_dummy_cols) + + ### Select subset of columns + tb_ = tb_.loc[:, ["year", "country"] + dummy_cols] + + return tb_ diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml new file mode 100644 index 00000000000..2c0f3a82b34 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml @@ -0,0 +1,618 @@ +# List specifying how to impute specific country. +# +# As an example: +# +# - country: Panama +# country_impute: Colombia +# year_min: 1832 +# year_max: 1902 +# annotation: Some text that could be surfaced in the metadata +# +# This means that we want to inherit the classifications for Panama from Colombia between 1832 and 1902. +# +# We note that `country` can also be a list of countries. +# +# Transcription from: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do + + +# ALGERIA (1789-1899) +- country: Algeria + annotation: |- + 1789-1899: imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); We favor no imputation. + +# ANGOLA (1789-1899) +- country: Angola + annotation: |- + Colony of Portugal 1886-1975 (CShapes 2.0); colony of imperial power Portugal 16th century-1974 (Wimmer and Min 2006); We favor no imputation. + +# ARMENIA (1789-1989) +- country: Armenia + country_impute: Russia + year_min: 1918 + year_max: 1989 + annotation: |- + Mixed rule 17th century-1917, imperial power Russia 1918-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); We favor no imputation for early years. + +# AUSTRIA (1939-1944) +- country: Austria + annotation: |- + 1938-1944 imperial power Germany (Wimmer and Min 2006), independent 1939-1944 (CShapes 2.0), independent 1918-1938 (Butcher and Griffiths 2020); We favor no imputation. + +# AZERBAIJAN (1789-1989) +- country: Azerbaijan + country_impute: Russia + year_min: 1813 + year_max: 1989 + annotation: |- + Imperial power Russia 1813-1917, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0) not colonized (Ertan et al. 2016). + +# BANGLADESH (1945-1948) +- country: Bangladesh + country_impute: Pakistan + year_min: 1947 + year_max: 1970 + annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" +- country: Bangladesh + country_impute: India + year_min: 1789 + year_max: 1946 + annotation: |- + 1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016) + +# BELARUS (1789-1989) +- country: Belarus + country_impute: Russia + year_min: 1795 + year_max: 1989 + annotation: |- + imperial power Russia 1795-1990 (Wimmer and Min 2006); 1886-1991 part of Russia (Cshapes 2.0), not mentioned in Ertan et al. (2016), independent since 1991 (Butcher and Griffiths 2020). + +# BELGIUM (1789-1829) +- country: Belgium + country_impute: France + year_min: 1796 + year_max: 1813 + annotation: |- + Imperial power Netherlands 1814-1831 (Wimmer and Min 2006), part of Austria - 1794, part of France 1795-1813, part of Netherlands 1814-1831 (Encyclopedia Britannica). +- country: Belgium + country_impute: Austria + year_min: 1789 + year_max: 1790 +- country: Belgium + country_impute: Netherlands + year_min: 1814 + year_max: 1829 + +# BENIN (1789-1899) +- country: Benin + annotation: |- + 1789-1899: Colonized by France 1895-1961 (CShapes 2.0), imperial power 1863-1959 (Wimmer and Min 2006); I favor no imputation. + +# BOLIVIA (1789-1824) +- country: Bolivia + annotation: |- + 1789-1824: Imperial power Spain 16th century - 1823 (Wimmer and Min 2006), independence in 1825 (Butcher and Griffiths 2020); I favor no imputation. + +# BULGARIA (1789-1877) +- country: Bulgaria + country_impute: Turkey + year_min: 1789 + year_max: 1877 + annotation: |- + Imperial power Turkey 15th century-1878, independent in 1886 (CShapes 2.0). + +# BURKINA FASO (1789-1918, 1932-1946) +- country: Burkina Faso + annotation: |- + 1789-1918, 1932-1946: imperial power France 1895-1959 (Wimmer and Min 2006); colony of France 1895-1960 (Cshapes 2.0); colonized by France in 1896 (Ertan et al. 2016); I favor no imputation. + +# BURUNDI (1789-1915) +- country: Burundi + annotation: |- + 1789-1915: imperial power Germany 1890-1922, Belgium 1923-1961 (Wimmer and Min 2006); I favor no imputation. + +# CAMEROON (1789-1960) +- country: Cameroon + annotation: |- + Imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); [I favor no imputation]. + +# CAMBODIA (1789-1899) +- country: Cambodia + annotation: |- + Colonized by France 1886-1953 (CShapes 2.0), imperial power France 1857-1952 (Wimmer and Min 2006), colonized in 1863 (Ertan et al. 2016); I favor no imputation. + +# CANADA (1789-1840) +- country: Canada + annotation: |- + Independent since 1886 (CShapes 2.0), imperial power United Kingdom 1763-1866, colonized by Britain and France in 1700 (Ertan et al. 2016); I favor no imputation. + +# CENTRAL AFRICAN REPUBLIC (1789-1919) +- country: Central African Republic + annotation: |- + 1789-1919: Colonized by France 1900-1961 (CShapes 2.0), imperial power France 1890-1959 (Wimmer and Min 2006), colonized by France in 1887/1903 (Ertan et al. 2016); I favor no imputation. + +# COLOMBIA (1789-1809) +- country: Colombia + annotation: |- + 1789-1809: Imperial power Spain 16th century - 1820 (Wimmer and Min 2006), independence in 1819 (Butcher and Griffiths 2020); I favor no imputation. + +# COTE D'IVOIRE (1789-1899) +- country: Cote d'Ivoire + annotation: |- + 1789-1899: colonized by France 1890-1961 (CShapes 2.0), colonized by France 1887-1959 (Wimmer and Min 2006); I favor no imputation. + +# CROATIA (1945-1990) +- country: Croatia + country_impute: Serbia + year_min: 1945 + year_max: 1990 + annotation: |- + Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; I favor no imputation for earlier era. + +# CHAD (1789-1919) +- country: Chad + annotation: |- + 1789-1919: colonized by France 1900-1960 (CShapes 2.0), imperial power Sudan 1805-1889, France 1890-1959 (Wimmer and Min 2006); I favor no imputation. + +# CZECHIA (1789-1917) +- country: Czechia + country_impute: Austria + year_min: 1789 + year_max: 1917 + annotation: |- + Imperial power Austria-Hungary 16th century-1917 (Wimmer and Min 2006), part of Austria-Hungary since at least 1886 (Cshapes 2.0), Czech part under Austrian control (Encyclopedia Britannica). + +# DEMOCRATIC REPUBLIC OF CONGO (1789-1899) +- country: Democratic Republic of Congo + annotation: |- + 1789-1899: imperial power Belgium 1885-1959 (Wimmer and Min 2006), colonized in 1885 (Ertan et al. 2016); + +# ESTONIA (1789-1917, 1940-1989) +- country: Estonia + country_impute: Russia + year_min: 1789 + year_max: 1917 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006). +- country: Estonia + country_impute: Russia + year_min: 1940 + year_max: 1989 + +# FINLAND (1789-1862) +- country: Finland + country_impute: Sweden + year_min: 1789 + year_max: 1808 + annotation: |- + Part of Russia 1886-1916 (CShapes 2.0), imperial power Russia 1809-1916 (Wimmer and Min 2006), independence in 1917 (Butcher and Griffiths 2020), part of Sweden 14th century-1808. +- country: Finland + country_impute: Russia + year_min: 1809 + year_max: 1862 + +## GEORGIA (1789-1989) +- country: Georgia + country_impute: Russia + year_min: 1801 + year_max: 1989 + annotation: |- + Imperial power Russia 1801-1918, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991, not colonized (Ertan et al. 2016), independent since 1991 (Butcher and Griffiths 2020). + +# GHANA (1789-1901) +- country: Ghana + annotation: |- + Colonized by United Kingdom 1886-1957 (CShapes 2.0), imperial power Portugal 15th century - 1823, United Kingdom 1874-1956 (Wimmer and Min 2006); I favor no imputation. + +# GREECE (1789-1821) +- country: Greece + country_impute: Turkey + year_min: 1789 + year_max: 1821 + annotation: |- + Imperial power Turkey 15th century - 1826, independent 1918-1919 (Wimmer and Min 2006, Cshapes 2.0); independent from 1828 to 1941 (Butcher and Griffiths 2020). + +# GUINEA (1789-1899) +- country: Guinea + annotation: |- + 1789-1899: colonized by France 1893-1958 (CShapes 2.0), imperial power France 1849-1957 (Wimmer and Min 2006); I favor no imputation. + +# ISRAEL (1789-1947) +- country: Israel + country_impute: Turkey + year_min: 1789 + year_max: 1919 + annotation: |- + 1789-1947: Imperial power Turkey 1516-1916, United Kingdom 1917-1947 (Wimmer and Min 2006), part of Turkey 1886-1920, occupied by United Kingdom 1921-1948 (CShapes 2.0); I favor no imputation. + +# IRAQ (1789-1919) +- country: Iraq + country_impute: Turkey + year_min: 1789 + year_max: 1919 + annotation: |- + 1789-1919: part of Turkey 1886-1920, mandate of United Kingdom 1921-1933 (CShapes 2.0); imperial power Turkey 16th century-1913, imperial power United Kingdom 1914-1931 (Wimmer and Min 2006). + +# IRAN (1789-1899) +- country: Iran + annotation: |- + 1789-1899: no imperial onset (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), not colonized (Ertan et al. 2016). We favor no imputation. + +# IRELAND (1789-1918) +- country: Ireland + country_impute: United Kingdom + year_min: 1789 + year_max: 1918 + annotation: |- + Imperial power United Kingdom 11th century-1919 (Wimmer and Min 2006), part of United Kingdom since at least 1886-1922, independent since 1922 (Butcher and Griffiths 2020). + +# ITALY (1789-1860) +- country: Italy + country_impute: Piedmont-Sardinia + year_min: 1815 + year_max: 1860 + annotation: |- + 1814-1860 part of Austria-Hungary (Wimmer and Min 2006) or Piedmont-Sardinia since 1815 (Butcher and Griffiths 2020) + +# KAZAKHSTAN (1789-1989) +- country: Kazakhstan + country_impute: Russia + year_min: 1789 + year_max: 1990 + annotation: |- + 1789-1989: imperial power Russia 1730-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). + +# KENYA (1789-1899) +- country: Kenya + annotation: |- + 1789-1899: protectorate of United Kingdom 1889-1920, colony of United Kingdom 1921-1963 (CShapes 2.0); imperial power United Kingdom 1895-1962 (Wimmer and Min 2006); I favor no imputation. + +# KYRGYZSTAN (1789-1989) +- country: Kyrgyzstan + country_impute: Russia + year_min: 1876 + year_max: 1989 + annotation: |- + Imperial power Russia 1876-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0), not colonized (Ertan et al. 2016), incorporated into Russia in mid-19th century (Encyclopedia Britannica). + +# LAOS (1789-1899) +- country: Laos + country_impute: Thailand + year_min: 1789 + year_max: 1892 + annotation: |- + Part of Thailand 1886-1893, colonized by France 1894-1954 (CShapes 2.0), imperial power Thailand 1778-1889, France 1890-1952 (Wimmer and Min 2006). + +# LATVIA (1789-1919, 1940-1989) +- country: Latvia + country_impute: Russia + year_min: 1789 + year_max: 1919 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006); I include 1919. +- country: Latvia + country_impute: Russia + year_min: 1940 + year_max: 1989 + +# LIBYA (1789-1899) +- country: Libya + annotation: |- + 1789-1899: Imperial power Turkey 1551-1911, Italy 1912-1942 (Wimmer and Min 2006), colonized by Italy in 1911 (Ertan et al. 2016); I favor no im + +# LITHUANIA (1789-1917) +- country: Lithuania + country_impute: Russia + year_min: 1795 + year_max: 1917 + annotation: |- + Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1795-1918 (Wimmer and Min 2006). +- country: Lithuania + country_impute: Russia + year_min: 1940 + year_max: 1989 + annotation: |- + Imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia 1940-1991 (CShapes 2.0), independent 1918-1940, 1991- (Butcher and Griffiths 2020). + +# MADAGASCAR (1789-1816) +- country: Madagascar + annotation: |- + Independent 1886-1896 (CShapes 2.0), imperial power France 1894-1959 (Wimmer and Min 2006), independent 1816-1895 (Butcher and Griffiths 2020), no indication of being part of another country 1789-1816 (Encyclopedia Britannica); I favor no imputation. + +# MALAWI (1789-1899) +- country: Malawi + annotation: |- + 1789-1899: colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1889-1963 (Wimmer and Min 2006); I favor no imputation. + +# MALAYSIA (1789-1899) +- country: Malaysia + annotation: |- + 1789-1899: colonized by United Kingdom 1886-1957, imperial power United Kingdom 1795-1956 (Wimmer and Min 2006); I favor no imputation. + +# MALI (1789-1899) +- country: Mali + annotation: |- + Colonized by France since 1896 (CShapes 2.0), imperial power France since 1895 (Wimmer and Min 2006); I favor no imputation. + +# MOLDOVA (1789-1989) +- country: Moldova + country_impute: Russia + year_min: 1789 + year_max: 1919 + annotation: |- + Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). +- country: Moldova + country_impute: Russia + year_min: 1940 + year_max: 1989 + annotation: |- + Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). + +# MOZAMBIQUE (1789-1899, 1974-1993) +- country: Mozambique + annotation: |- + 1789-1899, 1974-1993: imperial power Portugal 1885-1974 (Wimmer and Min 2006); colony of Portugal 1886-1975 (Cshapes 2.0), colonized by Portugal, approximated as 1750 (Ertan et al. 2016); We favor no imputation. + +# NETHERLANDS (1811-1812) +- country: Netherlands + country_impute: France + year_min: 1811 + year_max: 1812 + +# NIGER (1789-1921) +- country: Niger + annotation: |- + Colony of France 1896-1960 (CShapes 2.0), imperial power France 1904-1959 (Wimmer and Min 2006); I favor no imputation. + +# NIGERIA (1789-1913) +- country: Nigeria + annotation: |- + 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); We favor no imputation. + +# NORTH KOREA (1789-1944) +- country: North Korea + country_impute: South Korea + year_min: 1789 + year_max: 1910 + annotation: |- + Korea since the 14th century until 1909, imperial power Japan 1910-1944 (Wimmer and Min 2006), independent Korea since at least 1886-1910, colony of Japan -1945 (Cshapes 2.0), not listed (Ertan et al. 2016) + +# NORTH MACEDONIA (1789-1990) +- country: North Macedonia + country_impute: Turkey + year_min: 1789 + year_max: 1913 +- country: North Macedonia + country_impute: Serbia + year_min: 1914 + year_max: 1990 + +# PALESTINE (1949-2019) +- country: Palestine + annotation: |- + No information no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; We therefore favor no imputation. + +# PAKISTAN (1789-1946) +- country: Pakistan + country_impute: India + year_min: 1947 + year_max: 1970 + annotation: |- + 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) + +# PAPUA NEW GUINEA (1789-1899) +- country: Papua New Guinea + annotation: |- + 1789-1899: Colonized by United Kingdom 1886-1920 and Germany 1886-1914, Australia 1915-1975 (CShapes 2.0), imperial power United Kingdom 1883-1904, Australia 1905-1974 (Wimmer and Min 2006), colonized by United Kingdom and Germany in 1884 (Ertan et al. 2016); I favor no imputation. + +# PERU (1789-1820) +- country: Peru + annotation: |- + 1789-1820: Imperial power Spain 16th century - 1824 (Wimmer and Min 2006), independence in 1821 (Butcher and Griffiths 2020); I favor no imputation. + +# PHILIPPINES (1789-1899) +- country: Philippines + annotation: |- + Imperial power Spain 16th century-1898, United States 1899-1945 (Wimmer and Min 2006), colony of Spain since at least 1886-1898, colony of United States 1899-1946 (Cshapes 2.0); We favor no imputation. + +# POLAND +- country: Poland + annotation: |- + Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); We favor no imputation. + +# PUERTO RICO (1940, 1950-2021) +- country: Puerto Rico + annotation: |- + 1940, 1950-2021: colony of Spain since at least 1886-1898, colony of United States 1899- (CShapes 2.0), colony of Spain since 16th century (Encyclopedia Britannica); We favor no imputation. + +# ROMANIA (1789-1830, 1854-1856, 1859-1899) +- country: Romania + annotation: |- + 1688-1858 imperial power Austria-Hungary (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), independent since 1878 (Butcher and Griffiths 2020), Transylvania part of Austria-Hungary, other parts under Ottoman influence; We favor no imputation. + +# RWANDA (1789-1915) +- country: Rwanda + annotation: |- + Colonized by Germany 1891-1916 (CShapes 2.0), imperial power Germany 1890-1915 (Wimmer and Min 2006); I favor no imputation. + +# SAUDI ARABIA (1819-1821) +- country: Saudi Arabia + country_impute: Turkey + year_min: 1819 + year_max: 1821 + annotation: |- + Part of Turkey 1886-1919, nothing 1920-1932 (CShapes 2.0), not included (Wimmer and Min 2006), not colonized (Ertan et al. 2016), independent 1816-1818 (Butcher and Griffiths 2020), part of Ottoman Empire (Encyclopedia Britannica). + +# SENEGAL (1789-1903) +- country: Senegal + annotation: |- + 1789-1903: colonized by France 1886-1961 (CShapes 2.0), imperial power France 1854-1959 (Wimmer and Min 2006); I favor no imputation. + +# SERBIA (1789-1833, 1932-1934) +- country: Serbia + country_impute: Turkey + year_min: 1789 + year_max: 1833 + annotation: |- + Im perial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); We favor no imputation for later period. + +# SIERRA LEONE (1789-1899) +- country: Sierra Leone + annotation: |- + 1789-1899: Imperial power United Kingdom 1808-1960 (Wimmer and Min 2006), colonized by United Kingdom in 1808/1896 (Ertan et al. 2016); I favor no imputation. + +# SLOVAKIA (1789-1992) +- country: Slovakia + country_impute: Hungary + year_min: 1789 + year_max: 1918 + annotation: |- + Imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). +- country: Slovakia + country_impute: Czechia + year_min: 1919 + year_max: 1992 + +# SLOVENIA (1789-1988) +- country: Slovenia + country_impute: Serbia + year_min: 1919 + year_max: 1988 + annotation: |- + Part of Austria-Hungary 1886-1918, of Austria 1919, of Yugoslavia 1920-1992 (CShapes 2.0), imperial power Austria-Hungary 1804-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006), appears more closely affiliated with Austria, as Hungary barely referenced (Encyclopedia Britannica). +- country: Slovenia + country_impute: Austria + year_min: 1804 + year_max: 1918 + +# SOMALIA (1789-1899) +- country: Somalia + annotation: |- + 1789-1899: colonized by United Kingdom 1886-1961, Italy 1890-1941 (CShapes 2.0), imperial power Turkey 1870-1883, United Kingdom 1884-1888, mixed rule 1889-1941 (Wimmer and Min 2006), occupied by Egypt 1870-1885 (Encyclopedia Britannica); I favor no imputation. + +# SOUTH AFRICA (1789-1899) +- country: South Africa + annotation: |- + Imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); We favor no imputation. + +# SOUTH SUDAN (1789-2010) +- country: South Sudan + country_impute: Egypt + year_min: 1821 + year_max: 1884 + annotation: |- + not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). +- country: South Sudan + country_impute: Sudan + year_min: 1900 + year_max: 2010 + anotation: |- + not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). + +# SRI LANKA (1789-1899) +- country: Sri Lanka + annotation: |- + 1789-1899: colonized by United Kingdom as Ceylon (Cshapes 2.0); I favor no imputation. + +# SUDAN (1789-1899) +- country: Sudan + country_impute: Egypt + year_min: 1821 + year_max: 1884 + annotation: |- + Egypt imperial power 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955 (CShapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020); in 1886, colony Egypt of United Kingdom covers little of today's Sudan (CShapes 2.0); Egypt invades Sudanese territory in 1820, indigenous forces surrender in 1821, Mahdists capture Khartoum from Egypt and the British in 1885 (Encyclopedia Britannica). + +# SYRIA (1789-1917, 1920-1921) +- country: Syria + country_impute: Turkey + year_min: 1789 + year_max: 1830 + annotation: |- + Part of Turkey 1886-1920 (CShapes 2.0), imperial power Turkey 1840-1919, France 1920-1943 (Wimmer and Min 2006), colonized by France in 1920 (Ertan et al. 2016), part of of Ottoman Empire 16th century-1830, of Egypt 1831-1839 (Encyclopedia Britannica). +- country: Syria + country_impute: Egypt + year_min: 1831 + year_max: 1839 +- country: Syria + country_impute: Turkey + year_min: 1840 + year_max: 1917 + +# TAIWAN (1789-1899) +- country: Taiwan + country_impute: China + year_min: 1789 + year_max: 1894 + annotation: |- + Part of China 1886-1895, colony of Japan afterwards (CShapes 2.0), imperial power China 17th century - 1947 (Wimmer and Min 2006), colonized by Japan 1895-1945 (Ertan et al. 2016). + +# TAJIKISTAN (1789-1989) +- country: Tajikistan + country_impute: Russia + year_min: 1868 + year_max: 1989 + annotation: |- + Imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). + +# TANZANIA (1789-1914) +- country: Tanzania + annotation: |- + Imperial power/colonized by Germany and United Kingdom (Wimmer and Min 2006, Cshapes 2.0); We favor no imputation. + +# TURKMENISTAN (1789-1989) +- country: Turkmenistan + country_impute: Russia + year_min: 1896 + year_max: 1989 + annotation: |- + Imperial power Russia 1897-1990 (Wimmer and Min 2006), (mostly) part of Russia since 1886-1991, part protectorate Khiva 1886-1920 (Cshapes 2.0), not colonized (Ertan et al. 2016), resistance against Russia broken in 1881 (Encyclopedia Britannica). + +# UGANDA (1789-1899) +- country: Uganda + annotation: |- + 1789-1899: part of Kenya, protectorate of United Kingdom 1892-1894 (CShapes 2.0); own protectorate of United Kingdom 1895-1962; imperial power United Kingdom 1890-1961 (Wimmer and Min 2006); I favor no imputation. + +# UKRAINE (1789-1989) +- country: Ukraine + country_impute: Russia + year_min: 1946 + year_max: 1989 + annotation: |- + 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). + +# UZBEKISTAN (1789-1911, 1921-1989) +- country: Uzbekistan + country_impute: Russia + year_min: 1865 + year_max: 1911 + annotation: |- + 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. +- country: Uzbekistan + country_impute: Russia + year_min: 1921 + year_max: 1989 + annotation: |- + 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. + +# VIETNAM (1789-1944) +- country: Vietnam + annotation: |- + 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); We favor no imputation. + +# YEMEN (1851-1917) +- country: Yemen + country_impute: Turkey + year_min: 1851 + year_max: 1917 + annotation: |- + Mixed rule by Turkey and United Kingdom 1849-1918, part of Turkey 1886-1918 (CShapes 2.0), United Kingdom not on CShapes map. + +# ZAMBIA (1789-1910) +- country: Zambia + annotation: |- + Colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1890-1963 (Wimmer and Min 2006); I favor no imputation. + +# ZIMBABWE (1789-1899) +- country: Zimbabwe + annotation: |- + 1789-1899: Colonized by United Kingdom 1889-1965 (CShapes 2.0), imperial power United Kingdom 1890-1964 (Wimmer and Min 2006); I favor no imputation. diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json new file mode 100644 index 00000000000..9f943c95a1f --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json @@ -0,0 +1,3069 @@ +[ + { + 1789: {'Yemen', + "Yemen People's Republic" + }, + 1790: {'Yemen', + "Yemen People's Republic" + }, + 1791: {'Yemen', + "Yemen People's Republic" + }, + 1792: {'Yemen', + "Yemen People's Republic" + }, + 1793: {'Yemen', + "Yemen People's Republic" + }, + 1794: {'Yemen', + "Yemen People's Republic" + }, + 1795: {'Yemen', + "Yemen People's Republic" + }, + 1796: {'Yemen', + "Yemen People's Republic" + }, + 1797: {'Yemen', + "Yemen People's Republic" + }, + 1798: {'Yemen', + "Yemen People's Republic" + }, + 1799: {'Yemen', + "Yemen People's Republic" + }, + 1800: {'Yemen', + "Yemen People's Republic" + }, + 1801: {'Yemen', + "Yemen People's Republic" + }, + 1802: {'Yemen', + "Yemen People's Republic" + }, + 1803: {'Yemen', + "Yemen People's Republic" + }, + 1804: {'Yemen', + "Yemen People's Republic" + }, + 1805: {'Yemen', + "Yemen People's Republic" + }, + 1806: {'Yemen', + "Yemen People's Republic" + }, + 1807: {'Yemen', + "Yemen People's Republic" + }, + 1808: {'Yemen', + "Yemen People's Republic" + }, + 1809: {'Yemen', + "Yemen People's Republic" + }, + 1810: {'Yemen', + "Yemen People's Republic" + }, + 1811: {'Yemen', + "Yemen People's Republic" + }, + 1812: {'Yemen', + "Yemen People's Republic" + }, + 1813: {'Yemen', + "Yemen People's Republic" + }, + 1814: {'Yemen', + "Yemen People's Republic" + }, + 1815: {'Yemen', + "Yemen People's Republic" + }, + 1816: {'Yemen', + "Yemen People's Republic" + }, + 1817: {'Yemen', + "Yemen People's Republic" + }, + 1818: {'Yemen', + "Yemen People's Republic" + }, + 1819: {'Yemen', + "Yemen People's Republic" + }, + 1820: {'Yemen', + "Yemen People's Republic" + }, + 1821: {'Yemen', + "Yemen People's Republic" + }, + 1822: {'Yemen', + "Yemen People's Republic" + }, + 1823: {'Yemen', + "Yemen People's Republic" + }, + 1824: {'Yemen', + "Yemen People's Republic" + }, + 1825: {'Yemen', + "Yemen People's Republic" + }, + 1826: {'Yemen', + "Yemen People's Republic" + }, + 1827: {'Yemen', + "Yemen People's Republic" + }, + 1828: {'Yemen', + "Yemen People's Republic" + }, + 1829: {'Yemen', + "Yemen People's Republic" + }, + 1830: {'Yemen', + "Yemen People's Republic" + }, + 1831: {'Yemen', + "Yemen People's Republic" + }, + 1832: {'Yemen', + "Yemen People's Republic" + }, + 1833: {'Yemen', + "Yemen People's Republic" + }, + 1834: {'Yemen', + "Yemen People's Republic" + }, + 1835: {'Yemen', + "Yemen People's Republic" + }, + 1836: {'Yemen', + "Yemen People's Republic" + }, + 1837: {'Yemen', + "Yemen People's Republic" + }, + 1838: {'Yemen', + "Yemen People's Republic" + }, + 1839: {'Yemen', + "Yemen People's Republic" + }, + 1840: {'Yemen', + "Yemen People's Republic" + }, + 1841: {'Yemen', + "Yemen People's Republic" + }, + 1842: {'Yemen', + "Yemen People's Republic" + }, + 1843: {'Yemen', + "Yemen People's Republic" + }, + 1844: {'Yemen', + "Yemen People's Republic" + }, + 1845: {'Yemen', + "Yemen People's Republic" + }, + 1846: {'Yemen', + "Yemen People's Republic" + }, + 1847: {'Yemen', + "Yemen People's Republic" + }, + 1848: {'Yemen', + "Yemen People's Republic" + }, + 1849: {'Yemen', + "Yemen People's Republic" + }, + 1850: {'Yemen', + "Yemen People's Republic" + }, + 1851: {'Yemen', + "Yemen People's Republic" + }, + 1852: {'Yemen', + "Yemen People's Republic" + }, + 1853: {'Yemen', + "Yemen People's Republic" + }, + 1854: {'Yemen', + "Yemen People's Republic" + }, + 1855: {'Yemen', + "Yemen People's Republic" + }, + 1856: {'Yemen', + "Yemen People's Republic" + }, + 1857: {'Yemen', + "Yemen People's Republic" + }, + 1858: {'Yemen', + "Yemen People's Republic" + }, + 1859: {'Yemen', + "Yemen People's Republic" + }, + 1860: {'Yemen', + "Yemen People's Republic" + }, + 1861: {'Yemen', + "Yemen People's Republic" + }, + 1862: {'Yemen', + "Yemen People's Republic" + }, + 1863: {'Yemen', + "Yemen People's Republic" + }, + 1864: {'Yemen', + "Yemen People's Republic" + }, + 1865: {'Yemen', + "Yemen People's Republic" + }, + 1866: {'Yemen', + "Yemen People's Republic" + }, + 1867: {'Yemen', + "Yemen People's Republic" + }, + 1868: {'Yemen', + "Yemen People's Republic" + }, + 1869: {'Yemen', + "Yemen People's Republic" + }, + 1870: {'Yemen', + "Yemen People's Republic" + }, + 1871: {'Yemen', + "Yemen People's Republic" + }, + 1872: {'Yemen', + "Yemen People's Republic" + }, + 1873: {'Yemen', + "Yemen People's Republic" + }, + 1874: {'Yemen', + "Yemen People's Republic" + }, + 1875: {'Yemen', + "Yemen People's Republic" + }, + 1876: {'Yemen', + "Yemen People's Republic" + }, + 1877: {'Yemen', + "Yemen People's Republic" + }, + 1878: {'Yemen', + "Yemen People's Republic" + }, + 1879: {'Yemen', + "Yemen People's Republic" + }, + 1880: {'Yemen', + "Yemen People's Republic" + }, + 1881: {'Yemen', + "Yemen People's Republic" + }, + 1882: {'Yemen', + "Yemen People's Republic" + }, + 1883: {'Yemen', + "Yemen People's Republic" + }, + 1884: {'Yemen', + "Yemen People's Republic" + }, + 1885: {'Yemen', + "Yemen People's Republic" + }, + 1886: {'Yemen', + "Yemen People's Republic" + }, + 1887: {'Yemen', + "Yemen People's Republic" + }, + 1888: {'Yemen', + "Yemen People's Republic" + }, + 1889: {'Yemen', + "Yemen People's Republic" + }, + 1890: {'Yemen', + "Yemen People's Republic" + }, + 1891: {'Yemen', + "Yemen People's Republic" + }, + 1892: {'Yemen', + "Yemen People's Republic" + }, + 1893: {'Yemen', + "Yemen People's Republic" + }, + 1894: {'Yemen', + "Yemen People's Republic" + }, + 1895: {'Yemen', + "Yemen People's Republic" + }, + 1896: {'Yemen', + "Yemen People's Republic" + }, + 1897: {'Yemen', + "Yemen People's Republic" + }, + 1898: {'Yemen', + "Yemen People's Republic" + }, + 1899: {'Yemen', + "Yemen People's Republic" + }, + 1900: {'Yemen', + "Yemen People's Republic" + }, + 1901: {'Yemen', + "Yemen People's Republic" + }, + 1902: {'Yemen', + "Yemen People's Republic" + }, + 1903: {'Yemen', + "Yemen People's Republic" + }, + 1904: {'Yemen', + "Yemen People's Republic" + }, + 1905: {'Yemen', + "Yemen People's Republic" + }, + 1906: {'Yemen', + "Yemen People's Republic" + }, + 1907: {'Yemen', + "Yemen People's Republic" + }, + 1908: {'Yemen', + "Yemen People's Republic" + }, + 1909: {'Yemen', + "Yemen People's Republic" + }, + 1910: {'Yemen', + "Yemen People's Republic" + }, + 1911: {'Yemen', + "Yemen People's Republic" + }, + 1912: {'Yemen', + "Yemen People's Republic" + }, + 1913: {'Yemen', + "Yemen People's Republic" + }, + 1914: {'Yemen', + "Yemen People's Republic" + }, + 1915: {'Yemen', + "Yemen People's Republic" + }, + 1916: {'Yemen', + "Yemen People's Republic" + }, + 1917: {'Yemen', + "Yemen People's Republic" + }, + 1918: {'Yemen', + "Yemen People's Republic" + }, + 1919: {'Yemen', + "Yemen People's Republic" + }, + 1920: {'Yemen', + "Yemen People's Republic" + }, + 1921: {'Yemen', + "Yemen People's Republic" + }, + 1922: {'Yemen', + "Yemen People's Republic" + }, + 1923: {'Yemen', + "Yemen People's Republic" + }, + 1924: {'Yemen', + "Yemen People's Republic" + }, + 1925: {'Yemen', + "Yemen People's Republic" + }, + 1926: {'Yemen', + "Yemen People's Republic" + }, + 1927: {'Yemen', + "Yemen People's Republic" + }, + 1928: {'Yemen', + "Yemen People's Republic" + }, + 1929: {'Yemen', + "Yemen People's Republic" + }, + 1930: {'Yemen', + "Yemen People's Republic" + }, + 1931: {'Yemen', + "Yemen People's Republic" + }, + 1932: {'Yemen', + "Yemen People's Republic" + }, + 1933: {'Yemen', + "Yemen People's Republic" + }, + 1934: {'Yemen', + "Yemen People's Republic" + }, + 1935: {'Yemen', + "Yemen People's Republic" + }, + 1936: {'Yemen', + "Yemen People's Republic" + }, + 1937: {'Yemen', + "Yemen People's Republic" + }, + 1938: {'Yemen', + "Yemen People's Republic" + }, + 1939: {'Yemen', + "Yemen People's Republic" + }, + 1940: {'Yemen', + "Yemen People's Republic" + }, + 1941: {'Yemen', + "Yemen People's Republic" + }, + 1942: {'Yemen', + "Yemen People's Republic" + }, + 1943: {'Yemen', + "Yemen People's Republic" + }, + 1944: {'Yemen', + "Yemen People's Republic" + }, + 1945: {'Yemen', + "Yemen People's Republic" + }, + 1946: {'Yemen', + "Yemen People's Republic" + }, + 1947: {'Yemen', + "Yemen People's Republic" + }, + 1948: {'Yemen', + "Yemen People's Republic" + }, + 1949: {'Yemen', + "Yemen People's Republic" + }, + 1950: {'Yemen', + "Yemen People's Republic" + }, + 1951: {'Yemen', + "Yemen People's Republic" + }, + 1952: {'Yemen', + "Yemen People's Republic" + }, + 1953: {'Yemen', + "Yemen People's Republic" + }, + 1954: {'Yemen', + "Yemen People's Republic" + }, + 1955: {'Yemen', + "Yemen People's Republic" + }, + 1956: {'Yemen', + "Yemen People's Republic" + }, + 1957: {'Yemen', + "Yemen People's Republic" + }, + 1958: {'Yemen', + "Yemen People's Republic" + }, + 1959: {'Yemen', + "Yemen People's Republic" + }, + 1960: {'Yemen', + "Yemen People's Republic" + }, + 1961: {'Yemen', + "Yemen People's Republic" + }, + 1962: {'Yemen', + "Yemen People's Republic" + }, + 1963: {'Yemen', + "Yemen People's Republic" + }, + 1964: {'Yemen', + "Yemen People's Republic" + }, + 1965: {'Yemen', + "Yemen People's Republic" + }, + 1966: {'Yemen', + "Yemen People's Republic" + }, + 1967: {'Yemen', + "Yemen People's Republic" + }, + 1968: {'Yemen', + "Yemen People's Republic" + }, + 1969: {'Yemen', + "Yemen People's Republic" + }, + 1970: {'Yemen', + "Yemen People's Republic" + }, + 1971: {'Yemen', + "Yemen People's Republic" + }, + 1972: {'Yemen', + "Yemen People's Republic" + }, + 1973: {'Yemen', + "Yemen People's Republic" + }, + 1974: {'Yemen', + "Yemen People's Republic" + }, + 1975: {'Yemen', + "Yemen People's Republic" + }, + 1976: {'Yemen', + "Yemen People's Republic" + }, + 1977: {'Yemen', + "Yemen People's Republic" + }, + 1978: {'Yemen', + "Yemen People's Republic" + }, + 1979: {'Yemen', + "Yemen People's Republic" + }, + 1980: {'Yemen', + "Yemen People's Republic" + }, + 1981: {'Yemen', + "Yemen People's Republic" + }, + 1982: {'Yemen', + "Yemen People's Republic" + }, + 1983: {'Yemen', + "Yemen People's Republic" + }, + 1984: {'Yemen', + "Yemen People's Republic" + }, + 1985: {'Yemen', + "Yemen People's Republic" + }, + 1986: {'Yemen', + "Yemen People's Republic" + }, + 1987: {'Yemen', + "Yemen People's Republic" + }, + 1988: {'Yemen', + "Yemen People's Republic" + }, + 1989: {'Yemen', + "Yemen People's Republic" + }, + 1990: {'Yemen', + "Yemen People's Republic" + }, + 1991: {'Yemen', + "Yemen People's Republic" + }, + 1992: {'Yemen', + "Yemen People's Republic" + }, + 1993: {'Yemen', + "Yemen People's Republic" + }, + 1994: {'Yemen', + "Yemen People's Republic" + }, + 1995: {'Yemen', + "Yemen People's Republic" + }, + 1996: {'Yemen', + "Yemen People's Republic" + }, + 1997: {'Yemen', + "Yemen People's Republic" + }, + 1998: {'Yemen', + "Yemen People's Republic" + }, + 1999: {'Yemen', + "Yemen People's Republic" + }, + 2000: {'Yemen', + "Yemen People's Republic" + }, + 2001: {'Yemen', + "Yemen People's Republic" + }, + 2002: {'Yemen', + "Yemen People's Republic" + }, + 2003: {'Yemen', + "Yemen People's Republic" + }, + 2004: {'Yemen', + "Yemen People's Republic" + }, + 2005: {'Yemen', + "Yemen People's Republic" + }, + 2006: {'Yemen', + "Yemen People's Republic" + }, + 2007: {'Yemen', + "Yemen People's Republic" + }, + 2008: {'Yemen', + "Yemen People's Republic" + }, + 2009: {'Yemen', + "Yemen People's Republic" + }, + 2010: {'Yemen', + "Yemen People's Republic" + }, + 2011: {'Yemen', + "Yemen People's Republic" + }, + 2012: {'Yemen', + "Yemen People's Republic" + }, + 2013: {'Yemen', + "Yemen People's Republic" + }, + 2014: {'Yemen', + "Yemen People's Republic" + }, + 2015: {'Yemen', + "Yemen People's Republic" + }, + 2016: {'Yemen', + "Yemen People's Republic" + }, + 2017: {'Yemen', + "Yemen People's Republic" + }, + 2018: {'Yemen', + "Yemen People's Republic" + }, + 2019: {'Yemen', + "Yemen People's Republic" + }, + 2020: {'Yemen', + "Yemen People's Republic" + }, + 2021: {'Yemen', + "Yemen People's Republic" + }, + 2022: {'Yemen', + "Yemen People's Republic" + }, + 2023: {'Yemen', + "Yemen People's Republic" + } + }, + { + 1789: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1790: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1791: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1792: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1793: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1794: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1795: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1796: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1797: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1798: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1799: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1800: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1801: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1802: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1803: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1804: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1805: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1806: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1807: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1808: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1809: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1810: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1811: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1812: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1813: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1814: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1815: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1816: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1817: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1818: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1819: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1820: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1821: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1822: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1823: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1824: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1825: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1826: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1827: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1828: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1829: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1830: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1831: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1832: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1833: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1834: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1835: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1836: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1837: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1838: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1839: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1840: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1841: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1842: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1843: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1844: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1845: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1846: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1847: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1848: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1849: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1850: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1851: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1852: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1853: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1854: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1855: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1856: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1857: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1858: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1859: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1860: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1861: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1862: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1863: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1864: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1865: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1866: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1867: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1868: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1869: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1870: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1871: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1872: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1873: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1874: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1875: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1876: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1877: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1878: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1879: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1880: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1881: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1882: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1883: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1884: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1885: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1886: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1887: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1888: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1889: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1890: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1891: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1892: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1893: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1894: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1895: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1896: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1897: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1898: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1899: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1900: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1901: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1902: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1903: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1904: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1905: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1906: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1907: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1908: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1909: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1910: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1911: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1912: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1913: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1914: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1915: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1916: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1917: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1918: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1919: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1920: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1921: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1922: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1923: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1924: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1925: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1926: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1927: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1928: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1929: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1930: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1931: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1932: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1933: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1934: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1935: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1936: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1937: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1938: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1939: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1940: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1941: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1942: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1943: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1944: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1945: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1946: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1947: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1948: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1949: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1950: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1951: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1952: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1953: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1954: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1955: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1956: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1957: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1958: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1959: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1960: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1961: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1962: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1963: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1964: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1965: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1966: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1967: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1968: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1969: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1970: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1971: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1972: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1973: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1974: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1975: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1976: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1977: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1978: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1979: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1980: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1981: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1982: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1983: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1984: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1985: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1986: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1987: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1988: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1989: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1990: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1991: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1992: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1993: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1994: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1995: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1996: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1997: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1998: {'Duchy of Parma and Piacenza', 'Italy' + }, + 1999: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2000: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2001: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2002: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2003: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2004: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2005: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2006: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2007: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2008: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2009: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2010: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2011: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2012: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2013: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2014: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2015: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2016: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2017: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2018: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2019: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2020: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2021: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2022: {'Duchy of Parma and Piacenza', 'Italy' + }, + 2023: {'Duchy of Parma and Piacenza', 'Italy' + } + }, + { + 1789: {'East Germany', 'Germany' + }, + 1790: {'East Germany', 'Germany' + }, + 1791: {'East Germany', 'Germany' + }, + 1792: {'East Germany', 'Germany' + }, + 1793: {'East Germany', 'Germany' + }, + 1794: {'East Germany', 'Germany' + }, + 1795: {'East Germany', 'Germany' + }, + 1796: {'East Germany', 'Germany' + }, + 1797: {'East Germany', 'Germany' + }, + 1798: {'East Germany', 'Germany' + }, + 1799: {'East Germany', 'Germany' + }, + 1800: {'East Germany', 'Germany' + }, + 1801: {'East Germany', 'Germany' + }, + 1802: {'East Germany', 'Germany' + }, + 1803: {'East Germany', 'Germany' + }, + 1804: {'East Germany', 'Germany' + }, + 1805: {'East Germany', 'Germany' + }, + 1806: {'East Germany', 'Germany' + }, + 1807: {'East Germany', 'Germany' + }, + 1808: {'East Germany', 'Germany' + }, + 1809: {'East Germany', 'Germany' + }, + 1810: {'East Germany', 'Germany' + }, + 1811: {'East Germany', 'Germany' + }, + 1812: {'East Germany', 'Germany' + }, + 1813: {'East Germany', 'Germany' + }, + 1814: {'East Germany', 'Germany' + }, + 1815: {'East Germany', 'Germany' + }, + 1816: {'East Germany', 'Germany' + }, + 1817: {'East Germany', 'Germany' + }, + 1818: {'East Germany', 'Germany' + }, + 1819: {'East Germany', 'Germany' + }, + 1820: {'East Germany', 'Germany' + }, + 1821: {'East Germany', 'Germany' + }, + 1822: {'East Germany', 'Germany' + }, + 1823: {'East Germany', 'Germany' + }, + 1824: {'East Germany', 'Germany' + }, + 1825: {'East Germany', 'Germany' + }, + 1826: {'East Germany', 'Germany' + }, + 1827: {'East Germany', 'Germany' + }, + 1828: {'East Germany', 'Germany' + }, + 1829: {'East Germany', 'Germany' + }, + 1830: {'East Germany', 'Germany' + }, + 1831: {'East Germany', 'Germany' + }, + 1832: {'East Germany', 'Germany' + }, + 1833: {'East Germany', 'Germany' + }, + 1834: {'East Germany', 'Germany' + }, + 1835: {'East Germany', 'Germany' + }, + 1836: {'East Germany', 'Germany' + }, + 1837: {'East Germany', 'Germany' + }, + 1838: {'East Germany', 'Germany' + }, + 1839: {'East Germany', 'Germany' + }, + 1840: {'East Germany', 'Germany' + }, + 1841: {'East Germany', 'Germany' + }, + 1842: {'East Germany', 'Germany' + }, + 1843: {'East Germany', 'Germany' + }, + 1844: {'East Germany', 'Germany' + }, + 1845: {'East Germany', 'Germany' + }, + 1846: {'East Germany', 'Germany' + }, + 1847: {'East Germany', 'Germany' + }, + 1848: {'East Germany', 'Germany' + }, + 1849: {'East Germany', 'Germany' + }, + 1850: {'East Germany', 'Germany' + }, + 1851: {'East Germany', 'Germany' + }, + 1852: {'East Germany', 'Germany' + }, + 1853: {'East Germany', 'Germany' + }, + 1854: {'East Germany', 'Germany' + }, + 1855: {'East Germany', 'Germany' + }, + 1856: {'East Germany', 'Germany' + }, + 1857: {'East Germany', 'Germany' + }, + 1858: {'East Germany', 'Germany' + }, + 1859: {'East Germany', 'Germany' + }, + 1860: {'East Germany', 'Germany' + }, + 1861: {'East Germany', 'Germany' + }, + 1862: {'East Germany', 'Germany' + }, + 1863: {'East Germany', 'Germany' + }, + 1864: {'East Germany', 'Germany' + }, + 1865: {'East Germany', 'Germany' + }, + 1866: {'East Germany', 'Germany' + }, + 1867: {'East Germany', 'Germany' + }, + 1868: {'East Germany', 'Germany' + }, + 1869: {'East Germany', 'Germany' + }, + 1870: {'East Germany', 'Germany' + }, + 1871: {'East Germany', 'Germany' + }, + 1872: {'East Germany', 'Germany' + }, + 1873: {'East Germany', 'Germany' + }, + 1874: {'East Germany', 'Germany' + }, + 1875: {'East Germany', 'Germany' + }, + 1876: {'East Germany', 'Germany' + }, + 1877: {'East Germany', 'Germany' + }, + 1878: {'East Germany', 'Germany' + }, + 1879: {'East Germany', 'Germany' + }, + 1880: {'East Germany', 'Germany' + }, + 1881: {'East Germany', 'Germany' + }, + 1882: {'East Germany', 'Germany' + }, + 1883: {'East Germany', 'Germany' + }, + 1884: {'East Germany', 'Germany' + }, + 1885: {'East Germany', 'Germany' + }, + 1886: {'East Germany', 'Germany' + }, + 1887: {'East Germany', 'Germany' + }, + 1888: {'East Germany', 'Germany' + }, + 1889: {'East Germany', 'Germany' + }, + 1890: {'East Germany', 'Germany' + }, + 1891: {'East Germany', 'Germany' + }, + 1892: {'East Germany', 'Germany' + }, + 1893: {'East Germany', 'Germany' + }, + 1894: {'East Germany', 'Germany' + }, + 1895: {'East Germany', 'Germany' + }, + 1896: {'East Germany', 'Germany' + }, + 1897: {'East Germany', 'Germany' + }, + 1898: {'East Germany', 'Germany' + }, + 1899: {'East Germany', 'Germany' + }, + 1900: {'East Germany', 'Germany' + }, + 1901: {'East Germany', 'Germany' + }, + 1902: {'East Germany', 'Germany' + }, + 1903: {'East Germany', 'Germany' + }, + 1904: {'East Germany', 'Germany' + }, + 1905: {'East Germany', 'Germany' + }, + 1906: {'East Germany', 'Germany' + }, + 1907: {'East Germany', 'Germany' + }, + 1908: {'East Germany', 'Germany' + }, + 1909: {'East Germany', 'Germany' + }, + 1910: {'East Germany', 'Germany' + }, + 1911: {'East Germany', 'Germany' + }, + 1912: {'East Germany', 'Germany' + }, + 1913: {'East Germany', 'Germany' + }, + 1914: {'East Germany', 'Germany' + }, + 1915: {'East Germany', 'Germany' + }, + 1916: {'East Germany', 'Germany' + }, + 1917: {'East Germany', 'Germany' + }, + 1918: {'East Germany', 'Germany' + }, + 1919: {'East Germany', 'Germany' + }, + 1920: {'East Germany', 'Germany' + }, + 1921: {'East Germany', 'Germany' + }, + 1922: {'East Germany', 'Germany' + }, + 1923: {'East Germany', 'Germany' + }, + 1924: {'East Germany', 'Germany' + }, + 1925: {'East Germany', 'Germany' + }, + 1926: {'East Germany', 'Germany' + }, + 1927: {'East Germany', 'Germany' + }, + 1928: {'East Germany', 'Germany' + }, + 1929: {'East Germany', 'Germany' + }, + 1930: {'East Germany', 'Germany' + }, + 1931: {'East Germany', 'Germany' + }, + 1932: {'East Germany', 'Germany' + }, + 1933: {'East Germany', 'Germany' + }, + 1934: {'East Germany', 'Germany' + }, + 1935: {'East Germany', 'Germany' + }, + 1936: {'East Germany', 'Germany' + }, + 1937: {'East Germany', 'Germany' + }, + 1938: {'East Germany', 'Germany' + }, + 1939: {'East Germany', 'Germany' + }, + 1940: {'East Germany', 'Germany' + }, + 1941: {'East Germany', 'Germany' + }, + 1942: {'East Germany', 'Germany' + }, + 1943: {'East Germany', 'Germany' + }, + 1944: {'East Germany', 'Germany' + }, + 1945: {'East Germany', 'Germany' + }, + 1946: {'East Germany', 'Germany' + }, + 1947: {'East Germany', 'Germany' + }, + 1948: {'East Germany', 'Germany' + }, + 1949: {'East Germany', 'Germany' + }, + 1950: {'East Germany', 'Germany' + }, + 1951: {'East Germany', 'Germany' + }, + 1952: {'East Germany', 'Germany' + }, + 1953: {'East Germany', 'Germany' + }, + 1954: {'East Germany', 'Germany' + }, + 1955: {'East Germany', 'Germany' + }, + 1956: {'East Germany', 'Germany' + }, + 1957: {'East Germany', 'Germany' + }, + 1958: {'East Germany', 'Germany' + }, + 1959: {'East Germany', 'Germany' + }, + 1960: {'East Germany', 'Germany' + }, + 1961: {'East Germany', 'Germany' + }, + 1962: {'East Germany', 'Germany' + }, + 1963: {'East Germany', 'Germany' + }, + 1964: {'East Germany', 'Germany' + }, + 1965: {'East Germany', 'Germany' + }, + 1966: {'East Germany', 'Germany' + }, + 1967: {'East Germany', 'Germany' + }, + 1968: {'East Germany', 'Germany' + }, + 1969: {'East Germany', 'Germany' + }, + 1970: {'East Germany', 'Germany' + }, + 1971: {'East Germany', 'Germany' + }, + 1972: {'East Germany', 'Germany' + }, + 1973: {'East Germany', 'Germany' + }, + 1974: {'East Germany', 'Germany' + }, + 1975: {'East Germany', 'Germany' + }, + 1976: {'East Germany', 'Germany' + }, + 1977: {'East Germany', 'Germany' + }, + 1978: {'East Germany', 'Germany' + }, + 1979: {'East Germany', 'Germany' + }, + 1980: {'East Germany', 'Germany' + }, + 1981: {'East Germany', 'Germany' + }, + 1982: {'East Germany', 'Germany' + }, + 1983: {'East Germany', 'Germany' + }, + 1984: {'East Germany', 'Germany' + }, + 1985: {'East Germany', 'Germany' + }, + 1986: {'East Germany', 'Germany' + }, + 1987: {'East Germany', 'Germany' + }, + 1988: {'East Germany', 'Germany' + }, + 1989: {'East Germany', 'Germany' + }, + 1990: {'East Germany', 'Germany' + }, + 1991: {'East Germany', 'Germany' + }, + 1992: {'East Germany', 'Germany' + }, + 1993: {'East Germany', 'Germany' + }, + 1994: {'East Germany', 'Germany' + }, + 1995: {'East Germany', 'Germany' + }, + 1996: {'East Germany', 'Germany' + }, + 1997: {'East Germany', 'Germany' + }, + 1998: {'East Germany', 'Germany' + }, + 1999: {'East Germany', 'Germany' + }, + 2000: {'East Germany', 'Germany' + }, + 2001: {'East Germany', 'Germany' + }, + 2002: {'East Germany', 'Germany' + }, + 2003: {'East Germany', 'Germany' + }, + 2004: {'East Germany', 'Germany' + }, + 2005: {'East Germany', 'Germany' + }, + 2006: {'East Germany', 'Germany' + }, + 2007: {'East Germany', 'Germany' + }, + 2008: {'East Germany', 'Germany' + }, + 2009: {'East Germany', 'Germany' + }, + 2010: {'East Germany', 'Germany' + }, + 2011: {'East Germany', 'Germany' + }, + 2012: {'East Germany', 'Germany' + }, + 2013: {'East Germany', 'Germany' + }, + 2014: {'East Germany', 'Germany' + }, + 2015: {'East Germany', 'Germany' + }, + 2016: {'East Germany', 'Germany' + }, + 2017: {'East Germany', 'Germany' + }, + 2018: {'East Germany', 'Germany' + }, + 2019: {'East Germany', 'Germany' + }, + 2020: {'East Germany', 'Germany' + }, + 2021: {'East Germany', 'Germany' + }, + 2022: {'East Germany', 'Germany' + }, + 2023: {'East Germany', 'Germany' + } + }, + { + 1789: {'Germany', 'Grand Duchy of Baden' + }, + 1790: {'Germany', 'Grand Duchy of Baden' + }, + 1791: {'Germany', 'Grand Duchy of Baden' + }, + 1792: {'Germany', 'Grand Duchy of Baden' + }, + 1793: {'Germany', 'Grand Duchy of Baden' + }, + 1794: {'Germany', 'Grand Duchy of Baden' + }, + 1795: {'Germany', 'Grand Duchy of Baden' + }, + 1796: {'Germany', 'Grand Duchy of Baden' + }, + 1797: {'Germany', 'Grand Duchy of Baden' + }, + 1798: {'Germany', 'Grand Duchy of Baden' + }, + 1799: {'Germany', 'Grand Duchy of Baden' + }, + 1800: {'Germany', 'Grand Duchy of Baden' + }, + 1801: {'Germany', 'Grand Duchy of Baden' + }, + 1802: {'Germany', 'Grand Duchy of Baden' + }, + 1803: {'Germany', 'Grand Duchy of Baden' + }, + 1804: {'Germany', 'Grand Duchy of Baden' + }, + 1805: {'Germany', 'Grand Duchy of Baden' + }, + 1806: {'Germany', 'Grand Duchy of Baden' + }, + 1807: {'Germany', 'Grand Duchy of Baden' + }, + 1808: {'Germany', 'Grand Duchy of Baden' + }, + 1809: {'Germany', 'Grand Duchy of Baden' + }, + 1810: {'Germany', 'Grand Duchy of Baden' + }, + 1811: {'Germany', 'Grand Duchy of Baden' + }, + 1812: {'Germany', 'Grand Duchy of Baden' + }, + 1813: {'Germany', 'Grand Duchy of Baden' + }, + 1814: {'Germany', 'Grand Duchy of Baden' + }, + 1815: {'Germany', 'Grand Duchy of Baden' + }, + 1816: {'Germany', 'Grand Duchy of Baden' + }, + 1817: {'Germany', 'Grand Duchy of Baden' + }, + 1818: {'Germany', 'Grand Duchy of Baden' + }, + 1819: {'Germany', 'Grand Duchy of Baden' + }, + 1820: {'Germany', 'Grand Duchy of Baden' + }, + 1821: {'Germany', 'Grand Duchy of Baden' + }, + 1822: {'Germany', 'Grand Duchy of Baden' + }, + 1823: {'Germany', 'Grand Duchy of Baden' + }, + 1824: {'Germany', 'Grand Duchy of Baden' + }, + 1825: {'Germany', 'Grand Duchy of Baden' + }, + 1826: {'Germany', 'Grand Duchy of Baden' + }, + 1827: {'Germany', 'Grand Duchy of Baden' + }, + 1828: {'Germany', 'Grand Duchy of Baden' + }, + 1829: {'Germany', 'Grand Duchy of Baden' + }, + 1830: {'Germany', 'Grand Duchy of Baden' + }, + 1831: {'Germany', 'Grand Duchy of Baden' + }, + 1832: {'Germany', 'Grand Duchy of Baden' + }, + 1833: {'Germany', 'Grand Duchy of Baden' + }, + 1834: {'Germany', 'Grand Duchy of Baden' + }, + 1835: {'Germany', 'Grand Duchy of Baden' + }, + 1836: {'Germany', 'Grand Duchy of Baden' + }, + 1837: {'Germany', 'Grand Duchy of Baden' + }, + 1838: {'Germany', 'Grand Duchy of Baden' + }, + 1839: {'Germany', 'Grand Duchy of Baden' + }, + 1840: {'Germany', 'Grand Duchy of Baden' + }, + 1841: {'Germany', 'Grand Duchy of Baden' + }, + 1842: {'Germany', 'Grand Duchy of Baden' + }, + 1843: {'Germany', 'Grand Duchy of Baden' + }, + 1844: {'Germany', 'Grand Duchy of Baden' + }, + 1845: {'Germany', 'Grand Duchy of Baden' + }, + 1846: {'Germany', 'Grand Duchy of Baden' + }, + 1847: {'Germany', 'Grand Duchy of Baden' + }, + 1848: {'Germany', 'Grand Duchy of Baden' + }, + 1849: {'Germany', 'Grand Duchy of Baden' + }, + 1850: {'Germany', 'Grand Duchy of Baden' + }, + 1851: {'Germany', 'Grand Duchy of Baden' + }, + 1852: {'Germany', 'Grand Duchy of Baden' + }, + 1853: {'Germany', 'Grand Duchy of Baden' + }, + 1854: {'Germany', 'Grand Duchy of Baden' + }, + 1855: {'Germany', 'Grand Duchy of Baden' + }, + 1856: {'Germany', 'Grand Duchy of Baden' + }, + 1857: {'Germany', 'Grand Duchy of Baden' + }, + 1858: {'Germany', 'Grand Duchy of Baden' + }, + 1859: {'Germany', 'Grand Duchy of Baden' + }, + 1860: {'Germany', 'Grand Duchy of Baden' + }, + 1861: {'Germany', 'Grand Duchy of Baden' + }, + 1862: {'Germany', 'Grand Duchy of Baden' + }, + 1863: {'Germany', 'Grand Duchy of Baden' + }, + 1864: {'Germany', 'Grand Duchy of Baden' + }, + 1865: {'Germany', 'Grand Duchy of Baden' + }, + 1866: {'Germany', 'Grand Duchy of Baden' + }, + 1867: {'Germany', 'Grand Duchy of Baden' + }, + 1868: {'Germany', 'Grand Duchy of Baden' + }, + 1869: {'Germany', 'Grand Duchy of Baden' + }, + 1870: {'Germany', 'Grand Duchy of Baden' + }, + 1871: {'Germany', 'Grand Duchy of Baden' + }, + 1872: {'Germany', 'Grand Duchy of Baden' + }, + 1873: {'Germany', 'Grand Duchy of Baden' + }, + 1874: {'Germany', 'Grand Duchy of Baden' + }, + 1875: {'Germany', 'Grand Duchy of Baden' + }, + 1876: {'Germany', 'Grand Duchy of Baden' + }, + 1877: {'Germany', 'Grand Duchy of Baden' + }, + 1878: {'Germany', 'Grand Duchy of Baden' + }, + 1879: {'Germany', 'Grand Duchy of Baden' + }, + 1880: {'Germany', 'Grand Duchy of Baden' + }, + 1881: {'Germany', 'Grand Duchy of Baden' + }, + 1882: {'Germany', 'Grand Duchy of Baden' + }, + 1883: {'Germany', 'Grand Duchy of Baden' + }, + 1884: {'Germany', 'Grand Duchy of Baden' + }, + 1885: {'Germany', 'Grand Duchy of Baden' + }, + 1886: {'Germany', 'Grand Duchy of Baden' + }, + 1887: {'Germany', 'Grand Duchy of Baden' + }, + 1888: {'Germany', 'Grand Duchy of Baden' + }, + 1889: {'Germany', 'Grand Duchy of Baden' + }, + 1890: {'Germany', 'Grand Duchy of Baden' + }, + 1891: {'Germany', 'Grand Duchy of Baden' + }, + 1892: {'Germany', 'Grand Duchy of Baden' + }, + 1893: {'Germany', 'Grand Duchy of Baden' + }, + 1894: {'Germany', 'Grand Duchy of Baden' + }, + 1895: {'Germany', 'Grand Duchy of Baden' + }, + 1896: {'Germany', 'Grand Duchy of Baden' + }, + 1897: {'Germany', 'Grand Duchy of Baden' + }, + 1898: {'Germany', 'Grand Duchy of Baden' + }, + 1899: {'Germany', 'Grand Duchy of Baden' + }, + 1900: {'Germany', 'Grand Duchy of Baden' + }, + 1901: {'Germany', 'Grand Duchy of Baden' + }, + 1902: {'Germany', 'Grand Duchy of Baden' + }, + 1903: {'Germany', 'Grand Duchy of Baden' + }, + 1904: {'Germany', 'Grand Duchy of Baden' + }, + 1905: {'Germany', 'Grand Duchy of Baden' + }, + 1906: {'Germany', 'Grand Duchy of Baden' + }, + 1907: {'Germany', 'Grand Duchy of Baden' + }, + 1908: {'Germany', 'Grand Duchy of Baden' + }, + 1909: {'Germany', 'Grand Duchy of Baden' + }, + 1910: {'Germany', 'Grand Duchy of Baden' + }, + 1911: {'Germany', 'Grand Duchy of Baden' + }, + 1912: {'Germany', 'Grand Duchy of Baden' + }, + 1913: {'Germany', 'Grand Duchy of Baden' + }, + 1914: {'Germany', 'Grand Duchy of Baden' + }, + 1915: {'Germany', 'Grand Duchy of Baden' + }, + 1916: {'Germany', 'Grand Duchy of Baden' + }, + 1917: {'Germany', 'Grand Duchy of Baden' + }, + 1918: {'Germany', 'Grand Duchy of Baden' + }, + 1919: {'Germany', 'Grand Duchy of Baden' + }, + 1920: {'Germany', 'Grand Duchy of Baden' + }, + 1921: {'Germany', 'Grand Duchy of Baden' + }, + 1922: {'Germany', 'Grand Duchy of Baden' + }, + 1923: {'Germany', 'Grand Duchy of Baden' + }, + 1924: {'Germany', 'Grand Duchy of Baden' + }, + 1925: {'Germany', 'Grand Duchy of Baden' + }, + 1926: {'Germany', 'Grand Duchy of Baden' + }, + 1927: {'Germany', 'Grand Duchy of Baden' + }, + 1928: {'Germany', 'Grand Duchy of Baden' + }, + 1929: {'Germany', 'Grand Duchy of Baden' + }, + 1930: {'Germany', 'Grand Duchy of Baden' + }, + 1931: {'Germany', 'Grand Duchy of Baden' + }, + 1932: {'Germany', 'Grand Duchy of Baden' + }, + 1933: {'Germany', 'Grand Duchy of Baden' + }, + 1934: {'Germany', 'Grand Duchy of Baden' + }, + 1935: {'Germany', 'Grand Duchy of Baden' + }, + 1936: {'Germany', 'Grand Duchy of Baden' + }, + 1937: {'Germany', 'Grand Duchy of Baden' + }, + 1938: {'Germany', 'Grand Duchy of Baden' + }, + 1939: {'Germany', 'Grand Duchy of Baden' + }, + 1940: {'Germany', 'Grand Duchy of Baden' + }, + 1941: {'Germany', 'Grand Duchy of Baden' + }, + 1942: {'Germany', 'Grand Duchy of Baden' + }, + 1943: {'Germany', 'Grand Duchy of Baden' + }, + 1944: {'Germany', 'Grand Duchy of Baden' + }, + 1945: {'Germany', 'Grand Duchy of Baden' + }, + 1946: {'Germany', 'Grand Duchy of Baden' + }, + 1947: {'Germany', 'Grand Duchy of Baden' + }, + 1948: {'Germany', 'Grand Duchy of Baden' + }, + 1949: {'Germany', 'Grand Duchy of Baden' + }, + 1950: {'Germany', 'Grand Duchy of Baden' + }, + 1951: {'Germany', 'Grand Duchy of Baden' + }, + 1952: {'Germany', 'Grand Duchy of Baden' + }, + 1953: {'Germany', 'Grand Duchy of Baden' + }, + 1954: {'Germany', 'Grand Duchy of Baden' + }, + 1955: {'Germany', 'Grand Duchy of Baden' + }, + 1956: {'Germany', 'Grand Duchy of Baden' + }, + 1957: {'Germany', 'Grand Duchy of Baden' + }, + 1958: {'Germany', 'Grand Duchy of Baden' + }, + 1959: {'Germany', 'Grand Duchy of Baden' + }, + 1960: {'Germany', 'Grand Duchy of Baden' + }, + 1961: {'Germany', 'Grand Duchy of Baden' + }, + 1962: {'Germany', 'Grand Duchy of Baden' + }, + 1963: {'Germany', 'Grand Duchy of Baden' + }, + 1964: {'Germany', 'Grand Duchy of Baden' + }, + 1965: {'Germany', 'Grand Duchy of Baden' + }, + 1966: {'Germany', 'Grand Duchy of Baden' + }, + 1967: {'Germany', 'Grand Duchy of Baden' + }, + 1968: {'Germany', 'Grand Duchy of Baden' + }, + 1969: {'Germany', 'Grand Duchy of Baden' + }, + 1970: {'Germany', 'Grand Duchy of Baden' + }, + 1971: {'Germany', 'Grand Duchy of Baden' + }, + 1972: {'Germany', 'Grand Duchy of Baden' + }, + 1973: {'Germany', 'Grand Duchy of Baden' + }, + 1974: {'Germany', 'Grand Duchy of Baden' + }, + 1975: {'Germany', 'Grand Duchy of Baden' + }, + 1976: {'Germany', 'Grand Duchy of Baden' + }, + 1977: {'Germany', 'Grand Duchy of Baden' + }, + 1978: {'Germany', 'Grand Duchy of Baden' + }, + 1979: {'Germany', 'Grand Duchy of Baden' + }, + 1980: {'Germany', 'Grand Duchy of Baden' + }, + 1981: {'Germany', 'Grand Duchy of Baden' + }, + 1982: {'Germany', 'Grand Duchy of Baden' + }, + 1983: {'Germany', 'Grand Duchy of Baden' + }, + 1984: {'Germany', 'Grand Duchy of Baden' + }, + 1985: {'Germany', 'Grand Duchy of Baden' + }, + 1986: {'Germany', 'Grand Duchy of Baden' + }, + 1987: {'Germany', 'Grand Duchy of Baden' + }, + 1988: {'Germany', 'Grand Duchy of Baden' + }, + 1989: {'Germany', 'Grand Duchy of Baden' + }, + 1990: {'Germany', 'Grand Duchy of Baden' + }, + 1991: {'Germany', 'Grand Duchy of Baden' + }, + 1992: {'Germany', 'Grand Duchy of Baden' + }, + 1993: {'Germany', 'Grand Duchy of Baden' + }, + 1994: {'Germany', 'Grand Duchy of Baden' + }, + 1995: {'Germany', 'Grand Duchy of Baden' + }, + 1996: {'Germany', 'Grand Duchy of Baden' + }, + 1997: {'Germany', 'Grand Duchy of Baden' + }, + 1998: {'Germany', 'Grand Duchy of Baden' + }, + 1999: {'Germany', 'Grand Duchy of Baden' + }, + 2000: {'Germany', 'Grand Duchy of Baden' + }, + 2001: {'Germany', 'Grand Duchy of Baden' + }, + 2002: {'Germany', 'Grand Duchy of Baden' + }, + 2003: {'Germany', 'Grand Duchy of Baden' + }, + 2004: {'Germany', 'Grand Duchy of Baden' + }, + 2005: {'Germany', 'Grand Duchy of Baden' + }, + 2006: {'Germany', 'Grand Duchy of Baden' + }, + 2007: {'Germany', 'Grand Duchy of Baden' + }, + 2008: {'Germany', 'Grand Duchy of Baden' + }, + 2009: {'Germany', 'Grand Duchy of Baden' + }, + 2010: {'Germany', 'Grand Duchy of Baden' + }, + 2011: {'Germany', 'Grand Duchy of Baden' + }, + 2012: {'Germany', 'Grand Duchy of Baden' + }, + 2013: {'Germany', 'Grand Duchy of Baden' + }, + 2014: {'Germany', 'Grand Duchy of Baden' + }, + 2015: {'Germany', 'Grand Duchy of Baden' + }, + 2016: {'Germany', 'Grand Duchy of Baden' + }, + 2017: {'Germany', 'Grand Duchy of Baden' + }, + 2018: {'Germany', 'Grand Duchy of Baden' + }, + 2019: {'Germany', 'Grand Duchy of Baden' + }, + 2020: {'Germany', 'Grand Duchy of Baden' + }, + 2021: {'Germany', 'Grand Duchy of Baden' + }, + 2022: {'Germany', 'Grand Duchy of Baden' + }, + 2023: {'Germany', 'Grand Duchy of Baden' + } + }, + { + 1789: {'Germany', 'Kingdom of Bavaria' + }, + 1790: {'Germany', 'Kingdom of Bavaria' + }, + 1791: {'Germany', 'Kingdom of Bavaria' + }, + 1792: {'Germany', 'Kingdom of Bavaria' + }, + 1793: {'Germany', 'Kingdom of Bavaria' + }, + 1794: {'Germany', 'Kingdom of Bavaria' + }, + 1795: {'Germany', 'Kingdom of Bavaria' + }, + 1796: {'Germany', 'Kingdom of Bavaria' + }, + 1797: {'Germany', 'Kingdom of Bavaria' + }, + 1798: {'Germany', 'Kingdom of Bavaria' + }, + 1799: {'Germany', 'Kingdom of Bavaria' + }, + 1800: {'Germany', 'Kingdom of Bavaria' + }, + 1801: {'Germany', 'Kingdom of Bavaria' + }, + 1802: {'Germany', 'Kingdom of Bavaria' + }, + 1803: {'Germany', 'Kingdom of Bavaria' + }, + 1804: {'Germany', 'Kingdom of Bavaria' + }, + 1805: {'Germany', 'Kingdom of Bavaria' + }, + 1806: {'Germany', 'Kingdom of Bavaria' + }, + 1807: {'Germany', 'Kingdom of Bavaria' + }, + 1808: {'Germany', 'Kingdom of Bavaria' + }, + 1809: {'Germany', 'Kingdom of Bavaria' + }, + 1810: {'Germany', 'Kingdom of Bavaria' + }, + 1811: {'Germany', 'Kingdom of Bavaria' + }, + 1812: {'Germany', 'Kingdom of Bavaria' + }, + 1813: {'Germany', 'Kingdom of Bavaria' + }, + 1814: {'Germany', 'Kingdom of Bavaria' + }, + 1815: {'Germany', 'Kingdom of Bavaria' + }, + 1816: {'Germany', 'Kingdom of Bavaria' + }, + 1817: {'Germany', 'Kingdom of Bavaria' + }, + 1818: {'Germany', 'Kingdom of Bavaria' + }, + 1819: {'Germany', 'Kingdom of Bavaria' + }, + 1820: {'Germany', 'Kingdom of Bavaria' + }, + 1821: {'Germany', 'Kingdom of Bavaria' + }, + 1822: {'Germany', 'Kingdom of Bavaria' + }, + 1823: {'Germany', 'Kingdom of Bavaria' + }, + 1824: {'Germany', 'Kingdom of Bavaria' + }, + 1825: {'Germany', 'Kingdom of Bavaria' + }, + 1826: {'Germany', 'Kingdom of Bavaria' + }, + 1827: {'Germany', 'Kingdom of Bavaria' + }, + 1828: {'Germany', 'Kingdom of Bavaria' + }, + 1829: {'Germany', 'Kingdom of Bavaria' + }, + 1830: {'Germany', 'Kingdom of Bavaria' + }, + 1831: {'Germany', 'Kingdom of Bavaria' + }, + 1832: {'Germany', 'Kingdom of Bavaria' + }, + 1833: {'Germany', 'Kingdom of Bavaria' + }, + 1834: {'Germany', 'Kingdom of Bavaria' + }, + 1835: {'Germany', 'Kingdom of Bavaria' + }, + 1836: {'Germany', 'Kingdom of Bavaria' + }, + 1837: {'Germany', 'Kingdom of Bavaria' + }, + 1838: {'Germany', 'Kingdom of Bavaria' + }, + 1839: {'Germany', 'Kingdom of Bavaria' + }, + 1840: {'Germany', 'Kingdom of Bavaria' + }, + 1841: {'Germany', 'Kingdom of Bavaria' + }, + 1842: {'Germany', 'Kingdom of Bavaria' + }, + 1843: {'Germany', 'Kingdom of Bavaria' + }, + 1844: {'Germany', 'Kingdom of Bavaria' + }, + 1845: {'Germany', 'Kingdom of Bavaria' + }, + 1846: {'Germany', 'Kingdom of Bavaria' + }, + 1847: {'Germany', 'Kingdom of Bavaria' + }, + 1848: {'Germany', 'Kingdom of Bavaria' + }, + 1849: {'Germany', 'Kingdom of Bavaria' + }, + 1850: {'Germany', 'Kingdom of Bavaria' + }, + 1851: {'Germany', 'Kingdom of Bavaria' + }, + 1852: {'Germany', 'Kingdom of Bavaria' + }, + 1853: {'Germany', 'Kingdom of Bavaria' + }, + 1854: {'Germany', 'Kingdom of Bavaria' + }, + 1855: {'Germany', 'Kingdom of Bavaria' + }, + 1856: {'Germany', 'Kingdom of Bavaria' + }, + 1857: {'Germany', 'Kingdom of Bavaria' + }, + 1858: {'Germany', 'Kingdom of Bavaria' + }, + 1859: {'Germany', 'Kingdom of Bavaria' + }, + 1860: {'Germany', 'Kingdom of Bavaria' + }, + 1861: {'Germany', 'Kingdom of Bavaria' + }, + 1862: {'Germany', 'Kingdom of Bavaria' + }, + 1863: {'Germany', 'Kingdom of Bavaria' + }, + 1864: {'Germany', 'Kingdom of Bavaria' + }, + 1865: {'Germany', 'Kingdom of Bavaria' + }, + 1866: {'Germany', 'Kingdom of Bavaria' + }, + 1867: {'Germany', 'Kingdom of Bavaria' + }, + 1868: {'Germany', 'Kingdom of Bavaria' + }, + 1869: {'Germany', 'Kingdom of Bavaria' + }, + 1870: {'Germany', 'Kingdom of Bavaria' + }, + 1871: {'Germany', 'Kingdom of Bavaria' + }, + 1872: {'Germany', 'Kingdom of Bavaria' + }, + 1873: {'Germany', 'Kingdom of Bavaria' + }, + 1874: {'Germany', 'Kingdom of Bavaria' + }, + 1875: {'Germany', 'Kingdom of Bavaria' + }, + 1876: {'Germany', 'Kingdom of Bavaria' + }, + 1877: {'Germany', 'Kingdom of Bavaria' + }, + 1878: {'Germany', 'Kingdom of Bavaria' + }, + 1879: {'Germany', 'Kingdom of Bavaria' + }, + 1880: {'Germany', 'Kingdom of Bavaria' + }, + 1881: {'Germany', 'Kingdom of Bavaria' + }, + 1882: {'Germany', 'Kingdom of Bavaria' + }, + 1883: {'Germany', 'Kingdom of Bavaria' + }, + 1884: {'Germany', 'Kingdom of Bavaria' + }, + 1885: {'Germany', 'Kingdom of Bavaria' + }, + 1886: {'Germany', 'Kingdom of Bavaria' + }, + 1887: {'Germany', 'Kingdom of Bavaria' + }, + 1888: {'Germany', 'Kingdom of Bavaria' + }, + 1889: {'Germany', 'Kingdom of Bavaria' + }, + 1890: {'Germany', 'Kingdom of Bavaria' + }, + 1891: {'Germany', 'Kingdom of Bavaria' + }, + 1892: {'Germany', 'Kingdom of Bavaria' + }, + 1893: {'Germany', 'Kingdom of Bavaria' + }, + 1894: {'Germany', 'Kingdom of Bavaria' + }, + 1895: {'Germany', 'Kingdom of Bavaria' + }, + 1896: {'Germany', 'Kingdom of Bavaria' + }, + 1897: {'Germany', 'Kingdom of Bavaria' + }, + 1898: {'Germany', 'Kingdom of Bavaria' + }, + 1899: {'Germany', 'Kingdom of Bavaria' + }, + 1900: {'Germany', 'Kingdom of Bavaria' + }, + 1901: {'Germany', 'Kingdom of Bavaria' + }, + 1902: {'Germany', 'Kingdom of Bavaria' + }, + 1903: {'Germany', 'Kingdom of Bavaria' + }, + 1904: {'Germany', 'Kingdom of Bavaria' + }, + 1905: {'Germany', 'Kingdom of Bavaria' + }, + 1906: {'Germany', 'Kingdom of Bavaria' + }, + 1907: {'Germany', 'Kingdom of Bavaria' + }, + 1908: {'Germany', 'Kingdom of Bavaria' + }, + 1909: {'Germany', 'Kingdom of Bavaria' + }, + 1910: {'Germany', 'Kingdom of Bavaria' + }, + 1911: {'Germany', 'Kingdom of Bavaria' + }, + 1912: {'Germany', 'Kingdom of Bavaria' + }, + 1913: {'Germany', 'Kingdom of Bavaria' + }, + 1914: {'Germany', 'Kingdom of Bavaria' + }, + 1915: {'Germany', 'Kingdom of Bavaria' + }, + 1916: {'Germany', 'Kingdom of Bavaria' + }, + 1917: {'Germany', 'Kingdom of Bavaria' + }, + 1918: {'Germany', 'Kingdom of Bavaria' + }, + 1919: {'Germany', 'Kingdom of Bavaria' + }, + 1920: {'Germany', 'Kingdom of Bavaria' + }, + 1921: {'Germany', 'Kingdom of Bavaria' + }, + 1922: {'Germany', 'Kingdom of Bavaria' + }, + 1923: {'Germany', 'Kingdom of Bavaria' + }, + 1924: {'Germany', 'Kingdom of Bavaria' + }, + 1925: {'Germany', 'Kingdom of Bavaria' + }, + 1926: {'Germany', 'Kingdom of Bavaria' + }, + 1927: {'Germany', 'Kingdom of Bavaria' + }, + 1928: {'Germany', 'Kingdom of Bavaria' + }, + 1929: {'Germany', 'Kingdom of Bavaria' + }, + 1930: {'Germany', 'Kingdom of Bavaria' + }, + 1931: {'Germany', 'Kingdom of Bavaria' + }, + 1932: {'Germany', 'Kingdom of Bavaria' + }, + 1933: {'Germany', 'Kingdom of Bavaria' + }, + 1934: {'Germany', 'Kingdom of Bavaria' + }, + 1935: {'Germany', 'Kingdom of Bavaria' + }, + 1936: {'Germany', 'Kingdom of Bavaria' + }, + 1937: {'Germany', 'Kingdom of Bavaria' + }, + 1938: {'Germany', 'Kingdom of Bavaria' + }, + 1939: {'Germany', 'Kingdom of Bavaria' + }, + 1940: {'Germany', 'Kingdom of Bavaria' + }, + 1941: {'Germany', 'Kingdom of Bavaria' + }, + 1942: {'Germany', 'Kingdom of Bavaria' + }, + 1943: {'Germany', 'Kingdom of Bavaria' + }, + 1944: {'Germany', 'Kingdom of Bavaria' + }, + 1945: {'Germany', 'Kingdom of Bavaria' + }, + 1946: {'Germany', 'Kingdom of Bavaria' + }, + 1947: {'Germany', 'Kingdom of Bavaria' + }, + 1948: {'Germany', 'Kingdom of Bavaria' + }, + 1949: {'Germany', 'Kingdom of Bavaria' + }, + 1950: {'Germany', 'Kingdom of Bavaria' + }, + 1951: {'Germany', 'Kingdom of Bavaria' + }, + 1952: {'Germany', 'Kingdom of Bavaria' + }, + 1953: {'Germany', 'Kingdom of Bavaria' + }, + 1954: {'Germany', 'Kingdom of Bavaria' + }, + 1955: {'Germany', 'Kingdom of Bavaria' + }, + 1956: {'Germany', 'Kingdom of Bavaria' + }, + 1957: {'Germany', 'Kingdom of Bavaria' + }, + 1958: {'Germany', 'Kingdom of Bavaria' + }, + 1959: {'Germany', 'Kingdom of Bavaria' + }, + 1960: {'Germany', 'Kingdom of Bavaria' + }, + 1961: {'Germany', 'Kingdom of Bavaria' + }, + 1962: {'Germany', 'Kingdom of Bavaria' + }, + 1963: {'Germany', 'Kingdom of Bavaria' + }, + 1964: {'Germany', 'Kingdom of Bavaria' + }, + 1965: {'Germany', 'Kingdom of Bavaria' + }, + 1966: {'Germany', 'Kingdom of Bavaria' + }, + 1967: {'Germany', 'Kingdom of Bavaria' + }, + 1968: {'Germany', 'Kingdom of Bavaria' + }, + 1969: {'Germany', 'Kingdom of Bavaria' + }, + 1970: {'Germany', 'Kingdom of Bavaria' + }, + 1971: {'Germany', 'Kingdom of Bavaria' + }, + 1972: {'Germany', 'Kingdom of Bavaria' + }, + 1973: {'Germany', 'Kingdom of Bavaria' + }, + 1974: {'Germany', 'Kingdom of Bavaria' + }, + 1975: {'Germany', 'Kingdom of Bavaria' + }, + 1976: {'Germany', 'Kingdom of Bavaria' + }, + 1977: {'Germany', 'Kingdom of Bavaria' + }, + 1978: {'Germany', 'Kingdom of Bavaria' + }, + 1979: {'Germany', 'Kingdom of Bavaria' + }, + 1980: {'Germany', 'Kingdom of Bavaria' + }, + 1981: {'Germany', 'Kingdom of Bavaria' + }, + 1982: {'Germany', 'Kingdom of Bavaria' + }, + 1983: {'Germany', 'Kingdom of Bavaria' + }, + 1984: {'Germany', 'Kingdom of Bavaria' + }, + 1985: {'Germany', 'Kingdom of Bavaria' + }, + 1986: {'Germany', 'Kingdom of Bavaria' + }, + 1987: {'Germany', 'Kingdom of Bavaria' + }, + 1988: {'Germany', 'Kingdom of Bavaria' + }, + 1989: {'Germany', 'Kingdom of Bavaria' + }, + 1990: {'Germany', 'Kingdom of Bavaria' + }, + 1991: {'Germany', 'Kingdom of Bavaria' + }, + 1992: {'Germany', 'Kingdom of Bavaria' + }, + 1993: {'Germany', 'Kingdom of Bavaria' + }, + 1994: {'Germany', 'Kingdom of Bavaria' + }, + 1995: {'Germany', 'Kingdom of Bavaria' + }, + 1996: {'Germany', 'Kingdom of Bavaria' + }, + 1997: {'Germany', 'Kingdom of Bavaria' + }, + 1998: {'Germany', 'Kingdom of Bavaria' + }, + 1999: {'Germany', 'Kingdom of Bavaria' + }, + 2000: {'Germany', 'Kingdom of Bavaria' + }, + 2001: {'Germany', 'Kingdom of Bavaria' + }, + 2002: {'Germany', 'Kingdom of Bavaria' + }, + 2003: {'Germany', 'Kingdom of Bavaria' + }, + 2004: {'Germany', 'Kingdom of Bavaria' + }, + 2005: {'Germany', 'Kingdom of Bavaria' + }, + 2006: {'Germany', 'Kingdom of Bavaria' + }, + 2007: {'Germany', 'Kingdom of Bavaria' + }, + 2008: {'Germany', 'Kingdom of Bavaria' + }, + 2009: {'Germany', 'Kingdom of Bavaria' + }, + 2010: {'Germany', 'Kingdom of Bavaria' + }, + 2011: {'Germany', 'Kingdom of Bavaria' + }, + 2012: {'Germany', 'Kingdom of Bavaria' + }, + 2013: {'Germany', 'Kingdom of Bavaria' + }, + 2014: {'Germany', 'Kingdom of Bavaria' + }, + 2015: {'Germany', 'Kingdom of Bavaria' + }, + 2016: {'Germany', 'Kingdom of Bavaria' + }, + 2017: {'Germany', 'Kingdom of Bavaria' + }, + 2018: {'Germany', 'Kingdom of Bavaria' + }, + 2019: {'Germany', 'Kingdom of Bavaria' + }, + 2020: {'Germany', 'Kingdom of Bavaria' + }, + 2021: {'Germany', 'Kingdom of Bavaria' + }, + 2022: {'Germany', 'Kingdom of Bavaria' + }, + 2023: {'Germany', 'Kingdom of Bavaria' + } + }, + { + 1789: {'Republic of Vietnam', 'Vietnam' + }, + 1790: {'Republic of Vietnam', 'Vietnam' + }, + 1791: {'Republic of Vietnam', 'Vietnam' + }, + 1792: {'Republic of Vietnam', 'Vietnam' + }, + 1793: {'Republic of Vietnam', 'Vietnam' + }, + 1794: {'Republic of Vietnam', 'Vietnam' + }, + 1795: {'Republic of Vietnam', 'Vietnam' + }, + 1796: {'Republic of Vietnam', 'Vietnam' + }, + 1797: {'Republic of Vietnam', 'Vietnam' + }, + 1798: {'Republic of Vietnam', 'Vietnam' + }, + 1799: {'Republic of Vietnam', 'Vietnam' + }, + 1800: {'Republic of Vietnam', 'Vietnam' + }, + 1801: {'Republic of Vietnam', 'Vietnam' + }, + 1802: {'Republic of Vietnam', 'Vietnam' + }, + 1803: {'Republic of Vietnam', 'Vietnam' + }, + 1804: {'Republic of Vietnam', 'Vietnam' + }, + 1805: {'Republic of Vietnam', 'Vietnam' + }, + 1806: {'Republic of Vietnam', 'Vietnam' + }, + 1807: {'Republic of Vietnam', 'Vietnam' + }, + 1808: {'Republic of Vietnam', 'Vietnam' + }, + 1809: {'Republic of Vietnam', 'Vietnam' + }, + 1810: {'Republic of Vietnam', 'Vietnam' + }, + 1811: {'Republic of Vietnam', 'Vietnam' + }, + 1812: {'Republic of Vietnam', 'Vietnam' + }, + 1813: {'Republic of Vietnam', 'Vietnam' + }, + 1814: {'Republic of Vietnam', 'Vietnam' + }, + 1815: {'Republic of Vietnam', 'Vietnam' + }, + 1816: {'Republic of Vietnam', 'Vietnam' + }, + 1817: {'Republic of Vietnam', 'Vietnam' + }, + 1818: {'Republic of Vietnam', 'Vietnam' + }, + 1819: {'Republic of Vietnam', 'Vietnam' + }, + 1820: {'Republic of Vietnam', 'Vietnam' + }, + 1821: {'Republic of Vietnam', 'Vietnam' + }, + 1822: {'Republic of Vietnam', 'Vietnam' + }, + 1823: {'Republic of Vietnam', 'Vietnam' + }, + 1824: {'Republic of Vietnam', 'Vietnam' + }, + 1825: {'Republic of Vietnam', 'Vietnam' + }, + 1826: {'Republic of Vietnam', 'Vietnam' + }, + 1827: {'Republic of Vietnam', 'Vietnam' + }, + 1828: {'Republic of Vietnam', 'Vietnam' + }, + 1829: {'Republic of Vietnam', 'Vietnam' + }, + 1830: {'Republic of Vietnam', 'Vietnam' + }, + 1831: {'Republic of Vietnam', 'Vietnam' + }, + 1832: {'Republic of Vietnam', 'Vietnam' + }, + 1833: {'Republic of Vietnam', 'Vietnam' + }, + 1834: {'Republic of Vietnam', 'Vietnam' + }, + 1835: {'Republic of Vietnam', 'Vietnam' + }, + 1836: {'Republic of Vietnam', 'Vietnam' + }, + 1837: {'Republic of Vietnam', 'Vietnam' + }, + 1838: {'Republic of Vietnam', 'Vietnam' + }, + 1839: {'Republic of Vietnam', 'Vietnam' + }, + 1840: {'Republic of Vietnam', 'Vietnam' + }, + 1841: {'Republic of Vietnam', 'Vietnam' + }, + 1842: {'Republic of Vietnam', 'Vietnam' + }, + 1843: {'Republic of Vietnam', 'Vietnam' + }, + 1844: {'Republic of Vietnam', 'Vietnam' + }, + 1845: {'Republic of Vietnam', 'Vietnam' + }, + 1846: {'Republic of Vietnam', 'Vietnam' + }, + 1847: {'Republic of Vietnam', 'Vietnam' + }, + 1848: {'Republic of Vietnam', 'Vietnam' + }, + 1849: {'Republic of Vietnam', 'Vietnam' + }, + 1850: {'Republic of Vietnam', 'Vietnam' + }, + 1851: {'Republic of Vietnam', 'Vietnam' + }, + 1852: {'Republic of Vietnam', 'Vietnam' + }, + 1853: {'Republic of Vietnam', 'Vietnam' + }, + 1854: {'Republic of Vietnam', 'Vietnam' + }, + 1855: {'Republic of Vietnam', 'Vietnam' + }, + 1856: {'Republic of Vietnam', 'Vietnam' + }, + 1857: {'Republic of Vietnam', 'Vietnam' + }, + 1858: {'Republic of Vietnam', 'Vietnam' + }, + 1859: {'Republic of Vietnam', 'Vietnam' + }, + 1860: {'Republic of Vietnam', 'Vietnam' + }, + 1861: {'Republic of Vietnam', 'Vietnam' + }, + 1862: {'Republic of Vietnam', 'Vietnam' + }, + 1863: {'Republic of Vietnam', 'Vietnam' + }, + 1864: {'Republic of Vietnam', 'Vietnam' + }, + 1865: {'Republic of Vietnam', 'Vietnam' + }, + 1866: {'Republic of Vietnam', 'Vietnam' + }, + 1867: {'Republic of Vietnam', 'Vietnam' + }, + 1868: {'Republic of Vietnam', 'Vietnam' + }, + 1869: {'Republic of Vietnam', 'Vietnam' + }, + 1870: {'Republic of Vietnam', 'Vietnam' + }, + 1871: {'Republic of Vietnam', 'Vietnam' + }, + 1872: {'Republic of Vietnam', 'Vietnam' + }, + 1873: {'Republic of Vietnam', 'Vietnam' + }, + 1874: {'Republic of Vietnam', 'Vietnam' + }, + 1875: {'Republic of Vietnam', 'Vietnam' + }, + 1876: {'Republic of Vietnam', 'Vietnam' + }, + 1877: {'Republic of Vietnam', 'Vietnam' + }, + 1878: {'Republic of Vietnam', 'Vietnam' + }, + 1879: {'Republic of Vietnam', 'Vietnam' + }, + 1880: {'Republic of Vietnam', 'Vietnam' + }, + 1881: {'Republic of Vietnam', 'Vietnam' + }, + 1882: {'Republic of Vietnam', 'Vietnam' + }, + 1883: {'Republic of Vietnam', 'Vietnam' + }, + 1884: {'Republic of Vietnam', 'Vietnam' + }, + 1885: {'Republic of Vietnam', 'Vietnam' + }, + 1886: {'Republic of Vietnam', 'Vietnam' + }, + 1887: {'Republic of Vietnam', 'Vietnam' + }, + 1888: {'Republic of Vietnam', 'Vietnam' + }, + 1889: {'Republic of Vietnam', 'Vietnam' + }, + 1890: {'Republic of Vietnam', 'Vietnam' + }, + 1891: {'Republic of Vietnam', 'Vietnam' + }, + 1892: {'Republic of Vietnam', 'Vietnam' + }, + 1893: {'Republic of Vietnam', 'Vietnam' + }, + 1894: {'Republic of Vietnam', 'Vietnam' + }, + 1895: {'Republic of Vietnam', 'Vietnam' + }, + 1896: {'Republic of Vietnam', 'Vietnam' + }, + 1897: {'Republic of Vietnam', 'Vietnam' + }, + 1898: {'Republic of Vietnam', 'Vietnam' + }, + 1899: {'Republic of Vietnam', 'Vietnam' + }, + 1900: {'Republic of Vietnam', 'Vietnam' + }, + 1901: {'Republic of Vietnam', 'Vietnam' + }, + 1902: {'Republic of Vietnam', 'Vietnam' + }, + 1903: {'Republic of Vietnam', 'Vietnam' + }, + 1904: {'Republic of Vietnam', 'Vietnam' + }, + 1905: {'Republic of Vietnam', 'Vietnam' + }, + 1906: {'Republic of Vietnam', 'Vietnam' + }, + 1907: {'Republic of Vietnam', 'Vietnam' + }, + 1908: {'Republic of Vietnam', 'Vietnam' + }, + 1909: {'Republic of Vietnam', 'Vietnam' + }, + 1910: {'Republic of Vietnam', 'Vietnam' + }, + 1911: {'Republic of Vietnam', 'Vietnam' + }, + 1912: {'Republic of Vietnam', 'Vietnam' + }, + 1913: {'Republic of Vietnam', 'Vietnam' + }, + 1914: {'Republic of Vietnam', 'Vietnam' + }, + 1915: {'Republic of Vietnam', 'Vietnam' + }, + 1916: {'Republic of Vietnam', 'Vietnam' + }, + 1917: {'Republic of Vietnam', 'Vietnam' + }, + 1918: {'Republic of Vietnam', 'Vietnam' + }, + 1919: {'Republic of Vietnam', 'Vietnam' + }, + 1920: {'Republic of Vietnam', 'Vietnam' + }, + 1921: {'Republic of Vietnam', 'Vietnam' + }, + 1922: {'Republic of Vietnam', 'Vietnam' + }, + 1923: {'Republic of Vietnam', 'Vietnam' + }, + 1924: {'Republic of Vietnam', 'Vietnam' + }, + 1925: {'Republic of Vietnam', 'Vietnam' + }, + 1926: {'Republic of Vietnam', 'Vietnam' + }, + 1927: {'Republic of Vietnam', 'Vietnam' + }, + 1928: {'Republic of Vietnam', 'Vietnam' + }, + 1929: {'Republic of Vietnam', 'Vietnam' + }, + 1930: {'Republic of Vietnam', 'Vietnam' + }, + 1931: {'Republic of Vietnam', 'Vietnam' + }, + 1932: {'Republic of Vietnam', 'Vietnam' + }, + 1933: {'Republic of Vietnam', 'Vietnam' + }, + 1934: {'Republic of Vietnam', 'Vietnam' + }, + 1935: {'Republic of Vietnam', 'Vietnam' + }, + 1936: {'Republic of Vietnam', 'Vietnam' + }, + 1937: {'Republic of Vietnam', 'Vietnam' + }, + 1938: {'Republic of Vietnam', 'Vietnam' + }, + 1939: {'Republic of Vietnam', 'Vietnam' + }, + 1940: {'Republic of Vietnam', 'Vietnam' + }, + 1941: {'Republic of Vietnam', 'Vietnam' + }, + 1942: {'Republic of Vietnam', 'Vietnam' + }, + 1943: {'Republic of Vietnam', 'Vietnam' + }, + 1944: {'Republic of Vietnam', 'Vietnam' + }, + 1945: {'Republic of Vietnam', 'Vietnam' + }, + 1946: {'Republic of Vietnam', 'Vietnam' + }, + 1947: {'Republic of Vietnam', 'Vietnam' + }, + 1948: {'Republic of Vietnam', 'Vietnam' + }, + 1949: {'Republic of Vietnam', 'Vietnam' + }, + 1950: {'Republic of Vietnam', 'Vietnam' + }, + 1951: {'Republic of Vietnam', 'Vietnam' + }, + 1952: {'Republic of Vietnam', 'Vietnam' + }, + 1953: {'Republic of Vietnam', 'Vietnam' + }, + 1954: {'Republic of Vietnam', 'Vietnam' + }, + 1955: {'Republic of Vietnam', 'Vietnam' + }, + 1956: {'Republic of Vietnam', 'Vietnam' + }, + 1957: {'Republic of Vietnam', 'Vietnam' + }, + 1958: {'Republic of Vietnam', 'Vietnam' + }, + 1959: {'Republic of Vietnam', 'Vietnam' + }, + 1960: {'Republic of Vietnam', 'Vietnam' + }, + 1961: {'Republic of Vietnam', 'Vietnam' + }, + 1962: {'Republic of Vietnam', 'Vietnam' + }, + 1963: {'Republic of Vietnam', 'Vietnam' + }, + 1964: {'Republic of Vietnam', 'Vietnam' + }, + 1965: {'Republic of Vietnam', 'Vietnam' + }, + 1966: {'Republic of Vietnam', 'Vietnam' + }, + 1967: {'Republic of Vietnam', 'Vietnam' + }, + 1968: {'Republic of Vietnam', 'Vietnam' + }, + 1969: {'Republic of Vietnam', 'Vietnam' + }, + 1970: {'Republic of Vietnam', 'Vietnam' + }, + 1971: {'Republic of Vietnam', 'Vietnam' + }, + 1972: {'Republic of Vietnam', 'Vietnam' + }, + 1973: {'Republic of Vietnam', 'Vietnam' + }, + 1974: {'Republic of Vietnam', 'Vietnam' + }, + 1975: {'Republic of Vietnam', 'Vietnam' + }, + 1976: {'Republic of Vietnam', 'Vietnam' + }, + 1977: {'Republic of Vietnam', 'Vietnam' + }, + 1978: {'Republic of Vietnam', 'Vietnam' + }, + 1979: {'Republic of Vietnam', 'Vietnam' + }, + 1980: {'Republic of Vietnam', 'Vietnam' + }, + 1981: {'Republic of Vietnam', 'Vietnam' + }, + 1982: {'Republic of Vietnam', 'Vietnam' + }, + 1983: {'Republic of Vietnam', 'Vietnam' + }, + 1984: {'Republic of Vietnam', 'Vietnam' + }, + 1985: {'Republic of Vietnam', 'Vietnam' + }, + 1986: {'Republic of Vietnam', 'Vietnam' + }, + 1987: {'Republic of Vietnam', 'Vietnam' + }, + 1988: {'Republic of Vietnam', 'Vietnam' + }, + 1989: {'Republic of Vietnam', 'Vietnam' + }, + 1990: {'Republic of Vietnam', 'Vietnam' + }, + 1991: {'Republic of Vietnam', 'Vietnam' + }, + 1992: {'Republic of Vietnam', 'Vietnam' + }, + 1993: {'Republic of Vietnam', 'Vietnam' + }, + 1994: {'Republic of Vietnam', 'Vietnam' + }, + 1995: {'Republic of Vietnam', 'Vietnam' + }, + 1996: {'Republic of Vietnam', 'Vietnam' + }, + 1997: {'Republic of Vietnam', 'Vietnam' + }, + 1998: {'Republic of Vietnam', 'Vietnam' + }, + 1999: {'Republic of Vietnam', 'Vietnam' + }, + 2000: {'Republic of Vietnam', 'Vietnam' + }, + 2001: {'Republic of Vietnam', 'Vietnam' + }, + 2002: {'Republic of Vietnam', 'Vietnam' + }, + 2003: {'Republic of Vietnam', 'Vietnam' + }, + 2004: {'Republic of Vietnam', 'Vietnam' + }, + 2005: {'Republic of Vietnam', 'Vietnam' + }, + 2006: {'Republic of Vietnam', 'Vietnam' + }, + 2007: {'Republic of Vietnam', 'Vietnam' + }, + 2008: {'Republic of Vietnam', 'Vietnam' + }, + 2009: {'Republic of Vietnam', 'Vietnam' + }, + 2010: {'Republic of Vietnam', 'Vietnam' + }, + 2011: {'Republic of Vietnam', 'Vietnam' + }, + 2012: {'Republic of Vietnam', 'Vietnam' + }, + 2013: {'Republic of Vietnam', 'Vietnam' + }, + 2014: {'Republic of Vietnam', 'Vietnam' + }, + 2015: {'Republic of Vietnam', 'Vietnam' + }, + 2016: {'Republic of Vietnam', 'Vietnam' + }, + 2017: {'Republic of Vietnam', 'Vietnam' + }, + 2018: {'Republic of Vietnam', 'Vietnam' + }, + 2019: {'Republic of Vietnam', 'Vietnam' + }, + 2020: {'Republic of Vietnam', 'Vietnam' + }, + 2021: {'Republic of Vietnam', 'Vietnam' + }, + 2022: {'Republic of Vietnam', 'Vietnam' + }, + 2023: {'Republic of Vietnam', 'Vietnam' + } + } +] diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json new file mode 100644 index 00000000000..cb8944dbf1c --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json @@ -0,0 +1,202 @@ +{ + "Afghanistan": "Afghanistan", + "Albania": "Albania", + "Algeria": "Algeria", + "Angola": "Angola", + "Argentina": "Argentina", + "Armenia": "Armenia", + "Australia": "Australia", + "Austria": "Austria", + "Azerbaijan": "Azerbaijan", + "Baden": "Grand Duchy of Baden", + "Bahrain": "Bahrain", + "Bangladesh": "Bangladesh", + "Barbados": "Barbados", + "Bavaria": "Kingdom of Bavaria", + "Belarus": "Belarus", + "Belgium": "Belgium", + "Benin": "Benin", + "Bhutan": "Bhutan", + "Bolivia": "Bolivia", + "Bosnia and Herzegovina": "Bosnia and Herzegovina", + "Botswana": "Botswana", + "Brazil": "Brazil", + "Bulgaria": "Bulgaria", + "Burkina Faso": "Burkina Faso", + "Burundi": "Burundi", + "Cambodia": "Cambodia", + "Cameroon": "Cameroon", + "Canada": "Canada", + "Cape Verde": "Cape Verde", + "Central African Republic": "Central African Republic", + "Chad": "Chad", + "Chile": "Chile", + "China": "China", + "Colombia": "Colombia", + "Comoros": "Comoros", + "Costa Rica": "Costa Rica", + "Croatia": "Croatia", + "Cuba": "Cuba", + "Cyprus": "Cyprus", + "Czechia": "Czechia", + "Democratic Republic of the Congo": "Democratic Republic of Congo", + "Denmark": "Denmark", + "Djibouti": "Djibouti", + "Dominican Republic": "Dominican Republic", + "Ecuador": "Ecuador", + "Egypt": "Egypt", + "El Salvador": "El Salvador", + "Equatorial Guinea": "Equatorial Guinea", + "Eritrea": "Eritrea", + "Estonia": "Estonia", + "Eswatini": "Eswatini", + "Ethiopia": "Ethiopia", + "Fiji": "Fiji", + "Finland": "Finland", + "France": "France", + "Gabon": "Gabon", + "Georgia": "Georgia", + "German Democratic Republic": "East Germany", + "Germany": "Germany", + "Ghana": "Ghana", + "Greece": "Greece", + "Guatemala": "Guatemala", + "Guinea": "Guinea", + "Guinea-Bissau": "Guinea-Bissau", + "Guyana": "Guyana", + "Haiti": "Haiti", + "Honduras": "Honduras", + "Hong Kong": "Hong Kong", + "Hungary": "Hungary", + "Iceland": "Iceland", + "India": "India", + "Indonesia": "Indonesia", + "Iran": "Iran", + "Iraq": "Iraq", + "Ireland": "Ireland", + "Israel": "Israel", + "Italy": "Italy", + "Ivory Coast": "Cote d'Ivoire", + "Jamaica": "Jamaica", + "Japan": "Japan", + "Jordan": "Jordan", + "Kazakhstan": "Kazakhstan", + "Kenya": "Kenya", + "Kosovo": "Kosovo", + "Kuwait": "Kuwait", + "Kyrgyzstan": "Kyrgyzstan", + "Laos": "Laos", + "Latvia": "Latvia", + "Lebanon": "Lebanon", + "Lesotho": "Lesotho", + "Liberia": "Liberia", + "Libya": "Libya", + "Lithuania": "Lithuania", + "Luxembourg": "Luxembourg", + "Madagascar": "Madagascar", + "Malawi": "Malawi", + "Malaysia": "Malaysia", + "Maldives": "Maldives", + "Mali": "Mali", + "Malta": "Malta", + "Mauritania": "Mauritania", + "Mauritius": "Mauritius", + "Mexico": "Mexico", + "Moldova": "Moldova", + "Mongolia": "Mongolia", + "Montenegro": "Montenegro", + "Morocco": "Morocco", + "Mozambique": "Mozambique", + "Namibia": "Namibia", + "Nepal": "Nepal", + "Netherlands": "Netherlands", + "New Zealand": "New Zealand", + "Nicaragua": "Nicaragua", + "Niger": "Niger", + "Nigeria": "Nigeria", + "North Korea": "North Korea", + "North Macedonia": "North Macedonia", + "Norway": "Norway", + "Oman": "Oman", + "Pakistan": "Pakistan", + "Panama": "Panama", + "Papua New Guinea": "Papua New Guinea", + "Paraguay": "Paraguay", + "Parma": "Duchy of Parma and Piacenza", + "Peru": "Peru", + "Philippines": "Philippines", + "Poland": "Poland", + "Portugal": "Portugal", + "Qatar": "Qatar", + "Republic of Vietnam": "Republic of Vietnam", + "Romania": "Romania", + "Russia": "Russia", + "Rwanda": "Rwanda", + "Sao Tome and Principe": "Sao Tome and Principe", + "Saudi Arabia": "Saudi Arabia", + "Senegal": "Senegal", + "Serbia": "Serbia", + "Seychelles": "Seychelles", + "Sierra Leone": "Sierra Leone", + "Singapore": "Singapore", + "Slovakia": "Slovakia", + "Slovenia": "Slovenia", + "Solomon Islands": "Solomon Islands", + "Somalia": "Somalia", + "Somaliland": "Somaliland", + "South Africa": "South Africa", + "South Korea": "South Korea", + "South Sudan": "South Sudan", + "South Yemen": "Yemen People's Republic", + "Spain": "Spain", + "Sri Lanka": "Sri Lanka", + "Sudan": "Sudan", + "Suriname": "Suriname", + "Sweden": "Sweden", + "Switzerland": "Switzerland", + "Syria": "Syria", + "Taiwan": "Taiwan", + "Tajikistan": "Tajikistan", + "Tanzania": "Tanzania", + "Thailand": "Thailand", + "Timor-Leste": "East Timor", + "Togo": "Togo", + "Trinidad and Tobago": "Trinidad and Tobago", + "Tunisia": "Tunisia", + "Turkmenistan": "Turkmenistan", + "Tuscany": "Tuscany", + "Two Sicilies": "Two Sicilies", + "Uganda": "Uganda", + "Ukraine": "Ukraine", + "United Arab Emirates": "United Arab Emirates", + "United Kingdom": "United Kingdom", + "United States of America": "United States", + "Uruguay": "Uruguay", + "Uzbekistan": "Uzbekistan", + "Vanuatu": "Vanuatu", + "Venezuela": "Venezuela", + "Vietnam": "Vietnam", + "Yemen": "Yemen", + "Zambia": "Zambia", + "Zanzibar": "Zanzibar", + "Zimbabwe": "Zimbabwe", + "Brunswick": "Brunswick", + "Burma/Myanmar": "Myanmar", + "Hamburg": "Hamburg", + "Hanover": "Hanover", + "Hesse-Darmstadt": "Hesse Grand Ducal", + "Hesse-Kassel": "Hesse Electoral", + "Mecklenburg Schwerin": "Mecklenburg Schwerin", + "Nassau": "Duchy of Nassau", + "Oldenburg": "Oldenburg", + "Palestine/British Mandate": "Palestine", + "Papal States": "Vatican", + "Republic of the Congo": "Congo", + "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", + "The Gambia": "Gambia", + "T\u00fcrkiye": "Turkey", + "W\u00fcrtemberg": "Wurttemberg", + "Piedmont-Sardinia": "Piedmont-Sardinia", + "Saxony": "Saxony", + "Modena": "Modena" +} diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json new file mode 100644 index 00000000000..0d4f101c7a3 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json @@ -0,0 +1,2 @@ +[ +] diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml new file mode 100644 index 00000000000..fe1b0461e1c --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml @@ -0,0 +1,2200 @@ +definitions: + common: + presentation: + topic_tags: + - Democracy + description_processing: |- + We expand the years covered by V-Dem further: To expand the time coverage of today's countries and include more of the period when they were still non-sovereign territories, we identified the historical entity they were a part of and used that regime's data whenever available + + For example, V-Dem only provides regime data since Bangladesh's independence in 1971. There is, however, regime data for Pakistan and the colony of India, both of which the current territory of Bangladesh was a part. We, therefore, use the regime data of Pakistan for Bangladesh from 1947 to 1970, and the regime data of India from 1789 to 1946. We did so for all countries with a past or current population of more than one million. + auxiliary: + description_processing_row: |- + While RoW covers the years since 1900, we use V-Dem's historical data from 1789 to 1899 to expand the classification's coverage back in time. + + {definitions.common.description_processing} + +dataset: + title: V-Dem Country-Year (Full + Others) + update_period_days: 365 + +tables: + vdem: + title: V-Dem Country-Year (Full + Others) + description: |- + The Varieties of Democracy (V-Dem) project publishes data and research on democracy and human rights. + + It acknowledges that democracy can be characterized differently and measures electoral, liberal, participatory, deliberative, and egalitarian characterizations of democracy. + + The project relies on evaluations by around 3,500 country experts and supplementary work by its researchers to assess political institutions and the protection of rights. + + The project is managed by the V-Dem Institute, based at the University of Gothenburg in Sweden. + + This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. + variables: + regime_imputed_country: + title: 'Country name (imputed country)' + unit: '' + + histname: + title: 'Historical country name' + unit: '' + + # 2.1 V-Dem High-Level Democracy Indices + + ## 2.1.1 Electoral democracy index + electdem_vdem: + title: Electoral democracy index + description_short: |- + Best estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: &description_prod_electdem_vdem |- + Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? + Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate's approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_polyarchy` + unit: '' + display: + numDecimalPlaces: 3 + + electdem_vdem_low: + title: "{tables.vdem.variables.electdem_vdem.title} (lower bound)" + description_short: |- + Lower-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + electdem_vdem_high: + title: "{tables.vdem.variables.electdem_vdem.title} (upper bound)" + description_short: |- + Upper-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.1.2 Liberal democracy index + libdem_vdem: + title: Liberal democracy index + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. + description_from_producer: &description_prod_libdem_vdem |- + Question: To what extent is the ideal of liberal democracy achieved? + + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_libdem` + unit: '' + display: + numDecimalPlaces: 3 + + libdem_vdem_low: + title: "{tables.vdem.variables.libdem_vdem.title} (lower bound)" + description_short: |- + Lower-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. + description_from_producer: *description_prod_libdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + libdem_vdem_high: + title: "{tables.vdem.variables.libdem_vdem.title} (upper bound)" + description_short: |- + Upper-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. + description_from_producer: *description_prod_libdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + # 2.1.3 Participatory democracy index + participdem_vdem: + title: Extent of direct popular votes + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. + description_from_producer: &description_prod_participdem_vdem |- + Question: To what extent is the ideal of participatory democracy achieved? + + Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_partipdem` + unit: '' + display: + numDecimalPlaces: 3 + + participdem_vdem_low: + title: "{tables.vdem.variables.participdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_participdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + participdem_vdem_high: + title: "{tables.vdem.variables.participdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_participdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.1.4 Deliberative democracy index + delibdem_vdem: + title: Deliberative democracy index + description_short: + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. + description_from_producer: &description_prod_delibdem_vdem |- + Question: To what extent is the ideal of deliberative democracy achieved? + + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_delibdem` + unit: '' + display: + numDecimalPlaces: 3 + + delibdem_vdem_low: + title: "{tables.vdem.variables.delibdem_vdem.title} (lower bound)" + description_from_producer: *description_prod_delibdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + delibdem_vdem_high: + title: "{tables.vdem.variables.delibdem_vdem.title} (upper bound)" + description_from_producer: *description_prod_delibdem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.1.5 Egalitarian democracy index + egaldem_vdem: + title: Egalitarian democracy index + description_short: |- + Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. + description_from_producer: &description_prod_egaldem_vdem |- + Question: To what extent is the ideal of egalitarian democracy achieved? + + Clarification: + The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_egaldem` + unit: '' + display: + numDecimalPlaces: 3 + + egaldem_vdem_low: + title: "{tables.vdem.variables.egaldem_vdem.title} (lower bound)" + description_from_producer: *description_prod_egaldem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + egaldem_vdem_high: + title: "{tables.vdem.variables.egaldem_vdem.title} (upper bound)" + description_from_producer: *description_prod_egaldem_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.3 Freedom of Expression and Alternative Sources of Information index + freeexpr_vdem: + title: Freedom of Expression and Alternative Sources of Information index + description_short: |- + Best estimate of the extent to which people can discuss political matters at home and in the public sphere, the press and media are free and can present different political perspectives, and the freedom of academic and cultural expression. + description_from_producer: &description_prod_freexpr_vdem |- + Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? + + Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_freexp_altinf` + unit: '' + display: + numDecimalPlaces: 3 + + freeexpr_vdem_low: + title: "{tables.vdem.variables.freeexpr_vdem.title} (lower bound)" + description_from_producer: *description_prod_freexpr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + freeexpr_vdem_high: + title: "{tables.vdem.variables.freeexpr_vdem.title} (upper bound)" + description_from_producer: *description_prod_freexpr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.4 Freedom of association thick index + freeassoc_vdem: + title: Freedom of association thick index + description_short: |- + Best estimate of the extent to which parties, including opposition parties, are allowed to form and participate in elections, and the extent to which civil society organizations are allowed to form and operate freely. + description_from_producer: &description_prod_freeassoc_vdem |- + Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_frassoc_thick` + unit: '' + display: + numDecimalPlaces: 3 + + freeassoc_vdem_low: + title: "{tables.vdem.variables.freeassoc_vdem.title} (lower bound)" + description_from_producer: *description_prod_freeassoc_vdem + unit: '' + display: + numDecimalPlaces: 3 + + freeassoc_vdem_high: + title: "{tables.vdem.variables.freeassoc_vdem.title} (upper bound)" + description_from_producer: *description_prod_freeassoc_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.5 Share of population with suffrage + suffr_vdem: + title: Share of population with suffrage + description_short: |- + Share of adult citizens which have the legal right to vote in national elections. + description_from_producer: |- + Question: What share of adult citizens as defined by statute has the legal right to vote in national elections? + + Clarification: + This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or 'economic independence', estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. + + Indicator name: `v2x_suffr` + description_processing: |- + Converted ratio (0-1) into share (0-100%). + + {definitions.common.description_processing} + unit: '%' + display: + numDecimalPlaces: 3 + + ## 2.2.6 Clean elections index + electfreefair_vdem: + title: Clean elections index + description_short: |- + Best estimate of the extent to which registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence are absent, and the election management body is autonomous and has enough staff and resources. + description_from_producer: &description_prod_electfreefair_vdem |- + Question: To what extent are elections free and fair? + + Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_frefair` + unit: '' + display: + numDecimalPlaces: 3 + + electfreefair_vdem_low: + title: "{tables.vdem.variables.electfreefair_vdem.title} (lower bound)" + description_from_producer: *description_prod_electfreefair_vdem + unit: '' + display: + numDecimalPlaces: 3 + + electfreefair_vdem_high: + title: "{tables.vdem.variables.electfreefair_vdem.title} (upper bound)" + description_from_producer: *description_prod_electfreefair_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.7 Elected officials index + electoff_vdem: + title: Elected officials index + description_short: |- + Measures the extent to which the legislature is chosen through broad elections, and the chief executive is elected directly or indirectly (appointed by a popularly elected legislature). + description_from_producer: |- + Question: Is the chief executive and legislature appointed through popular elections? + + Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. + + Indicator name: `v2x_elecoff` + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.8 Liberal component index + lib_vdem: + title: Liberal component index + description_short: |- + Best estimate of the extent of individual and minority rights, equality before the law, and executive constraints. + description_from_producer: &description_prod_lib_vdem |- + Question: To what extent is the liberal principle of democracy achieved? + + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_liberal` + unit: '' + display: + numDecimalPlaces: 3 + + lib_vdem_low: + title: "{tables.vdem.variables.lib_vdem.title} (lower bound)" + description_from_producer: *description_prod_lib_vdem + unit: '' + display: + numDecimalPlaces: 3 + + lib_vdem_high: + title: "{tables.vdem.variables.lib_vdem.title} (upper bound)" + description_from_producer: *description_prod_lib_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.9 Equality before the law and individual liberty index + indiv_libs_vdem: + title: Equality before the law and individual liberty index + description_short: |- + Best estimate of the extent to which extent to which citizens enjoy physical integrity rights, freedoms of religion, of movement, and from forced labor, as well as access to justice, laws are transparent and public administration is impartial. + description_from_producer: &description_prod_indiv_libs_vdem |- + Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xcl_rol` + unit: '' + display: + numDecimalPlaces: 3 + + indiv_libs_vdem_low: + title: "{tables.vdem.variables.indiv_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_indiv_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + indiv_libs_vdem_high: + title: "{tables.vdem.variables.indiv_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_indiv_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.10 Judicial constraints on the executive index + judicial_constr_vdem: + title: "Judicial constraints on the executive index" + description_short: |- + Best estimate of the extent to which the executive respects the constitution, complies with the judiciary and high courts, and higher and lower courts are independent. + description_from_producer: &description_prod_judicial_constr_vdem |- + Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_jucon` + unit: '' + display: + numDecimalPlaces: 3 + + judicial_constr_vdem_low: + title: "{tables.vdem.variables.judicial_constr_vdem.title} (upper bound)" + description_from_producer: *description_prod_judicial_constr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + judicial_constr_vdem_high: + title: "{tables.vdem.variables.judicial_constr_vdem.title} (lower bound)" + description_from_producer: *description_prod_judicial_constr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.11 Legislative constraints on the executive index + legis_constr_vdem: + title: Legislative constraints on the executive index + description_short: |- + Best estimate of the extent to which the legislature, including opposition parties, questions executive officials and oversees and investigates the executive. + description_from_producer: &description_prod_legis_constr_vdem |- + Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? + + Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xlg_legcon` + unit: '' + display: + numDecimalPlaces: 3 + + legis_constr_vdem_low: + title: "{tables.vdem.variables.legis_constr_vdem.title} (lower bound)" + description_from_producer: *description_prod_legis_constr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + legis_constr_vdem_high: + title: "{tables.vdem.variables.legis_constr_vdem.title} (upper bound)" + description_from_producer: *description_prod_legis_constr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.12 Participatory component index + particip_vdem: + title: Participatory political institutions + description_short: |- + Best estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. + description_from_producer: &description_prod_particip_vdem |- + Question: To what extent is the participatory principle achieved? + + Clarification: + The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_partip` + unit: '' + display: + numDecimalPlaces: 3 + + particip_vdem_low: + title: "{tables.vdem.variables.particip_vdem.title} (lower bound)" + description_from_producer: *description_prod_particip_vdem + unit: '' + display: + numDecimalPlaces: 3 + + particip_vdem_high: + title: "{tables.vdem.variables.particip_vdem.title} (upper bound)" + description_from_producer: *description_prod_particip_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.13 Civil society participation index + civsoc_particip_vdem: + title: Civil society participation index + description_short: |- + Best estimate of the extent to which major civil society organization are routinely consulted by policymakers, how many people are involved in them, women can participate, and candidate nomination for the legislature within parties is decentralized or made through primaries. + description_from_producer: &description_prod_civsoc_particip_vdem |- + Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? + + Clarification: + The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + + Scale: + Interval, from low to high (0-1). + + Indicator name: `v2x_cspart` + unit: '' + display: + numDecimalPlaces: 3 + + civsoc_particip_vdem_low: + title: "{tables.vdem.variables.civsoc_particip_vdem.title} (lower bound)" + description_from_producer: *description_prod_civsoc_particip_vdem + unit: '' + display: + numDecimalPlaces: 3 + + civsoc_particip_vdem_high: + title: "{tables.vdem.variables.civsoc_particip_vdem.title} (upper bound)" + description_from_producer: *description_prod_civsoc_particip_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.14 Direct popular vote index + dirpop_vote_vdem: + title: Direct popular vote index + description_short: |- + Measures the extent of how easy it is for citizens to vote on specific issues themselves in popular initiatives, referendums, and plebiscites. + description_from_producer: |- + Question: To what extent is the direct popular vote utilized? + + Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xdd_dd` + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.15 Local government index + locelect_vdem: + title: "Elected local governments" + description_short: |- + Best estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. + description_from_producer: &description_prod_locelect_vdem |- + Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? + + Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_locelec` + unit: '' + display: + numDecimalPlaces: 3 + + locelect_vdem_low: + title: "{tables.vdem.variables.locelect_vdem.title} (lower bound)" + description_from_producer: *description_prod_locelect_vdem + unit: '' + display: + numDecimalPlaces: 3 + + locelect_vdem_high: + title: "{tables.vdem.variables.locelect_vdem.title} (upper bound)" + description_from_producer: *description_prod_locelect_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.16 Regional government index + regelect_vdem: + title: Elected regional governments + description_short: |- + Best estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. + description_from_producer: &description_prod_regelect_vdem |- + Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? + + Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_regelec` + unit: '' + display: + numDecimalPlaces: 3 + + regelect_vdem_low: + title: "{tables.vdem.variables.regelect_vdem.title} (lower bound)" + description_from_producer: *description_prod_regelect_vdem + unit: '' + display: + numDecimalPlaces: 3 + + regelect_vdem_high: + title: "{tables.vdem.variables.regelect_vdem.title} (upper bound)" + description_from_producer: *description_prod_regelect_vdem + unit: '' + display: + numDecimalPlaces: 3 + + # 2.2.17 Deliberative component index + delib_vdem: + title: Deliberative political institutions index + description_short: |- + Best estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. + description_from_producer: &description_prod_delib_vdem |- + Question: To what extent is the deliberative principle of democracy achieved? + + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. + + To measure these features of a polity we try to determine the extent to which political elites give public justifications for their positions on matters of public policy, justify their positions in terms of the public good, acknowledge and respect counter-arguments; and how wide the range of consultation is at elite levels. + + Scale: + Interval, from low to high (0-1). + + Indicator name: `v2xdl_delib` + unit: '' + display: + numDecimalPlaces: 3 + + delib_vdem_low: + title: "{tables.vdem.variables.delib_vdem.title} (lower bound)" + description_from_producer: *description_prod_delib_vdem + unit: '' + display: + numDecimalPlaces: 3 + + delib_vdem_high: + title: "{tables.vdem.variables.delib_vdem.title} (upper bound)" + description_from_producer: *description_prod_delib_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.18 Egalitarian component index + egal_vdem: + title: Egalitarian political institutions index + description_short: |- + Best estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. + description_from_producer: &description_prod_egal_vdem |- + Question: To what extent is the egalitarian principle achieved? + + Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_egal` + unit: '' + display: + numDecimalPlaces: 3 + + egal_vdem_low: + title: "{tables.vdem.variables.egal_vdem.title} (lower bound)" + description_from_producer: *description_prod_egal_vdem + unit: '' + display: + numDecimalPlaces: 3 + + egal_vdem_high: + title: "{tables.vdem.variables.egal_vdem.title} (upper bound)" + description_from_producer: *description_prod_egal_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.19 Equal protection index + equal_rights_vdem: + title: Equal rights protection index + description_short: |- + Best estimate of the extent to which the state protects the rights and freedoms across social groups equally. + description_from_producer: &description_prod_equal_rights_vdem |- + Question: How equal is the protection of rights and freedoms across social groups by the state? + + Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqprotec` + unit: '' + display: + numDecimalPlaces: 3 + + equal_rights_vdem_low: + title: "{tables.vdem.variables.equal_rights_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_rights_vdem + unit: '' + display: + numDecimalPlaces: 3 + + equal_rights_vdem_high: + title: "{tables.vdem.variables.equal_rights_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_rights_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.20 Equal access index + equal_access_vdem: + title: Equal access to power index + description_short: |- + Best estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. + description_from_producer: &description_prod_equal_access_vdem |- + Question: How equal is access to power? + + Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqaccess` + unit: '' + display: + numDecimalPlaces: 3 + + equal_access_vdem_low: + title: "{tables.vdem.variables.equal_access_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_access_vdem + unit: '' + display: + numDecimalPlaces: 3 + + equal_access_vdem_high: + title: "{tables.vdem.variables.equal_access_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_access_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 2.2.21 Equal distribution of resources index + equal_res_vdem: + title: Equal resource distribution index + description_short: |- + Best estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. + description_from_producer: &description_prod_equal_res_vdem |- + Question: How equal is the distribution of resources? + + Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xeg_eqdr` + unit: '' + display: + numDecimalPlaces: 3 + + equal_res_vdem_low: + title: "{tables.vdem.variables.equal_res_vdem.title} (lower bound)" + description_from_producer: *description_prod_equal_res_vdem + unit: '' + display: + numDecimalPlaces: 3 + + equal_res_vdem_high: + title: "{tables.vdem.variables.equal_res_vdem.title} (upper bound)" + description_from_producer: *description_prod_equal_res_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.1.3.3 Election turnout + turnout_vdem: + title: Voter turnout + description_short: |- + Denotes the voter turnout as a share of all registered voters in the national election according to official results. + + description_from_producer: |- + Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? + + Indicator name: `v2eltrnout` + unit: '%' + display: + numDecimalPlaces: 2 + + # 3.4.2.18 HOS female + wom_hos_vdem: # wom_hos_vdem_owid + title: Woman head of state + description_short: |- + Denotes whether the head of state in office on December 31 is a woman. + description_from_producer: |- + If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + + Indicator name: `v2exfemhos` + unit: '' + display: + numDecimalPlaces: 0 + + ## 3.4.3.16 HOG female + wom_hog_vdem: # wom_hog_vdem_owid + title: Woman head of government + description_short: |- + Denotes whether the head of government in office on December 31 is a woman. + description_from_producer: |- + Question: What is the gender of the head of government? + + Clarification: If the head of government is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + + Responses: + 0: Male + 1: Female + + Indicator name: `v2exfemhog` + unit: '' + display: + numDecimalPlaces: 0 + + ## 3.5.1.6 Legislature corrupt activities + corr_leg_vdem: + title: Legislative corruption + description_from_producer: &description_prod_corr_leg_vdem |- + Question: Do members of the legislature abuse their position for financial gain? + + Clarification: + This includes any of the following: (a) accepting bribes, (b) helping to obtain government contracts for firms that the legislator (or his/her family/friends/political supporters) own, (c) doing favors for firms in exchange for the opportunity of employment after leaving the legislature, (d) stealing money from the state or from campaign donations for personal use. + + Please make your best estimate, based upon what is known or suspected to be true. + + For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. + + Responses: + 0: Commonly. Most legislators probably engage in these activities. + 1: Often. Many legislators probably engage in these activities. + 2: Sometimes. Some legislators probably engage in these activities. + 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. + 4: Never, or hardly ever. + + Indicator name: `v2lgcrrpt` + unit: '' + display: + numDecimalPlaces: 3 + + corr_leg_vdem_low: + title: "{tables.vdem.variables.corr_leg_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_leg_vdem + unit: '' + display: + numDecimalPlaces: 3 + + corr_leg_vdem_high: + title: "{tables.vdem.variables.corr_leg_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_leg_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.5.3.7 Lower chamber female legislators + wom_parl_vdem: + title: Lower chamber female legislators + description_short: |- + Percentage of women in the lower or single chamber of the legislature. + description_from_producer: |- + Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? + + Indicator name: `v2lgfemleg` + unit: '%' + display: + numDecimalPlaces: 3 + + ## 3.6.0.1 Reasoned justification + justified_polch_vdem: + title: Justified political positions + description_short: |- + Best estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. + description_from_producer: &description_prod_justified_polch_vdem |- + Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + + 0: No justification. Elites almost always only dictate that something should or should not be done, but no reasoning about justification is given. For example, "We must cut spending." + 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] + 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." + 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." + + Indicator name: `v2dlreason` + unit: '' + display: + numDecimalPlaces: 3 + + justified_polch_vdem_low: + title: "{tables.vdem.variables.justified_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_justified_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + justified_polch_vdem_high: + title: "{tables.vdem.variables.justified_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_justified_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.6.0.2 Common good + justcomgd_polch_vdem: + title: Common good justifications + description_short: |- + Best estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. + description_from_producer: &description_prod_justcomgd_polch_vdem |- + Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + 0: Little or no justification in terms of the common good is usually offered. + 1: Specific business, geographic, group, party, or constituency interests are for the most part offered as justifications. + 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. + 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. + 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. + + Indicator name: `v2dlcommon` + unit: '' + display: + numDecimalPlaces: 3 + + justcomgd_polch_vdem_low: + title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_justcomgd_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + justcomgd_polch_vdem_high: + title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_justcomgd_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.6.0.3 Respect counterarguments + counterarg_polch_vdem: + title: Respect for counterarguments + description_short: |- + Best estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. + description_from_producer: &description_prod_counterarg_polch_vdem |- + Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + 0: Counterarguments are not allowed or if articulated, punished. + 1: Counterarguments are allowed at least from some parties, but almost always are ignored. 2: Elites tend to acknowledge counterarguments but then explicitly degrade them by making a negative statement about them or the individuals and groups that propose them. + 3: Elites tend to acknowledge counterarguments without making explicit negative or positive statements about them. + 4: Elites almost always acknowledge counterarguments and explicitly value them, even if they ultimately reject them for the most part. + 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlcountr` + unit: '' + display: + numDecimalPlaces: 3 + + counterarg_polch_vdem_low: + title: "{tables.vdem.variables.counterarg_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_counterarg_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + counterarg_polch_vdem_high: + title: "{tables.vdem.variables.counterarg_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_counterarg_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ### 3.6.0.4 Range of consultation + elitecons_polch_vdem: + title: Elite consultation + description_short: |- + Best estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. + description_from_producer: &description_prod_elitecons_polch_vdem |- + Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? + + Clarification: Because practices vary greatly from policy to policy, base your answer on the style that is most typical of policymaking. + + Responses: + 0: No consultation. The leader or a very small group (e.g. military council) makes authoritative decisions on their own. + 1: Very little and narrow. Consultation with only a narrow circle of loyal party/ruling elites. 2: Consultation includes the former plus a larger group that is loyal to the government, such as the ruling party's or parties' local executives and/or women, youth and other branches. + 3: Consultation includes the former plus leaders of other parties. + 4: Consultation includes the former plus a select range of society/labor/business representatives. + 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlconslt` + unit: '' + display: + numDecimalPlaces: 3 + + elitecons_polch_vdem_low: + title: "{tables.vdem.variables.elitecons_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_elitecons_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + elitecons_polch_vdem_high: + title: "{tables.vdem.variables.elitecons_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_elitecons_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.6.0.5 Engaged society + soccons_polch_vdem: + title: Engaged society + description_short: |- + Best estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. + description_from_producer: &description_prod_soccons_polch_vdem |- + Question: When important policy changes are being considered, how wide and how independent are public deliberations? + + Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. + + Responses: + 0: Public deliberation is never, or almost never allowed. + 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. + 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. + 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. + 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. + 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlengage` + unit: '' + display: + numDecimalPlaces: 3 + + soccons_polch_vdem_low: + title: "{tables.vdem.variables.soccons_polch_vdem.title} (lower bound)" + description_from_producer: *description_prod_soccons_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + soccons_polch_vdem_high: + title: "{tables.vdem.variables.soccons_polch_vdem.title} (upper bound)" + description_from_producer: *description_prod_soccons_polch_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.7.0.6 Judicial corruption decision + corr_jud_vdem: + title: Judicial corruption + description_from_producer: &description_prod_corr_jud_vdem |- + Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? + + Responses: + 0: Always. + 1: Usually. + 2: About half of the time. 3: Not usually. + 4: Never. + + Scale: Ordinal, converted to interval by the measurement model. + + Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. + + Indicator name: `v2jucorrdc` + unit: '' + display: + numDecimalPlaces: 3 + + corr_jud_vdem_low: + title: "{tables.vdem.variables.corr_jud_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_jud_vdem + unit: '' + display: + numDecimalPlaces: 3 + + corr_jud_vdem_high: + title: "{tables.vdem.variables.corr_jud_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_jud_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.8.2.2 Rigorous and impartial public administration + public_admin_vdem: + title: Rigorous and impartial public administration + description_short: |- + Best estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. + description_from_producer: &description_prod_public_admin_vdem |- + Question: Are public officials rigorous and impartial in the performance of their duties? + + Clarification: + This question focuses on the extent to which public officials generally abide by the law and treat like cases alike, or conversely, the extent to which public administration is characterized by arbitrariness and biases (i.e., nepotism, cronyism, or discrimination). + + The question covers the public officials that handle the cases of ordinary people. If no functioning public administration exists, the lowest score (0) applies. + + Responses: + 0: The law is not respected by public officials. Arbitrary or biased administration of the law is rampant. + 1: The law is weakly respected by public officials. Arbitrary or biased administration of the law is widespread. + 2: The law is modestly respected by public officials. Arbitrary or biased administration of the law is moderate. + 3: The law is mostly respected by public officials. Arbitrary or biased administration of the law is limited. + 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clrspct` + unit: '' + display: + numDecimalPlaces: 3 + + public_admin_vdem_low: + title: "{tables.vdem.variables.public_admin_vdem.title} (lower bound)" + description_from_producer: *description_prod_public_admin_vdem + unit: '' + display: + numDecimalPlaces: 3 + + public_admin_vdem_high: + title: "{tables.vdem.variables.public_admin_vdem.title} (upper bound)" + description_from_producer: *description_prod_public_admin_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.8.2.6 Social group equality in respect for civil liberties + socgr_civ_libs_vdem: + title: Equality of civil liberties across social groups + description_short: |- + Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. + description_from_producer: &description_prod_socgr_civ_libs_vdem |- + Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? + + Clarification: Here, civil liberties are understood to include access to justice, private property rights, freedom of movement, and freedom from forced labor. + + Responses: + 0: Members of some social groups enjoy much fewer civil liberties than the general population. 1: Members of some social groups enjoy substantially fewer civil liberties than the general population. + 2: Members of some social groups enjoy moderately fewer civil liberties than the general population. + 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clsocgrp` + unit: '' + display: + numDecimalPlaces: 3 + + socgr_civ_libs_vdem_low: + title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_socgr_civ_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + socgr_civ_libs_vdem_high: + title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_socgr_civ_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.9.0.1 Domestic autonomy + dom_auton_vdem: + title: Domestic policymaking free from foreign influence + description_short: |- + Best estimate of the extent to which domestic policy is free from the interference of other states. + description_from_producer: &description_prod_dom_auton_vdem |- + Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? + + Clarification: The question of domestic autonomy does not include restrictions emanating from treaties (e.g., NATO), international organizations (e.g., the WTO), or confederations (e.g., the European Union) if these agreements are freely negotiated by the state and if the state is free to exit from that treaty, organization, or confederation. Nor does it include restrictions on policymaking emanating from international market forces and trans-national corporations. + + Responses: + 0: Non-autonomous. National level authority is exercised by an external power, either by law or in practice. The most common examples of this are direct colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). It also includes situations in which domestic actors provide de jure cover for de facto control by a foreign power (e.g. Vichy France). However, control of some part of the territory of a state by an enemy during war is not considered control by external actors if the sovereign government remains on scene and continues to wage conventional war (e.g., the USSR during WW II). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to rule, decides who can or cannot rule through formal rules or informal understandings, or precludes certain policies through explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples include Soviet "satellite" states in Eastern Europe, and situations where colonial powers grant limited powers of national self- government to their possessions (e.g., protectorates and limited home government). + 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2svdomaut` + unit: '' + display: + numDecimalPlaces: 3 + + dom_auton_vdem_low: + title: "{tables.vdem.variables.dom_auton_vdem.title} (lower bound)" + description_from_producer: *description_prod_dom_auton_vdem + unit: '' + display: + numDecimalPlaces: 3 + + dom_auton_vdem_high: + title: "{tables.vdem.variables.dom_auton_vdem.title} (upper bound)" + description_from_producer: *description_prod_dom_auton_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.9.0.2 International autonomy + int_auton_vdem: + title: Foreign policymaking free from foreign influence + description_short: |- + Best estimate of the extent to which foreign policy is free from the interference of other states. + description_from_producer: &description_prod_int_auton_vdem |- + Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? + + Responses: + 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). + 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. + + Indicator name: `v2svinlaut` + unit: '' + display: + numDecimalPlaces: 3 + + int_auton_vdem_low: + title: "{tables.vdem.variables.int_auton_vdem.title} (lower bound)" + description_from_producer: *description_prod_int_auton_vdem + unit: '' + display: + numDecimalPlaces: 3 + + int_auton_vdem_high: + title: "{tables.vdem.variables.int_auton_vdem.title} (upper bound)" + description_from_producer: *description_prod_int_auton_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.9.0.3 State authority over territory + terr_contr_vdem: + title: Territory under state control + description_short: |- + Best estimate of the percentage of territory controlled by the government. + description_from_producer: &description_prod_terr_contr_vdem |- + Question: Over what percentage (%) of the territory does the state have effective control? + + Clarification: + With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. + + By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. + + Indicator name: `v2svstterr` + unit: '%' + display: + numDecimalPlaces: 3 + + terr_contr_vdem_low: + title: "{tables.vdem.variables.terr_contr_vdem.title} (lower bound)" + description_from_producer: *description_prod_terr_contr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + terr_contr_vdem_high: + title: "{tables.vdem.variables.terr_contr_vdem.title} (upper bound)" + description_from_producer: *description_prod_terr_contr_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 3.12.0.2 Power distributed by social group + socgr_pow_vdem: + title: Equality of political power across social groups + description_short: |- + Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. + description_from_producer: &description_prod_socgr_pow_vdem |- + Question: Is political power distributed according to social groups? + + Clarification: A social group is differentiated within a country by caste, ethnicity, language, race, region, religion, or some combination thereof. (It does not include identities grounded in sexual orientation or socioeconomic status.) Social group identity is contextually defined and is likely to vary across countries and through time. Social group identities are also likely to cross-cut, so that a given person could be defined in multiple ways, i.e., as part of multiple groups. Nonetheless, at any given point in time there are social groups within a society that are understood — by those residing within that society — to be different, in ways that may be politically relevant. + + Responses: + 0: Political power is monopolized by one social group comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 1: Political power is monopolized by several social groups comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. + 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. + + Indicator name: `v2pepwrsoc` + unit: '' + display: + numDecimalPlaces: 3 + + socgr_pow_vdem_low: + title: "{tables.vdem.variables.socgr_pow_vdem.title} (lower bound)" + description_from_producer: *description_prod_socgr_pow_vdem + unit: '' + display: + numDecimalPlaces: 3 + + socgr_pow_vdem_high: + title: "{tables.vdem.variables.socgr_pow_vdem.title} (upper bound)" + description_from_producer: *description_prod_socgr_pow_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.4.3 Presidentialism Index + personalism_vdem: + title: Presidentialism Index + description_short: |- + Best estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. + description_from_producer: &description_prod_personalism_vdem |- + Question: To what extent is the regime characterized by presidentialism? + + Clarification: + Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem's index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xnp_pres` + unit: '' + display: + numDecimalPlaces: 3 + + personalism_vdem_low: + title: "{tables.vdem.variables.personalism_vdem.title} (lower bound)" + description_from_producer: *description_prod_personalism_vdem + unit: '' + display: + numDecimalPlaces: 3 + + personalism_vdem_high: + title: "{tables.vdem.variables.personalism_vdem.title} (upper bound)" + description_from_producer: *description_prod_personalism_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.5.1 Civil liberties index + civ_libs_vdem: + title: Civil liberties index + description_short: |- + Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. + description_from_producer: &description_prod_civ_libs_dem |- + Question: To what extent is civil liberty respected? + + Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_civlib` + unit: '' + display: + numDecimalPlaces: 3 + + civ_libs_vdem_low: + title: "{tables.vdem.variables.civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_civ_libs_dem + unit: '' + display: + numDecimalPlaces: 3 + + civ_libs_vdem_high: + title: "{tables.vdem.variables.civ_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_civ_libs_dem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.5.4 Private civil liberties index + priv_libs_vdem: + title: Private civil liberties index + description_short: |- + Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. + description_from_producer: &description_prod_priv_libs_vdem |- + Question: To what extent are private liberties respected? + + Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clpriv` + unit: '' + display: + numDecimalPlaces: 3 + + priv_libs_vdem_low: + title: "{tables.vdem.variables.priv_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_priv_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + priv_libs_vdem_high: + title: "{tables.vdem.variables.priv_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_priv_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.5.3 Political civil liberties index + pol_libs_vdem: + title: Political civil liberties index + description_short: |- + Central estimate of the extent to which people enjoy the freedoms of expression and association. + description_from_producer: &description_prod_pol_libs_vdem |- + Question: To what extent are political liberties respected? + + Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clpol` + unit: '' + display: + numDecimalPlaces: 3 + + pol_libs_vdem_low: + title: "{tables.vdem.variables.pol_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_pol_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + pol_libs_vdem_high: + title: "{tables.vdem.variables.pol_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_pol_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.5.2 Physical violence index + phys_integr_libs_vdem: + title: Physical integrity liberties + description_short: |- + Central estimate of the extent to which people are free from government torture and political killings. + description_from_producer: &description_prod_phys_integr_libs_vdem |- + Question: To what extent is physical integrity respected? + + Clarification: Physical integrity is understood as freedom from political killings and torture by the government. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect violence committed by government agents and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_clphy` + unit: '' + display: + numDecimalPlaces: 3 + + phys_integr_libs_vdem_low: + title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_phys_integr_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + phys_integr_libs_vdem_high: + title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_phys_integr_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.7.1 Political corruption index + corruption_vdem: + title: Political corruption index + description_short: |- + Best estimate of the extent to which a country is affected by political corruption. + description_from_producer: &description_prod_corruption_vdem |- + Question: How pervasive is political corruption? + + Clarification: The directionality of the V-Dem corruption index runs from less corrupt to more corrupt unlike the other V-Dem variables that generally run from less democratic to more democratic situation. The corruption index includes measures of six distinct types of corruption that cover both different areas and levels of the polity realm, distinguishing between executive, legislative and judicial corruption. Within the executive realm, the measures also distinguish between corruption mostly pertaining to bribery and corruption due to embezzlement. Finally, they differentiate between corruption in the highest echelons of the executive at the level of the rulers/cabinet on the one hand, and in the public sector at large on the other. The measures thus tap into several distinguished types of corruption: both 'petty' and 'grand'; both bribery and theft; both corruption aimed and influencing law making and that affecting implementation. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_corr` + unit: '' + display: + numDecimalPlaces: 3 + + corruption_vdem_low: + title: "{tables.vdem.variables.corruption_vdem.title} (lower bound)" + description_from_producer: *description_prod_corruption_vdem + unit: '' + display: + numDecimalPlaces: 3 + + corruption_vdem_high: + title: "{tables.vdem.variables.corruption_vdem.title} (upper bound)" + description_from_producer: *description_prod_corruption_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.7.3 Public sector corruption index [Not in use] + corr_publsec_vdem: + title: Public sector corruption index + description_from_producer: &description_prod_corr_publsec_vdem |- + Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? + + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_pubcorr` + unit: '' + display: + numDecimalPlaces: 3 + + corr_publsec_vdem_low: + title: "{tables.vdem.variables.corr_publsec_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_publsec_vdem + unit: '' + display: + numDecimalPlaces: 3 + + corr_publsec_vdem_high: + title: "{tables.vdem.variables.corr_publsec_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_publsec_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.7.2 Executive corruption index [Not in use] + corr_exec_vdem: + title: Executive corruption index + description_from_producer: &description_prod_corr_exec_vdem |- + Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? + + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_execorr` + unit: '' + display: + numDecimalPlaces: 3 + + corr_exec_vdem_low: + title: "{tables.vdem.variables.corr_exec_vdem.title} (lower bound)" + description_from_producer: *description_prod_corr_exec_vdem + unit: '' + display: + numDecimalPlaces: 3 + + corr_exec_vdem_high: + title: "{tables.vdem.variables.corr_exec_vdem.title} (upper bound)" + description_from_producer: *description_prod_corr_exec_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.8.1 Women political empowerment index + wom_emp_vdem: + title: Women's political empowerment index + description_short: |- + Best estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. + description_from_producer: &description_prod_wom_emp_vdem |- + Question: How politically empowered are women? + + Clarification: Women's political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women's open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gender` + unit: '' + display: + numDecimalPlaces: 3 + + wom_emp_vdem_low: + title: "{tables.vdem.variables.wom_emp_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_emp_vdem + unit: '' + display: + numDecimalPlaces: 3 + + wom_emp_vdem_high: + title: "{tables.vdem.variables.wom_emp_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_emp_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.8.2 Women civil liberties index + wom_civ_libs_vdem: + title: Women's civil rights index + description_short: |- + Best estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. + description_from_producer: &description_prod_wom_civ_libs_vdem |- + Question: Do women have the ability to make meaningful decisions in key areas of their lives? + + Clarification: Women's civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gencl` + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_libs_vdem_low: + title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_civ_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_libs_vdem_high: + title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_civ_libs_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.8.3 Women civil society participation index + wom_civ_soc_vdem: + title: Women's civil society participation index + description_short: |- + Best estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. + description_from_producer: &description_prod_wom_civ_soc_vdem |- + Question: Do women have the ability to express themselves and to form and participate in groups? + + Clarification: Women's civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gencs` + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_soc_vdem_low: + title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_civ_soc_vdem + unit: '' + display: + numDecimalPlaces: 3 + + wom_civ_soc_vdem_high: + title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_civ_soc_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.8.4 Women political participation index + wom_pol_par_vdem: + title: Women's political participation index + description_short: |- + Best estimate of the extent to which women are represented in the legislature and have an equal share of political power. + description_from_producer: &description_prod_wom_pol_par_vdem |- + Question: Are women descriptively represented in formal political positions? + + Clarification: Women's political participation is understood to include women's descriptive representation in the legislature and an equal share in the overall distribution of power. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_genpp` + unit: '' + display: + numDecimalPlaces: 3 + + wom_pol_par_vdem_low: + title: "{tables.vdem.variables.wom_pol_par_vdem.title} (lower bound)" + description_from_producer: *description_prod_wom_pol_par_vdem + unit: '' + display: + numDecimalPlaces: 3 + + wom_pol_par_vdem_high: + title: "{tables.vdem.variables.wom_pol_par_vdem.title} (upper bound)" + description_from_producer: *description_prod_wom_pol_par_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.9.1 Rule of law index + rule_of_law_vdem: + title: Rule of Law index + description_short: |- + Best estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. + description_from_producer: &description_prod_rule_of_law_vdem |- + Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_rule` + unit: '' + display: + numDecimalPlaces: 3 + + rule_of_law_vdem_low: + title: "{tables.vdem.variables.rule_of_law_vdem.title} (lower bound)" + description_from_producer: *description_prod_rule_of_law_vdem + unit: '' + display: + numDecimalPlaces: 3 + + rule_of_law_vdem_high: + title: "{tables.vdem.variables.rule_of_law_vdem.title} (upper bound)" + description_from_producer: *description_prod_rule_of_law_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 5.11.1 Core civil society index [not in use] + civ_soc_str_vdem: + title: Core civil society index + description_from_producer: &description_prod_civ_soc_str_vdem |- + Question: How robust is civil society? + + Clarification: The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xcs_ccsi` + unit: '' + display: + numDecimalPlaces: 3 + + civ_soc_str_vdem_low: + title: "{tables.vdem.variables.civ_soc_str_vdem.title} (lower bound)" + description_from_producer: *description_prod_civ_soc_str_vdem + unit: '' + display: + numDecimalPlaces: 3 + + civ_soc_str_vdem_high: + title: "{tables.vdem.variables.civ_soc_str_vdem.title} (upper bound)" + description_from_producer: *description_prod_civ_soc_str_vdem + unit: '' + display: + numDecimalPlaces: 3 + + ## 9.4.2 Government effectiveness + goveffective_vdem_wbgi: + title: Government effectiveness + description_short: |- + Denotes perceptions of the quality of public services, the civil service, and policy formulation and implementation (positive values mean higher effectiveness) based on the data from the World Governance Indicators. + + description_from_producer: |- + "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government's commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. + + Indicator name: `e_wbgi_gee` + unit: '' + display: + numDecimalPlaces: 3 + + ## 9.9.3 Corruption perception index [not in use] + corruption_cpi: + title: Corruption perceptions index + description_from_producer: |- + The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). + + Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty + electmulpar_row: + title: Multiparty elections (re-estimate) + description_short: |- + Best estimate of whether national multi-party elections were held or not. + description_from_producer: &description_prod_electmulpar_vdem |- + Question: Question: Was this national election multiparty? + + Responses: + 0: No. No-party or single-party and there is no meaningful competition (includes situations where a few parties are legal but they are all de facto controlled by the dominant party). + 1: Not really. No-party or single-party (defined as above) but multiple candidates from the same party and/or independents contest legislative seats or the presidency. + 2: Constrained. At least one real opposition party is allowed to contest but competition is highly constrained — legally or informally. + 3: Almost. Elections are multiparty in principle but either one main opposition party is prevented (de jure or de facto) from contesting, or conditions such as civil unrest (excluding natural disasters) prevent competition in a portion of the territory. + 4: Yes. Elections are multiparty, even though a few marginal parties may not be permitted to contest (e.g. far-right/left extremist parties, anti-democratic religious or ethnic parties). + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_electmulpar_row |- + We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_high_row: + title: "{tables.vdem.variables.electmulpar_row.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether national multi-party elections were held or not. + description_from_producer: *description_prod_electmulpar_vdem + description_processing: *description_processing_electmulpar_row + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_low_row: + title: "{tables.vdem.variables.electmulpar_row.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether national multi-party elections were held or not. + description_from_producer: *description_prod_electmulpar_vdem + description_processing: *description_processing_electmulpar_row + unit: '' + display: + numDecimalPlaces: 0 + + ## [CUSTOM] + electmulpar_hoe_row_owid: + title: Multi-party elections for government's chief executive + description_short: |- + + unit: '' + description_processing: &description_processing_electmulpar_hoe_row_owid |- + {definitions.auxiliary.description_processing_row} + + Finally, we make some additional minor changes to the coding rules. + + The two most consequential changes we make relate to RoW's identification of whether a country's chief executive is elected. First, one way RoW considers a chief executive to have been elected — even if they are not directly elected or appointed by the legislature — is if they are the head of state, they depend on the approval of the legislature, and there were multi-party elections for the executive. This last part is likely a coding error because to be consistent with RoW's other definitions, this should depend on multi-party legislative, not executive, elections. Only if the legislature has been chosen in multi-party elections does it make an otherwise unelected chief executive—who must be approved by that legislature—dependent on multi-party elections. We correct this error. + + Second, RoW considers a chief executive to have been elected if the country had chosen both its legislature and executive in multi-party elections. But this considers some chief executives as elected even if they came to power through force after elections were previously held. Examples include the coup d'états led by Fulgencio Batista in Cuba in 1952 and by Muhammadu Buhari in Nigeria in 1983. We instead consider such chief executives as unelected. + display: + numDecimalPlaces: 0 + + electmulpar_hoe_high_row_owid: + title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (upper bound)" + unit: '' + description_processing: *description_processing_electmulpar_hoe_row_owid + display: + numDecimalPlaces: 0 + + electmulpar_hoe_low_row_owid: + title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (lower bound)" + unit: '' + description_processing: *description_processing_electmulpar_hoe_row_owid + display: + numDecimalPlaces: 0 + + ## [CUSTOM, based on `v2elmulpar_osp`] + electmulpar_leg_row: + title: Multiparty elections for legislature + description_short: |- + Best estimate of whether multi-party elections for the national legislature were held or not. + description_processing: &description_proc_electmulpar_leg_row |- + Use the value from `v2elmulpar_osp` whenever `v2eltype` is 0, 1, 4 or 5. Otherwise the value is missing. + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_leg_high_row: + title: "{tables.vdem.variables.electmulpar_leg_row.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether multi-party elections for the national legislature were held or not. + description_processing: *description_proc_electmulpar_leg_row + unit: '' + display: + numDecimalPlaces: 0 + + electmulpar_leg_low_row: + title: "{tables.vdem.variables.electmulpar_leg_row.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether multi-party elections for the national legislature were held or not. + description_processing: *description_proc_electmulpar_leg_row + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index + electdem_dich_row_owid: + title: Electoral democracy (re-estimate) + description_short: |- + Best estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 0.5 to classify the original indicator (`v2x_polyarchy_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + electdem_dich_high_row_owid: + title: "{tables.vdem.variables.electdem_dich_row_owid.title} (upper bound)" + description_short: |- + Upper-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + unit: '' + display: + numDecimalPlaces: 0 + + electdem_dich_low_row_owid: + title: "{tables.vdem.variables.electdem_dich_row_owid.title} (lower bound)" + description_short: |- + Lower-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair + electfreefair_row: + title: Free and fair elections (re-estimate) + description_short: Best estimate of whether national elections were free and fair or not. + description_from_producer: &description_prod_electfreefair_row |- + Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? + + Clarification: The only thing that should not be considered in coding this is the extent of suffrage (by law). Thus, a free and fair election may occur even if the law excludes significant groups (an issue measured separately). + + Responses: + 0: No, not at all. The elections were fundamentally flawed and the official results had little if anything to do with the 'will of the people' (i.e., who became president; or who won the legislative majority). + 1: Not really. While the elections allowed for some competition, the irregularities in the end affected the outcome of the election (i.e., who became president; or who won the legislative majority). + 2: Ambiguous. There was substantial competition and freedom of participation but there were also significant irregularities. It is hard to determine whether the irregularities affected the outcome or not (as defined above). + 3: Yes, somewhat. There were deficiencies and some degree of fraud and irregularities but these did not in the end affect the outcome (as defined above). + 4: Yes. There was some amount of human error and logistical restrictions but these were largely unintentional and without significant consequences. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_electfreefair_row |- + We employ Lührmann et al.'s criteria and use a threshold of 2 to classify the original indicator (`v2elfrfair_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + electfreefair_high_row: + title: "{tables.vdem.variables.electfreefair_row.title} (upper bound)" + description_short: Upper-bound estimate of whether national elections were free and fair or not. + description_from_producer: *description_prod_electfreefair_row + description_processing: *description_processing_electfreefair_row + unit: '' + display: + numDecimalPlaces: 0 + + electfreefair_low_row: + title: "{tables.vdem.variables.electfreefair_row.title} (lower bound)" + description_short: Lower-bound estimate of whether national elections were free and fair or not. + description_from_producer: *description_prod_electfreefair_row + description_processing: *description_processing_electfreefair_row + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index + lib_dich_row: + title: Liberal political institutions (re-estimate) + description_short: Best estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: &description_processing_lib_dich_row |- + We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + lib_dich_high_row: + title: "{tables.vdem.variables.lib_dich_row.title} (upper bound)" + description_short: Upper-bound estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: *description_processing_lib_dich_row + unit: '' + display: + numDecimalPlaces: 0 + + lib_dich_low_row: + title: "{tables.vdem.variables.lib_dich_row.title} (lower bound)" + description_short: Lower-bound estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: *description_processing_lib_dich_row + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men + accessjust_m_row: + title: Access to justice for men (re-estimate) + description_short: Best estimate of whether men have access to justice or not. + description_from_producer: &description_prod_accessjust_m_row |- + Question: Do men enjoy secure and effective access to justice? + + Clarification: This question specifies the extent to which men can bring cases before the courts without risk to their personal safety, trials are fair, and men have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. + + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. + + Responses: + 0: Secure and effective access to justice for men is non-existent. + 1: Secure and effective access to justice for men is usually not established or widely respected. 2: Secure and effective access to justice for men is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for men is usually observed. + 4: Secure and effective access to justice for men is almost always observed. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_accessjust_m_row |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstm_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_m_high_row: + title: "{tables.vdem.variables.accessjust_m_row.title} (upper bound)" + description_short: Upper-bound estimate of whether men have access to justice or not. + description_from_producer: *description_prod_accessjust_m_row + description_processing: *description_processing_accessjust_m_row + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_m_low_row: + title: "{tables.vdem.variables.accessjust_m_row.title} (lower bound)" + description_short: Lower-bound estimate of whether men have access to justice or not. + description_from_producer: *description_prod_accessjust_m_row + description_processing: *description_processing_accessjust_m_row + unit: '' + display: + numDecimalPlaces: 0 + + # [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women + accessjust_w_row: + title: Access to justice for women (re-estimate) + description_short: Best estimate of whether women have access to justice or not. + description_from_producer: &description_prod_accessjust_w_row |- + Question: Do women enjoy equal, secure, and effective access to justice? + + Clarification: This question specifies the extent to which women can bring cases before the courts without risk to their personal safety, trials are fair, and women have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. + + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. + + Responses: + 0: Secure and effective access to justice for women is non-existent. + 1: Secure and effective access to justice for women is usually not established or widely respected. 2: Secure and effective access to justice for women is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for women is usually observed. + 4: Secure and effective access to justice for women is almost always observed. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_accessjust_w_row |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_w_high_row: + title: "{tables.vdem.variables.accessjust_w_row.title} (upper bound)" + description_short: Upper-bound estimate of whether women have access to justice or not. + description_from_producer: *description_prod_accessjust_w_row + description_processing: *description_processing_accessjust_w_row + unit: '' + display: + numDecimalPlaces: 0 + + accessjust_w_low_row: + title: "{tables.vdem.variables.accessjust_w_row.title} (lower bound)" + description_short: Lower-bound estimate of whether women have access to justice or not. + description_from_producer: *description_prod_accessjust_w_row + description_processing: *description_processing_accessjust_w_row + unit: '' + display: + numDecimalPlaces: 0 + + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement + transplaws_row: + title: Transparent laws with predictable enforcement (re-estimate) + description_short: |- + Best estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: &description_prod_transplaws |- + Question: Are the laws of the land clear, well publicized, coherent (consistent with each other), relatively stable from year to year, and enforced in a predictable manner? + + Clarification: This question focuses on the transparency and predictability of the laws of the land. + + Responses: + 0: Transparency and predictability are almost non-existent. The laws of the land are created and/or enforced in completely arbitrary fashion. + 1: Transparency and predictability are severely limited. The laws of the land are more often than not created and/or enforced in arbitrary fashion. + 2: Transparency and predictability are somewhat limited. The laws of the land are mostly created in a non-arbitrary fashion but enforcement is rather arbitrary in some parts of the country. + 3: Transparency and predictability are fairly strong. The laws of the land are usually created and enforced in a non-arbitrary fashion. + 4: Transparency and predictability are very strong. The laws of the land are created and enforced in a non-arbitrary fashion. + + Scale: Ordinal, converted to interval by the measurement model. + description_processing: &description_processing_transplaws |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2cltrnslw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + + transplaws_high_row: + title: "{tables.vdem.variables.transplaws_row.title} (upper bound)" + description_short: |- + Upper estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: *description_prod_transplaws + description_processing: *description_processing_transplaws + unit: '' + display: + numDecimalPlaces: 0 + + transplaws_low_row: + title: "{tables.vdem.variables.transplaws_row.title} (lower bound)" + description_short: |- + Lower estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. + description_from_producer: *description_prod_transplaws + description_processing: *description_processing_transplaws + unit: '' + display: + numDecimalPlaces: 0 + + ## HOE female (custom) + # NOTE: Add adjustment in citation_full + wom_hoe_vdem: # wom_hoe_vdem_owid + title: Woman head of executive + description_short: |- + The variable denotes whether the chief executive of government in office on December 31 is a woman. + description_processing: |- + Assigns the value based on the gender of the most powerful chief: either Head of state or Head of government. + + Uses gender from HOS: + - If head of state is more powerful than head of government, and head of state is the head of the executive. + - If head of state is also head of government. + - If head of government is less powerful than head of state. + + Uses HOG if: + - If head of state is less powerful than head of government + + We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. + unit: '' + display: + numDecimalPlaces: 0 + + ## Other regime indicators + regime_amb_row_owid: + title: Political regime (inc. ambiguous categories) + unit: '' + description_short: |- + Political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg, including ambiguous categories. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 3), electoral democracies (score 6), and liberal democracies (score 9) as the main types. + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). + description_processing: "{definitions.auxiliary.description_processing_row}" + display: + numDecimalPlaces: 0 + + regime_redux_row_owid: + title: Political regime + description_short: |- + Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 1), and electoral democracies (score 2, including liberal democracies). + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + description_processing: "{definitions.auxiliary.description_processing_row}" + unit: '' + display: + numDecimalPlaces: 0 + + # NEW + num_years_in_electdem_consecutive: # electdem_age_row_owid + title: Age of electoral democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_electdem + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + unit: years + + num_years_in_electdem: # electdem_exp_row_owid + title: Experience with electoral democracy + description_short: Number of total years in electoral democracy. It sums all periods of electoral democracy. + description_key: *description_key_num_electdem + unit: years + + num_years_in_electdem_cat: # electdem_age_group_row_owid + title: Electoral democracy age group + description_short: Category of electoral democracies based on the country's age of electoral democracy. + description_key: *description_key_num_electdem + unit: '' + + num_years_in_libdem_consecutive: # libdem_age_row_owid + title: Age of liberal democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_libdem + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + unit: years + + num_years_in_libdem: # libdem_exp_row_owid + title: Experience with liberal democracy + description_processing: Number of total years in liberal democracy. It sums all periods of liberal democracy. + description_key: *description_key_num_libdem + unit : years + + num_years_in_libdem_cat: # libdem_age_group_row_owid + title: Liberal democracy age group + description_short: Category of liberal democracies based on the country's age of liberal democracy. + description_processing: Number of consecutive years in liberal democracy. + description_key: *description_key_num_libdem + unit : '' + + wom_parl_vdem_cat: # wom_parl_gr_vdem_owid + title: Women in parliament (category) + description_short: Categorisation of women's political representation in parliament + unit: '' + + # Not used + regime_imputed: + title: Data imputed from another country + description_short: Denotes whether we imputed regime information from another country this one was historically a part of. + unit: '' + display: + numDecimalPlaces: 0 + + regime_row_owid: + title: regime_row_owid + unit: '' + display: + numDecimalPlaces: 0 From a873af61920c978259e5434a6449e22dabe6d2d3 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 1 Apr 2024 11:27:25 +0200 Subject: [PATCH 30/62] enhance: use former country names --- .../garden/democracy/2024-03-07/vdem/vdem.countries.json | 5 ++++- .../data/garden/democracy/2024-03-07/vdem/vdem_clean.py | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json index 7336203866c..c023f48e791 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -198,5 +198,8 @@ "Parma": "Parma", "Piedmont-Sardinia": "Piedmont-Sardinia", "Saxony": "Saxony", - "Modena": "Modena" + "Modena": "Modena", + "West Germany": "West Germany", + "Yemen Arab Republic": "Yemen Arab Republic", + "Democratic Republic of Vietnam": "Democratic Republic of Vietnam" } diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index a695d2c6511..c297d716c68 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -80,6 +80,15 @@ def initial_cleaning(tb: Table) -> Table: tb = tb.loc[~((tb["country"] == "Italy") & (tb["year"] == 1861))] tb.loc[(tb["country"] == "Piedmont-Sardinia") & (tb["year"] == 1861), "country"] = "Italy" + # Assign historical names + tb["country"] = tb["country"].astype("string") + tb.loc[(tb["country"] == "Yemen") & (tb["year"] <= 1990) & (tb["year"] >= 1918), "country"] = "Yemen Arab Republic" + tb.loc[ + (tb["country"] == "Vietnam") & (tb["year"] <= 1975) & (tb["year"] >= 1945), "country" + ] = "Democratic Republic of Vietnam" + tb.loc[(tb["country"] == "Germany") & (tb["year"] <= 1990) & (tb["year"] >= 1949), "country"] = "West Germany" + tb["country"] = tb["country"].astype("category") + # Goemans et al.'s (2009) Archigos dataset, rulers.org, and worldstatesmen.org identify non-elected General Raoul Cédras as the de-facto leader of Haiti from 1991 until 1994. tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2exnamhos"] = "Raoul Cédras" tb.loc[(tb["country"] == "Haiti") & (tb["year"] >= 1991) & (tb["year"] <= 1993), "v2ex_hosw"] = 1 From d3d59744ebf47f8db29f0202dd3d5b7a2794c4e8 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 1 Apr 2024 11:28:13 +0200 Subject: [PATCH 31/62] wip: aggregate --- .../democracy/2024-03-08/vdem/__init__.py | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py index 4bc2bb6670f..53235dd7735 100644 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py @@ -2,7 +2,7 @@ from typing import cast import pandas as pd -from owid.catalog import Table +from owid.catalog import Dataset, Table from owid.catalog.processing import concat from etl.data_helpers import geo @@ -29,6 +29,8 @@ "South America": {}, "Europe": { "additional_members": [ + "Baden", + "Bavaria", "Brunswick", "Duchy of Nassau", "Hamburg", @@ -38,6 +40,7 @@ "Mecklenburg Schwerin", "Modena", "Oldenburg", + "Parma", "Piedmont-Sardinia", "Saxe-Weimar-Eisenach", "Saxony", @@ -66,9 +69,11 @@ def run(dest_dir: str) -> None: # # Process data. # - # %% Aggregate: mean and sum of countries + # %% Remove imputed countries tb_ = tb.loc[~tb["regime_imputed"]].copy() + tb_["country"] = tb_["country"].astype("string") + # %% Sanity check: all countries are in the regions members_tracked = set() for region, region_props in REGIONS.items(): @@ -77,20 +82,10 @@ def run(dest_dir: str) -> None: ) assert tb_["country"].isin(members_tracked).all(), "Some countries are not in the regions!" - # %% Dummies - tb_ = make_table_with_dummies(tb_) - - # %% Get aggregates - tb_ = geo.add_regions_to_table( - tb_, - ds_regions, - regions=REGIONS, - # accepted_overlaps=COUNTRIES_OVERLAP, - ) - # tb_ = tb_.loc[tb_["country"].isin(REGIONS.keys())] - - # tb_w = tb_.groupby("year", as_index=False).sum().assign(country="World") - # tb_ = concat([tb_, tb_w], ignore_index=True, short_name="region_counts") + # %% Get counts + # Generate dummy indicators + tb_sum = make_table_countries_counts(tb_, ds_regions) + tb_avg = make_table_countries_avg(tb_, ds_regions) # %% Set index tb = tb.format() @@ -108,7 +103,32 @@ def run(dest_dir: str) -> None: ds_garden.save() -# %% +def make_table_countries_counts(tb: Table, ds_regions: Dataset) -> Table: + """Get region indicators of type "Number of countries".""" + tb_ = tb.copy() + # Generate dummy indicators + tb_ = make_table_with_dummies(tb_) + + tb_ = geo.add_regions_to_table( + tb_, + ds_regions, + regions=REGIONS, + ) + # Keep only regions + tb_ = tb_.loc[tb_["country"].isin(REGIONS.keys())] + + # Get value for the World and add to table + tb_w = tb_.groupby("year", as_index=False).sum().assign(country="World") + tb_ = concat([tb_, tb_w], ignore_index=True, short_name="region_counts") + + return tb_ + + +def make_table_countries_avg(tb: Table, ds_regions: Dataset) -> Table: + tb_ = tb.copy() + return tb_ + + def make_table_with_dummies(tb: Table) -> Table: """Format table to have dummy indicators. From e871162b4e33d7c895472f8a71e21e1078c004e4 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 02:17:59 +0200 Subject: [PATCH 32/62] wip --- dag/democracy.yml | 4 - .../data/garden/democracy/2024-03-07/bmr.py | 122 +- .../garden/democracy/2024-03-07/shared.py | 114 + .../2024-03-07/{vdem => }/vdem.countries.json | 0 ...s_impute.yml => vdem.countries_impute.yml} | 0 .../{vdem => }/vdem.excluded_countries.json | 0 .../2024-03-07/{vdem => }/vdem.meta.yml | 2624 ++++++-------- .../2024-03-07/{vdem/__init__.py => vdem.py} | 78 +- .../democracy/2024-03-07/vdem_aggregate.py | 705 ++++ .../2024-03-07/{vdem => }/vdem_clean.py | 8 +- .../2024-03-07/{vdem => }/vdem_impute.py | 2 +- .../2024-03-07/{vdem => }/vdem_refine.py | 24 +- .../democracy/2024-03-08/vdem/__init__.py | 266 -- .../2024-03-08/vdem/countries_impute.yml | 618 ---- .../2024-03-08/vdem/debug.overlaps.json | 3069 ----------------- .../2024-03-08/vdem/vdem.countries.json | 202 -- .../vdem/vdem.excluded_countries.json | 2 - .../democracy/2024-03-08/vdem/vdem.meta.yml | 2200 ------------ .../data/grapher/democracy/2024-03-07/vdem.py | 10 +- 19 files changed, 1903 insertions(+), 8145 deletions(-) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/shared.py rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem.countries.json (100%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem/countries_impute.yml => vdem.countries_impute.yml} (100%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem.excluded_countries.json (100%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem.meta.yml (63%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem/__init__.py => vdem.py} (74%) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem_clean.py (99%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem_impute.py (98%) rename etl/steps/data/garden/democracy/2024-03-07/{vdem => }/vdem_refine.py (91%) delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json delete mode 100644 etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml diff --git a/dag/democracy.yml b/dag/democracy.yml index 680b81a2500..4335a0ac94b 100644 --- a/dag/democracy.yml +++ b/dag/democracy.yml @@ -16,9 +16,5 @@ steps: - data://meadow/democracy/2024-03-07/vdem - data://garden/regions/2023-01-01/regions - data://garden/demography/2023-03-31/population - data://garden/democracy/2024-03-08/vdem: - - data://garden/democracy/2024-03-07/vdem - - data://garden/regions/2023-01-01/regions - - data://garden/demography/2023-03-31/population data://grapher/democracy/2024-03-07/vdem: - data://garden/democracy/2024-03-07/vdem diff --git a/etl/steps/data/garden/democracy/2024-03-07/bmr.py b/etl/steps/data/garden/democracy/2024-03-07/bmr.py index 578cd9c96f8..d5fa2440247 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/bmr.py +++ b/etl/steps/data/garden/democracy/2024-03-07/bmr.py @@ -41,6 +41,7 @@ import yaml from owid.catalog import Dataset, Variable from owid.catalog.tables import Table, concat +from shared import add_population_in_dummies, expand_observations, from_wide_to_long from etl.data_helpers import geo from etl.helpers import PathFinder, create_dataset @@ -443,7 +444,28 @@ def make_tables_population_counters(tb: Table, ds_regions: Dataset, ds_populatio tb_ = make_table_with_dummies(tb_, ds_regions) # Add population in dummies (population value replaces 1, 0 otherwise) - tb_ = add_population_in_dummies(tb_, ds_population) + tb_ = add_population_in_dummies( + tb, + ds_population, + expected_countries_without_population=[ + "Pakistan (former)", + "Korea (former)", + "Duchy of Parma and Piacenza", + "Orange Free State", + "Federal Republic of Central America", + "Grand Duchy of Tuscany", + "Democratic Republic of Vietnam", + "Kingdom of Saxony", + "Duchy of Modena and Reggio", + "Kingdom of the Two Sicilies", + "Kingdom of Sardinia", + "Great Colombia", + "Grand Duchy of Baden", + "Kingdom of Wurttemberg", + "Republic of Vietnam", + "Kingdom of Bavaria", + ], + ) # Get region aggregates tb_ = geo.add_regions_to_table( @@ -569,42 +591,6 @@ def make_table_with_dummies( return tb_ -def from_wide_to_long(tb: Table) -> Table: - """Format a particular shape of table from wide to long format. - - The expected input table format is: - - | year | country | indicator_a_1 | indicator_a_2 | indicator_b_1 | indicator_b_2 | - |------|---------|---------------|---------------|---------------|---------------| - | 2000 | USA | 1 | 2 | 3 | 4 | - | 2000 | CAN | 5 | 6 | 7 | 8 | - - The generated output is: - - | year | country | category | indicator_a | indicator_b | - |------|---------|------------|-------------|-------------| - | 2000 | USA | category_1 | 1 | 3 | - | 2000 | USA | category_2 | 2 | 4 | - """ - # Melt the DataFrame to long format - tb = tb.melt(id_vars=["year", "country"], var_name="indicator_type", value_name="value") - - # Extract indicator names and types - tb["indicator"] = tb["indicator_type"].apply(lambda x: "_".join(x.split("_")[:-1])) - tb["category"] = tb["indicator_type"].apply(lambda x: x.split("_")[-1]) - - # Drop the original 'indicator_type' column as it's no longer needed - tb.drop("indicator_type", axis=1, inplace=True) - - # Pivot the table to get 'indicator_a' and 'indicator_b' as separate columns - tb = tb.pivot(index=["year", "country", "category"], columns="indicator", values="value").reset_index() - - # Rename the columns to match your requirements - tb.columns.name = None # Remove the hierarchy - - return tb - - def expand_observations_without_leading_to_duplicates(tb: Table, ds_regions: Dataset) -> Table: """Expand observations (accounting for overlaps between former and current countries). @@ -636,68 +622,6 @@ def expand_observations_without_leading_to_duplicates(tb: Table, ds_regions: Dat return tb -def expand_observations(tb: Table) -> Table: - """Expand to have a row per (year, country).""" - # Add missing years for each triplet ("warcode", "campcode", "ccode") - - # List of countries - regions = set(tb["country"]) - - # List of possible years - years = np.arange(tb["year"].min(), tb["year"].max() + 1) - - # New index - new_idx = pd.MultiIndex.from_product([years, regions], names=["year", "country"]) - - # Reset index - tb = tb.set_index(["year", "country"]).reindex(new_idx).reset_index() - - # Type of `year` - tb["year"] = tb["year"].astype("int") - return tb - - -def add_population_in_dummies(tb: Table, ds_population: Dataset): - # Add population column - tb = geo.add_population_to_table( - tb, - ds_population, - interpolate_missing_population=True, - expected_countries_without_population=[ - "Pakistan (former)", - "Korea (former)", - "Duchy of Parma and Piacenza", - "Orange Free State", - "Federal Republic of Central America", - "Grand Duchy of Tuscany", - "Democratic Republic of Vietnam", - "Kingdom of Saxony", - "Duchy of Modena and Reggio", - "Kingdom of the Two Sicilies", - "Kingdom of Sardinia", - "Great Colombia", - "Grand Duchy of Baden", - "Kingdom of Wurttemberg", - "Republic of Vietnam", - "Kingdom of Bavaria", - ], - ) - tb = cast(Table, tb.dropna(subset="population")) - # Add metadata (origins combined indicator+population) - cols = [col for col in tb.columns if col not in ["year", "country", "population"]] - meta = {col: tb[col].metadata for col in cols} | {"population": tb["population"].metadata} - ## Encode population in indicators: Population if 1, 0 otherwise - tb[cols] = tb[cols].multiply(tb["population"], axis=0) - tb = tb.drop(columns="population") - ## Add metadata back (combine origins from population) - for col in cols: - metadata = meta[col] - metadata.origins += meta["population"].origins - tb[col].metadata = meta[col] - - return tb - - def _get_countries_to_ignore_population(ds_regions: Dataset) -> Set[str]: """List of countries to ignore when working with population. diff --git a/etl/steps/data/garden/democracy/2024-03-07/shared.py b/etl/steps/data/garden/democracy/2024-03-07/shared.py new file mode 100644 index 00000000000..a031393d587 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/shared.py @@ -0,0 +1,114 @@ +from typing import Callable, List, Optional, cast + +import numpy as np +import pandas as pd +from owid.catalog import Dataset, Table + +from etl.data_helpers import geo + + +def from_wide_to_long( + tb: Table, + indicator_name_callback: Optional[Callable] = None, + indicator_category_callback: Optional[Callable] = None, + column_dimension_name: str = "category", +) -> Table: + """Format a particular shape of table from wide to long format. + + tb: Table with wide format. + indicator_name_callback: Function to extract the indicator name from the column name. + indicator_category_callback: Function to extract the indicator category from the column name. + + If no `indicator_name_callback` and `indicator_category_callback` are provided, it proceed expects the following input: + + | year | country | indicator_a_1 | indicator_a_2 | indicator_b_1 | indicator_b_2 | + |------|---------|---------------|---------------|---------------|---------------| + | 2000 | USA | 1 | 2 | 3 | 4 | + | 2000 | CAN | 5 | 6 | 7 | 8 | + + and then generates the output: + + | year | country | category | indicator_a | indicator_b | + |------|---------|------------|-------------|-------------| + | 2000 | USA | category_1 | 1 | 3 | + | 2000 | USA | category_2 | 2 | 4 | + """ + # Melt the DataFrame to long format + tb = tb.melt(id_vars=["year", "country"], var_name="indicator_type", value_name="value") + + # Get callables + if indicator_name_callback is None: + + def default_indicator_name(x): + return "_".join(x.split("_")[:-1]) + + indicator_name_callback = default_indicator_name + + if indicator_category_callback is None: + + def default_indicator_category(x): + return x.split("_")[-1] + + indicator_category_callback = default_indicator_category + + # Extract indicator names and types + tb["indicator"] = tb["indicator_type"].apply(indicator_name_callback) + tb[column_dimension_name] = tb["indicator_type"].apply(indicator_category_callback) + + # Drop the original 'indicator_type' column as it's no longer needed + tb.drop("indicator_type", axis=1, inplace=True) + + # Pivot the table to get 'indicator_a' and 'indicator_b' as separate columns + tb = tb.pivot(index=["year", "country", column_dimension_name], columns="indicator", values="value").reset_index() + + # Rename the columns to match your requirements + tb.columns.name = None # Remove the hierarchy + + return tb + + +def expand_observations(tb: Table) -> Table: + """Expand to have a row per (year, country).""" + # Add missing years for each triplet ("warcode", "campcode", "ccode") + + # List of countries + regions = set(tb["country"]) + + # List of possible years + years = np.arange(tb["year"].min(), tb["year"].max() + 1) + + # New index + new_idx = pd.MultiIndex.from_product([years, regions], names=["year", "country"]) + + # Reset index + tb = tb.set_index(["year", "country"]).reindex(new_idx).reset_index() + + # Type of `year` + tb["year"] = tb["year"].astype("int") + return tb + + +def add_population_in_dummies( + tb: Table, ds_population: Dataset, expected_countries_without_population: Optional[List[str]] = None +): + # Add population column + tb = geo.add_population_to_table( + tb, + ds_population, + interpolate_missing_population=True, + expected_countries_without_population=expected_countries_without_population, + ) + tb = cast(Table, tb.dropna(subset="population")) + # Add metadata (origins combined indicator+population) + cols = [col for col in tb.columns if col not in ["year", "country", "population"]] + meta = {col: tb[col].metadata for col in cols} | {"population": tb["population"].metadata} + ## Encode population in indicators: Population if 1, 0 otherwise + tb[cols] = tb[cols].multiply(tb["population"], axis=0) + tb = tb.drop(columns="population") + ## Add metadata back (combine origins from population) + for col in cols: + metadata = meta[col] + metadata.origins += meta["population"].origins + tb[col].metadata = meta[col] + + return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json rename to etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem.countries_impute.yml similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/countries_impute.yml rename to etl/steps/data/garden/democracy/2024-03-07/vdem.countries_impute.yml diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json rename to etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml similarity index 63% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml rename to etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml index fe1b0461e1c..8b10470e5c3 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml @@ -18,6 +18,10 @@ dataset: update_period_days: 365 tables: + + ################################################################################################## + ################################################################################################## + # UNI DIMENSIONAL INDICATORS vdem: title: V-Dem Country-Year (Full + Others) description: |- @@ -31,239 +35,107 @@ tables: This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. variables: - regime_imputed_country: - title: 'Country name (imputed country)' - unit: '' - - histname: - title: 'Historical country name' - unit: '' - - # 2.1 V-Dem High-Level Democracy Indices - - ## 2.1.1 Electoral democracy index - electdem_vdem: - title: Electoral democracy index - description_short: |- - Best estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: &description_prod_electdem_vdem |- - Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? - Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate's approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_polyarchy` - unit: '' - display: - numDecimalPlaces: 3 - - electdem_vdem_low: - title: "{tables.vdem.variables.electdem_vdem.title} (lower bound)" - description_short: |- - Lower-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 9.9.3 Corruption perception index [not in use] + corruption_cpi: + title: Corruption perceptions index + description_from_producer: |- + The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). - electdem_vdem_high: - title: "{tables.vdem.variables.electdem_vdem.title} (upper bound)" - description_short: |- - Upper-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem + Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 2.1.2 Liberal democracy index - libdem_vdem: - title: Liberal democracy index + ## 2.2.14 Direct popular vote index + dirpop_vote_vdem: + title: Direct popular vote index description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: &description_prod_libdem_vdem |- - Question: To what extent is the ideal of liberal democracy achieved? + Measures the extent of how easy it is for citizens to vote on specific issues themselves in popular initiatives, referendums, and plebiscites. + description_from_producer: |- + Question: To what extent is the direct popular vote utilized? - Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. + Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_libdem` - unit: '' - display: - numDecimalPlaces: 3 - - libdem_vdem_low: - title: "{tables.vdem.variables.libdem_vdem.title} (lower bound)" - description_short: |- - Lower-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: *description_prod_libdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - libdem_vdem_high: - title: "{tables.vdem.variables.libdem_vdem.title} (upper bound)" - description_short: |- - Upper-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: *description_prod_libdem_vdem + Indicator name: `v2xdd_dd` unit: '' display: numDecimalPlaces: 3 - # 2.1.3 Participatory democracy index - participdem_vdem: - title: Extent of direct popular votes + ## 2.2.7 Elected officials index + electoff_vdem: + title: Elected officials index description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. - description_from_producer: &description_prod_participdem_vdem |- - Question: To what extent is the ideal of participatory democracy achieved? - - Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_partipdem` - unit: '' - display: - numDecimalPlaces: 3 - - participdem_vdem_low: - title: "{tables.vdem.variables.participdem_vdem.title} (lower bound)" - description_from_producer: *description_prod_participdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - participdem_vdem_high: - title: "{tables.vdem.variables.participdem_vdem.title} (upper bound)" - description_from_producer: *description_prod_participdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.1.4 Deliberative democracy index - delibdem_vdem: - title: Deliberative democracy index - description_short: - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. - description_from_producer: &description_prod_delibdem_vdem |- - Question: To what extent is the ideal of deliberative democracy achieved? - - Clarification: - The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_delibdem` - unit: '' - display: - numDecimalPlaces: 3 + Measures the extent to which the legislature is chosen through broad elections, and the chief executive is elected directly or indirectly (appointed by a popularly elected legislature). + description_from_producer: |- + Question: Is the chief executive and legislature appointed through popular elections? - delibdem_vdem_low: - title: "{tables.vdem.variables.delibdem_vdem.title} (lower bound)" - description_from_producer: *description_prod_delibdem_vdem - unit: '' - display: - numDecimalPlaces: 3 + Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. - delibdem_vdem_high: - title: "{tables.vdem.variables.delibdem_vdem.title} (upper bound)" - description_from_producer: *description_prod_delibdem_vdem + Indicator name: `v2x_elecoff` unit: '' display: numDecimalPlaces: 3 - ## 2.1.5 Egalitarian democracy index - egaldem_vdem: - title: Egalitarian democracy index + ## 9.4.2 Government effectiveness + goveffective_vdem_wbgi: + title: Government effectiveness description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. - description_from_producer: &description_prod_egaldem_vdem |- - Question: To what extent is the ideal of egalitarian democracy achieved? - - Clarification: - The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). + Denotes perceptions of the quality of public services, the civil service, and policy formulation and implementation (positive values mean higher effectiveness) based on the data from the World Governance Indicators. - Indicator name: `v2x_egaldem` - unit: '' - display: - numDecimalPlaces: 3 + description_from_producer: |- + "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government's commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. - egaldem_vdem_low: - title: "{tables.vdem.variables.egaldem_vdem.title} (lower bound)" - description_from_producer: *description_prod_egaldem_vdem + Indicator name: `e_wbgi_gee` unit: '' display: numDecimalPlaces: 3 - egaldem_vdem_high: - title: "{tables.vdem.variables.egaldem_vdem.title} (upper bound)" - description_from_producer: *description_prod_egaldem_vdem + # Historical state name + histname: + title: 'Historical country name' unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.3 Freedom of Expression and Alternative Sources of Information index - freeexpr_vdem: - title: Freedom of Expression and Alternative Sources of Information index - description_short: |- - Best estimate of the extent to which people can discuss political matters at home and in the public sphere, the press and media are free and can present different political perspectives, and the freedom of academic and cultural expression. - description_from_producer: &description_prod_freexpr_vdem |- - Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? - - Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. - - Scale: Interval, from low to high (0-1). - Indicator name: `v2x_freexp_altinf` - unit: '' - display: - numDecimalPlaces: 3 + # NEW + num_years_in_electdem_consecutive: # electdem_age_row_owid + title: Age of electoral democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_electdem + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + unit: years - freeexpr_vdem_low: - title: "{tables.vdem.variables.freeexpr_vdem.title} (lower bound)" - description_from_producer: *description_prod_freexpr_vdem - unit: '' - display: - numDecimalPlaces: 3 + num_years_in_electdem: # electdem_exp_row_owid + title: Experience with electoral democracy + description_short: Number of total years in electoral democracy. It sums all periods of electoral democracy. + description_key: *description_key_num_electdem + unit: years - freeexpr_vdem_high: - title: "{tables.vdem.variables.freeexpr_vdem.title} (upper bound)" - description_from_producer: *description_prod_freexpr_vdem + num_years_in_electdem_cat: # electdem_age_group_row_owid + title: Electoral democracy age group + description_short: Category of electoral democracies based on the country's age of electoral democracy. + description_key: *description_key_num_electdem unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.4 Freedom of association thick index - freeassoc_vdem: - title: Freedom of association thick index - description_short: |- - Best estimate of the extent to which parties, including opposition parties, are allowed to form and participate in elections, and the extent to which civil society organizations are allowed to form and operate freely. - description_from_producer: &description_prod_freeassoc_vdem |- - Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? - - Scale: Interval, from low to high (0-1). - Indicator name: `v2x_frassoc_thick` - unit: '' - display: - numDecimalPlaces: 3 + num_years_in_libdem_consecutive: # libdem_age_row_owid + title: Age of liberal democracy + description_short: Number of consecutive years in electoral democracy. + description_key: &description_key_num_libdem + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + unit: years - freeassoc_vdem_low: - title: "{tables.vdem.variables.freeassoc_vdem.title} (lower bound)" - description_from_producer: *description_prod_freeassoc_vdem - unit: '' - display: - numDecimalPlaces: 3 + num_years_in_libdem: # libdem_exp_row_owid + title: Experience with liberal democracy + description_processing: Number of total years in liberal democracy. It sums all periods of liberal democracy. + description_key: *description_key_num_libdem + unit : years - freeassoc_vdem_high: - title: "{tables.vdem.variables.freeassoc_vdem.title} (upper bound)" - description_from_producer: *description_prod_freeassoc_vdem - unit: '' - display: - numDecimalPlaces: 3 + num_years_in_libdem_cat: # libdem_age_group_row_owid + title: Liberal democracy age group + description_short: Category of liberal democracies based on the country's age of liberal democracy. + description_processing: Number of consecutive years in liberal democracy. + description_key: *description_key_num_libdem + unit : '' ## 2.2.5 Share of population with suffrage suffr_vdem: @@ -285,1916 +157,1362 @@ tables: display: numDecimalPlaces: 3 - ## 2.2.6 Clean elections index - electfreefair_vdem: - title: Clean elections index + ## 3.1.3.3 Election turnout + turnout_vdem: + title: Voter turnout description_short: |- - Best estimate of the extent to which registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence are absent, and the election management body is autonomous and has enough staff and resources. - description_from_producer: &description_prod_electfreefair_vdem |- - Question: To what extent are elections free and fair? - - Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. + Denotes the voter turnout as a share of all registered voters in the national election according to official results. - Scale: Interval, from low to high (0-1). + description_from_producer: |- + Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? - Indicator name: `v2xel_frefair` - unit: '' + Indicator name: `v2eltrnout` + unit: '%' display: - numDecimalPlaces: 3 + numDecimalPlaces: 2 - electfreefair_vdem_low: - title: "{tables.vdem.variables.electfreefair_vdem.title} (lower bound)" - description_from_producer: *description_prod_electfreefair_vdem - unit: '' - display: - numDecimalPlaces: 3 + # 3.4.2.18 HOS female + wom_hos_vdem: # wom_hos_vdem_owid + title: Woman head of state + description_short: |- + Denotes whether the head of state in office on December 31 is a woman. + description_from_producer: |- + If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. - electfreefair_vdem_high: - title: "{tables.vdem.variables.electfreefair_vdem.title} (upper bound)" - description_from_producer: *description_prod_electfreefair_vdem + Indicator name: `v2exfemhos` unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 2.2.7 Elected officials index - electoff_vdem: - title: Elected officials index + ## 3.4.3.16 HOG female + wom_hog_vdem: # wom_hog_vdem_owid + title: Woman head of government description_short: |- - Measures the extent to which the legislature is chosen through broad elections, and the chief executive is elected directly or indirectly (appointed by a popularly elected legislature). + Denotes whether the head of government in office on December 31 is a woman. description_from_producer: |- - Question: Is the chief executive and legislature appointed through popular elections? + Question: What is the gender of the head of government? - Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. + Clarification: If the head of government is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. - Indicator name: `v2x_elecoff` + Responses: + 0: Male + 1: Female + + Indicator name: `v2exfemhog` unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 2.2.8 Liberal component index - lib_vdem: - title: Liberal component index + ## HOE female (custom) + wom_hoe_vdem: # wom_hoe_vdem_owid + title: Woman head of executive description_short: |- - Best estimate of the extent of individual and minority rights, equality before the law, and executive constraints. - description_from_producer: &description_prod_lib_vdem |- - Question: To what extent is the liberal principle of democracy achieved? + The variable denotes whether the chief executive of government in office on December 31 is a woman. + description_processing: |- + Assigns the value based on the gender of the most powerful chief: either Head of state or Head of government. - Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. + Uses gender from HOS: + - If head of state is more powerful than head of government, and head of state is the head of the executive. + - If head of state is also head of government. + - If head of government is less powerful than head of state. - Scale: Interval, from low to high (0-1). + Uses HOG if: + - If head of state is less powerful than head of government - Indicator name: `v2x_liberal` + We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - lib_vdem_low: - title: "{tables.vdem.variables.lib_vdem.title} (lower bound)" - description_from_producer: *description_prod_lib_vdem + wom_parl_vdem_cat: # wom_parl_gr_vdem_owid + title: Women in parliament (category) + description_short: Categorisation of women's political representation in parliament unit: '' - display: - numDecimalPlaces: 3 - lib_vdem_high: - title: "{tables.vdem.variables.lib_vdem.title} (upper bound)" - description_from_producer: *description_prod_lib_vdem + ## Other regime indicators + regime_amb_row_owid: + title: Political regime (inc. ambiguous categories) unit: '' + description_short: |- + Political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg, including ambiguous categories. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 3), electoral democracies (score 6), and liberal democracies (score 9) as the main types. + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). + description_processing: "{definitions.auxiliary.description_processing_row}" display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 2.2.9 Equality before the law and individual liberty index - indiv_libs_vdem: - title: Equality before the law and individual liberty index + regime_redux_row_owid: + title: Political regime description_short: |- - Best estimate of the extent to which extent to which citizens enjoy physical integrity rights, freedoms of religion, of movement, and from forced labor, as well as access to justice, laws are transparent and public administration is impartial. - description_from_producer: &description_prod_indiv_libs_vdem |- - Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xcl_rol` + Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. + description_key: + - It distinguishes between closed autocracies (score 0), electoral autocracies (score 1), and electoral democracies (score 2, including liberal democracies). + - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + description_processing: "{definitions.auxiliary.description_processing_row}" unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - indiv_libs_vdem_low: - title: "{tables.vdem.variables.indiv_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_indiv_libs_vdem + # Not used + regime_row_owid: + title: regime_row_owid unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - indiv_libs_vdem_high: - title: "{tables.vdem.variables.indiv_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_indiv_libs_vdem + # Not used + regime_imputed: + title: Data imputed from another country + description_short: Denotes whether we imputed regime information from another country this one was historically a part of. unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 2.2.10 Judicial constraints on the executive index - judicial_constr_vdem: - title: "Judicial constraints on the executive index" + regime_imputed_country: + title: 'Country name (imputed country)' + unit: '' + + ################################################################################################## + ################################################################################################## + # TABLE: MULTI-DIMENSIONAL TABLES, WITH REGIONS + vdem_multi_with_regions: + variables: + ## 3.6.0.5 Engaged society + soccons_polch_vdem: + title: Engaged society (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the executive respects the constitution, complies with the judiciary and high courts, and higher and lower courts are independent. - description_from_producer: &description_prod_judicial_constr_vdem |- - Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? + << estimate.title() >> estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. + description_from_producer: |- + Question: When important policy changes are being considered, how wide and how independent are public deliberations? - Scale: Interval, from low to high (0-1). + Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. - Indicator name: `v2x_jucon` - unit: '' - display: - numDecimalPlaces: 3 + Responses: + 0: Public deliberation is never, or almost never allowed. + 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. + 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. + 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. + 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. + 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. - judicial_constr_vdem_low: - title: "{tables.vdem.variables.judicial_constr_vdem.title} (upper bound)" - description_from_producer: *description_prod_judicial_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 + Scale: Ordinal, converted to interval by the measurement model. - judicial_constr_vdem_high: - title: "{tables.vdem.variables.judicial_constr_vdem.title} (lower bound)" - description_from_producer: *description_prod_judicial_constr_vdem + Indicator name: `v2dlengage` unit: '' display: numDecimalPlaces: 3 - ## 2.2.11 Legislative constraints on the executive index - legis_constr_vdem: - title: Legislative constraints on the executive index + # 2.1 V-Dem High-Level Democracy Indices + ## 2.1.1 Electoral democracy index + electdem_vdem: + title: |- + Electoral democracy index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the legislature, including opposition parties, questions executive officials and oversees and investigates the executive. - description_from_producer: &description_prod_legis_constr_vdem |- - Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? - - Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? + << estimate.title() >> estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: &description_prod_electdem_vdem |- + Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? + Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate's approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. Scale: Interval, from low to high (0-1). - Indicator name: `v2xlg_legcon` - unit: '' - display: - numDecimalPlaces: 3 - - legis_constr_vdem_low: - title: "{tables.vdem.variables.legis_constr_vdem.title} (lower bound)" - description_from_producer: *description_prod_legis_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - legis_constr_vdem_high: - title: "{tables.vdem.variables.legis_constr_vdem.title} (upper bound)" - description_from_producer: *description_prod_legis_constr_vdem + Indicator name: `v2x_polyarchy` unit: '' display: numDecimalPlaces: 3 - ## 2.2.12 Participatory component index - particip_vdem: - title: Participatory political institutions + ## 2.1.2 Liberal democracy index + libdem_vdem: + title: |- + Liberal democracy index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. - description_from_producer: &description_prod_particip_vdem |- - Question: To what extent is the participatory principle achieved? + << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. + description_from_producer: |- + Question: To what extent is the ideal of liberal democracy achieved? - Clarification: - The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_partip` - unit: '' - display: - numDecimalPlaces: 3 - - particip_vdem_low: - title: "{tables.vdem.variables.particip_vdem.title} (lower bound)" - description_from_producer: *description_prod_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 - - particip_vdem_high: - title: "{tables.vdem.variables.particip_vdem.title} (upper bound)" - description_from_producer: *description_prod_particip_vdem + Indicator name: `v2x_libdem` unit: '' display: numDecimalPlaces: 3 - ## 2.2.13 Civil society participation index - civsoc_particip_vdem: - title: Civil society participation index + # 2.1.3 Participatory democracy index + participdem_vdem: + title: Extent of direct popular votes (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which major civil society organization are routinely consulted by policymakers, how many people are involved in them, women can participate, and candidate nomination for the legislature within parties is decentralized or made through primaries. - description_from_producer: &description_prod_civsoc_particip_vdem |- - Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? - - Clarification: - The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. - - The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. - - Scale: - Interval, from low to high (0-1). + << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. + description_from_producer: |- + Question: To what extent is the ideal of participatory democracy achieved? - Indicator name: `v2x_cspart` - unit: '' - display: - numDecimalPlaces: 3 + Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. - civsoc_particip_vdem_low: - title: "{tables.vdem.variables.civsoc_particip_vdem.title} (lower bound)" - description_from_producer: *description_prod_civsoc_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 + Scale: Interval, from low to high (0-1). - civsoc_particip_vdem_high: - title: "{tables.vdem.variables.civsoc_particip_vdem.title} (upper bound)" - description_from_producer: *description_prod_civsoc_particip_vdem + Indicator name: `v2x_partipdem` unit: '' display: numDecimalPlaces: 3 - ## 2.2.14 Direct popular vote index - dirpop_vote_vdem: - title: Direct popular vote index - description_short: |- - Measures the extent of how easy it is for citizens to vote on specific issues themselves in popular initiatives, referendums, and plebiscites. + ## 2.1.4 Deliberative democracy index + delibdem_vdem: + title: Deliberative democracy index (<< estimate >> estimate) + description_short: + << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. description_from_producer: |- - Question: To what extent is the direct popular vote utilized? + Question: To what extent is the ideal of deliberative democracy achieved? - Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). - Indicator name: `v2xdd_dd` + Indicator name: `v2x_delibdem` unit: '' display: numDecimalPlaces: 3 - ## 2.2.15 Local government index - locelect_vdem: - title: "Elected local governments" + ## 2.2.18 Egalitarian component index + egal_vdem: + title: Egalitarian political institutions index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. - description_from_producer: &description_prod_locelect_vdem |- - Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? + << estimate.title() >> estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. + description_from_producer: |- + Question: To what extent is the egalitarian principle achieved? - Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. + Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. Scale: Interval, from low to high (0-1). - Indicator name: `v2xel_locelec` + Indicator name: `v2x_egal` unit: '' display: numDecimalPlaces: 3 - locelect_vdem_low: - title: "{tables.vdem.variables.locelect_vdem.title} (lower bound)" - description_from_producer: *description_prod_locelect_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 3.5.1.6 Legislature corrupt activities + corr_leg_vdem: + title: Legislative corruption (<< estimate >> estimate) + description_from_producer: |- + Question: Do members of the legislature abuse their position for financial gain? - locelect_vdem_high: - title: "{tables.vdem.variables.locelect_vdem.title} (upper bound)" - description_from_producer: *description_prod_locelect_vdem - unit: '' - display: - numDecimalPlaces: 3 + Clarification: + This includes any of the following: (a) accepting bribes, (b) helping to obtain government contracts for firms that the legislator (or his/her family/friends/political supporters) own, (c) doing favors for firms in exchange for the opportunity of employment after leaving the legislature, (d) stealing money from the state or from campaign donations for personal use. - ## 2.2.16 Regional government index - regelect_vdem: - title: Elected regional governments - description_short: |- - Best estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. - description_from_producer: &description_prod_regelect_vdem |- - Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? + Please make your best estimate, based upon what is known or suspected to be true. - Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. + For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. - Scale: Interval, from low to high (0-1). + Responses: + 0: Commonly. Most legislators probably engage in these activities. + 1: Often. Many legislators probably engage in these activities. + 2: Sometimes. Some legislators probably engage in these activities. + 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. + 4: Never, or hardly ever. - Indicator name: `v2xel_regelec` + Indicator name: `v2lgcrrpt` unit: '' display: numDecimalPlaces: 3 - regelect_vdem_low: - title: "{tables.vdem.variables.regelect_vdem.title} (lower bound)" - description_from_producer: *description_prod_regelect_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 3.5.3.7 Lower chamber female legislators + wom_parl_vdem: + title: Lower chamber female legislators + description_short: |- + Percentage of women in the lower or single chamber of the legislature. + description_from_producer: |- + Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? - regelect_vdem_high: - title: "{tables.vdem.variables.regelect_vdem.title} (upper bound)" - description_from_producer: *description_prod_regelect_vdem - unit: '' + Indicator name: `v2lgfemleg` + unit: '%' display: numDecimalPlaces: 3 - # 2.2.17 Deliberative component index - delib_vdem: - title: Deliberative political institutions index - description_short: |- - Best estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. - description_from_producer: &description_prod_delib_vdem |- - Question: To what extent is the deliberative principle of democracy achieved? - Clarification: - The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. - To measure these features of a polity we try to determine the extent to which political elites give public justifications for their positions on matters of public policy, justify their positions in terms of the public good, acknowledge and respect counter-arguments; and how wide the range of consultation is at elite levels. - Scale: - Interval, from low to high (0-1). + ## 3.7.0.6 Judicial corruption decision + corr_jud_vdem: + title: Judicial corruption (<< estimate >> estimate) + description_from_producer: |- + Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? - Indicator name: `v2xdl_delib` - unit: '' - display: - numDecimalPlaces: 3 + Responses: + 0: Always. + 1: Usually. + 2: About half of the time. 3: Not usually. + 4: Never. + + Scale: Ordinal, converted to interval by the measurement model. + + Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. - delib_vdem_low: - title: "{tables.vdem.variables.delib_vdem.title} (lower bound)" - description_from_producer: *description_prod_delib_vdem + Indicator name: `v2jucorrdc` unit: '' display: numDecimalPlaces: 3 - delib_vdem_high: - title: "{tables.vdem.variables.delib_vdem.title} (upper bound)" - description_from_producer: *description_prod_delib_vdem + ## 3.8.2.2 Rigorous and impartial public administration + public_admin_vdem: + title: Rigorous and impartial public administration (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. + description_from_producer: |- + Question: Are public officials rigorous and impartial in the performance of their duties? + + Clarification: + This question focuses on the extent to which public officials generally abide by the law and treat like cases alike, or conversely, the extent to which public administration is characterized by arbitrariness and biases (i.e., nepotism, cronyism, or discrimination). + + The question covers the public officials that handle the cases of ordinary people. If no functioning public administration exists, the lowest score (0) applies. + + Responses: + 0: The law is not respected by public officials. Arbitrary or biased administration of the law is rampant. + 1: The law is weakly respected by public officials. Arbitrary or biased administration of the law is widespread. + 2: The law is modestly respected by public officials. Arbitrary or biased administration of the law is moderate. + 3: The law is mostly respected by public officials. Arbitrary or biased administration of the law is limited. + 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clrspct` unit: '' display: numDecimalPlaces: 3 - ## 2.2.18 Egalitarian component index - egal_vdem: - title: Egalitarian political institutions index + ## 3.8.2.6 Social group equality in respect for civil liberties + socgr_civ_libs_vdem: + title: Equality of civil liberties across social groups (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. - description_from_producer: &description_prod_egal_vdem |- - Question: To what extent is the egalitarian principle achieved? + << estimate.title() >> estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. + description_from_producer: |- + Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? - Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. + Clarification: Here, civil liberties are understood to include access to justice, private property rights, freedom of movement, and freedom from forced labor. - Scale: Interval, from low to high (0-1). + Responses: + 0: Members of some social groups enjoy much fewer civil liberties than the general population. 1: Members of some social groups enjoy substantially fewer civil liberties than the general population. + 2: Members of some social groups enjoy moderately fewer civil liberties than the general population. + 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. - Indicator name: `v2x_egal` + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2clsocgrp` unit: '' display: numDecimalPlaces: 3 - egal_vdem_low: - title: "{tables.vdem.variables.egal_vdem.title} (lower bound)" - description_from_producer: *description_prod_egal_vdem + ## 3.9.0.1 Domestic autonomy + dom_auton_vdem: + title: Domestic policymaking free from foreign influence (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which domestic policy is free from the interference of other states. + description_from_producer: |- + Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? + + Clarification: The question of domestic autonomy does not include restrictions emanating from treaties (e.g., NATO), international organizations (e.g., the WTO), or confederations (e.g., the European Union) if these agreements are freely negotiated by the state and if the state is free to exit from that treaty, organization, or confederation. Nor does it include restrictions on policymaking emanating from international market forces and trans-national corporations. + + Responses: + 0: Non-autonomous. National level authority is exercised by an external power, either by law or in practice. The most common examples of this are direct colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). It also includes situations in which domestic actors provide de jure cover for de facto control by a foreign power (e.g. Vichy France). However, control of some part of the territory of a state by an enemy during war is not considered control by external actors if the sovereign government remains on scene and continues to wage conventional war (e.g., the USSR during WW II). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to rule, decides who can or cannot rule through formal rules or informal understandings, or precludes certain policies through explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples include Soviet "satellite" states in Eastern Europe, and situations where colonial powers grant limited powers of national self- government to their possessions (e.g., protectorates and limited home government). + 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2svdomaut` unit: '' display: numDecimalPlaces: 3 - egal_vdem_high: - title: "{tables.vdem.variables.egal_vdem.title} (upper bound)" - description_from_producer: *description_prod_egal_vdem + ## 3.9.0.2 International autonomy + int_auton_vdem: + title: Foreign policymaking free from foreign influence (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which foreign policy is free from the interference of other states. + description_from_producer: |- + Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? + + Responses: + 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). + 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). + 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. + + Indicator name: `v2svinlaut` unit: '' display: numDecimalPlaces: 3 - ## 2.2.19 Equal protection index - equal_rights_vdem: - title: Equal rights protection index + ## 3.9.0.3 State authority over territory + terr_contr_vdem: + title: Territory under state control (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the state protects the rights and freedoms across social groups equally. - description_from_producer: &description_prod_equal_rights_vdem |- - Question: How equal is the protection of rights and freedoms across social groups by the state? + << estimate.title() >> estimate of the percentage of territory controlled by the government. + description_from_producer: |- + Question: Over what percentage (%) of the territory does the state have effective control? - Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. + Clarification: + With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. - Scale: Interval, from low to high (0-1). + By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. - Indicator name: `v2xeg_eqprotec` - unit: '' + Indicator name: `v2svstterr` + unit: '%' display: numDecimalPlaces: 3 - equal_rights_vdem_low: - title: "{tables.vdem.variables.equal_rights_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_rights_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 3.12.0.2 Power distributed by social group + socgr_pow_vdem: + title: Equality of political power across social groups (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. + description_from_producer: |- + Question: Is political power distributed according to social groups? + + Clarification: A social group is differentiated within a country by caste, ethnicity, language, race, region, religion, or some combination thereof. (It does not include identities grounded in sexual orientation or socioeconomic status.) Social group identity is contextually defined and is likely to vary across countries and through time. Social group identities are also likely to cross-cut, so that a given person could be defined in multiple ways, i.e., as part of multiple groups. Nonetheless, at any given point in time there are social groups within a society that are understood — by those residing within that society — to be different, in ways that may be politically relevant. + + Responses: + 0: Political power is monopolized by one social group comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 1: Political power is monopolized by several social groups comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. + 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. + 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. - equal_rights_vdem_high: - title: "{tables.vdem.variables.equal_rights_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_rights_vdem + Indicator name: `v2pepwrsoc` unit: '' display: numDecimalPlaces: 3 - ## 2.2.20 Equal access index - equal_access_vdem: - title: Equal access to power index + ## 5.4.3 Presidentialism Index + personalism_vdem: + title: Presidentialism Index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. - description_from_producer: &description_prod_equal_access_vdem |- - Question: How equal is access to power? + << estimate.title() >> estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. + description_from_producer: |- + Question: To what extent is the regime characterized by presidentialism? - Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. + Clarification: + Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem's index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. Scale: Interval, from low to high (0-1). - Indicator name: `v2xeg_eqaccess` + Indicator name: `v2xnp_pres` unit: '' display: numDecimalPlaces: 3 - equal_access_vdem_low: - title: "{tables.vdem.variables.equal_access_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_access_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 5.5.1 Civil liberties index + civ_libs_vdem: + title: Civil liberties index (<< estimate >> estimate) + description_short: |- + Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. + description_from_producer: |- + Question: To what extent is civil liberty respected? + + Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. - equal_access_vdem_high: - title: "{tables.vdem.variables.equal_access_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_access_vdem + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_civlib` unit: '' display: numDecimalPlaces: 3 - ## 2.2.21 Equal distribution of resources index - equal_res_vdem: - title: Equal resource distribution index + ## 5.5.4 Private civil liberties index + priv_libs_vdem: + title: Private civil liberties index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. - description_from_producer: &description_prod_equal_res_vdem |- - Question: How equal is the distribution of resources? + Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. + description_from_producer: |- + Question: To what extent are private liberties respected? - Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. + Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. Scale: Interval, from low to high (0-1). - Indicator name: `v2xeg_eqdr` + Indicator name: `v2x_clpriv` unit: '' display: numDecimalPlaces: 3 - equal_res_vdem_low: - title: "{tables.vdem.variables.equal_res_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_res_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 5.5.3 Political civil liberties index + pol_libs_vdem: + title: Political civil liberties index (<< estimate >> estimate) + description_short: |- + Central estimate of the extent to which people enjoy the freedoms of expression and association. + description_from_producer: |- + Question: To what extent are political liberties respected? + + Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. + + Scale: Interval, from low to high (0-1). - equal_res_vdem_high: - title: "{tables.vdem.variables.equal_res_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_res_vdem + Indicator name: `v2x_clpol` unit: '' display: numDecimalPlaces: 3 - ## 3.1.3.3 Election turnout - turnout_vdem: - title: Voter turnout + ## 5.5.2 Physical violence index + phys_integr_libs_vdem: + title: Physical integrity liberties (<< estimate >> estimate) description_short: |- - Denotes the voter turnout as a share of all registered voters in the national election according to official results. - + Central estimate of the extent to which people are free from government torture and political killings. description_from_producer: |- - Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? + Question: To what extent is physical integrity respected? - Indicator name: `v2eltrnout` - unit: '%' - display: - numDecimalPlaces: 2 + Clarification: Physical integrity is understood as freedom from political killings and torture by the government. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect violence committed by government agents and that are not directly referring to elections. - # 3.4.2.18 HOS female - wom_hos_vdem: # wom_hos_vdem_owid - title: Woman head of state - description_short: |- - Denotes whether the head of state in office on December 31 is a woman. - description_from_producer: |- - If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + Scale: Interval, from low to high (0-1). - Indicator name: `v2exfemhos` + Indicator name: `v2x_clphy` unit: '' display: - numDecimalPlaces: 0 + numDecimalPlaces: 3 - ## 3.4.3.16 HOG female - wom_hog_vdem: # wom_hog_vdem_owid - title: Woman head of government + ## 5.7.1 Political corruption index + corruption_vdem: + title: Political corruption index (<< estimate >> estimate) description_short: |- - Denotes whether the head of government in office on December 31 is a woman. + << estimate.title() >> estimate of the extent to which a country is affected by political corruption. description_from_producer: |- - Question: What is the gender of the head of government? + Question: How pervasive is political corruption? - Clarification: If the head of government is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. + Clarification: The directionality of the V-Dem corruption index runs from less corrupt to more corrupt unlike the other V-Dem variables that generally run from less democratic to more democratic situation. The corruption index includes measures of six distinct types of corruption that cover both different areas and levels of the polity realm, distinguishing between executive, legislative and judicial corruption. Within the executive realm, the measures also distinguish between corruption mostly pertaining to bribery and corruption due to embezzlement. Finally, they differentiate between corruption in the highest echelons of the executive at the level of the rulers/cabinet on the one hand, and in the public sector at large on the other. The measures thus tap into several distinguished types of corruption: both 'petty' and 'grand'; both bribery and theft; both corruption aimed and influencing law making and that affecting implementation. - Responses: - 0: Male - 1: Female + Scale: Interval, from low to high (0-1). - Indicator name: `v2exfemhog` + Indicator name: `v2x_corr` unit: '' display: - numDecimalPlaces: 0 - - ## 3.5.1.6 Legislature corrupt activities - corr_leg_vdem: - title: Legislative corruption - description_from_producer: &description_prod_corr_leg_vdem |- - Question: Do members of the legislature abuse their position for financial gain? - - Clarification: - This includes any of the following: (a) accepting bribes, (b) helping to obtain government contracts for firms that the legislator (or his/her family/friends/political supporters) own, (c) doing favors for firms in exchange for the opportunity of employment after leaving the legislature, (d) stealing money from the state or from campaign donations for personal use. + numDecimalPlaces: 3 - Please make your best estimate, based upon what is known or suspected to be true. + ## 5.7.3 Public sector corruption index [Not in use] + corr_publsec_vdem: + title: Public sector corruption index (<< estimate >> estimate) + description_from_producer: |- + Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? - For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - Responses: - 0: Commonly. Most legislators probably engage in these activities. - 1: Often. Many legislators probably engage in these activities. - 2: Sometimes. Some legislators probably engage in these activities. - 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. - 4: Never, or hardly ever. + Scale: Interval, from low to high (0-1). - Indicator name: `v2lgcrrpt` + Indicator name: `v2x_pubcorr` unit: '' display: numDecimalPlaces: 3 - corr_leg_vdem_low: - title: "{tables.vdem.variables.corr_leg_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_leg_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 5.7.2 Executive corruption index [Not in use] + corr_exec_vdem: + title: Executive corruption index (<< estimate >> estimate) + description_from_producer: |- + Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? + + Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + + Scale: Interval, from low to high (0-1). - corr_leg_vdem_high: - title: "{tables.vdem.variables.corr_leg_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_leg_vdem + Indicator name: `v2x_execorr` unit: '' display: numDecimalPlaces: 3 - ## 3.5.3.7 Lower chamber female legislators - wom_parl_vdem: - title: Lower chamber female legislators + ## 5.8.1 Women political empowerment index + wom_emp_vdem: + title: Women's political empowerment index (<< estimate >> estimate) description_short: |- - Percentage of women in the lower or single chamber of the legislature. + << estimate.title() >> estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. description_from_producer: |- - Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? + Question: How politically empowered are women? - Indicator name: `v2lgfemleg` - unit: '%' + Clarification: Women's political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women's open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. + + Scale: Interval, from low to high (0-1). + + Indicator name: `v2x_gender` + unit: '' display: numDecimalPlaces: 3 - ## 3.6.0.1 Reasoned justification - justified_polch_vdem: - title: Justified political positions + ## 5.8.2 Women civil liberties index + wom_civ_libs_vdem: + title: Women's civil rights index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. - description_from_producer: &description_prod_justified_polch_vdem |- - Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? + << estimate.title() >> estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. + description_from_producer: |- + Question: Do women have the ability to make meaningful decisions in key areas of their lives? - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. - - Responses: + Clarification: Women's civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. - 0: No justification. Elites almost always only dictate that something should or should not be done, but no reasoning about justification is given. For example, "We must cut spending." - 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] - 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." - 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." + Scale: Interval, from low to high (0-1). - Indicator name: `v2dlreason` + Indicator name: `v2x_gencl` unit: '' display: numDecimalPlaces: 3 - justified_polch_vdem_low: - title: "{tables.vdem.variables.justified_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_justified_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 5.8.3 Women civil society participation index + wom_civ_soc_vdem: + title: Women's civil society participation index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. + description_from_producer: |- + Question: Do women have the ability to express themselves and to form and participate in groups? + + Clarification: Women's civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. + + Scale: Interval, from low to high (0-1). - justified_polch_vdem_high: - title: "{tables.vdem.variables.justified_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_justified_polch_vdem + Indicator name: `v2x_gencs` unit: '' display: numDecimalPlaces: 3 - ## 3.6.0.2 Common good - justcomgd_polch_vdem: - title: Common good justifications + ## 5.8.4 Women political participation index + wom_pol_par_vdem: + title: Women's political participation index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. - description_from_producer: &description_prod_justcomgd_polch_vdem |- - Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? + << estimate.title() >> estimate of the extent to which women are represented in the legislature and have an equal share of political power. + description_from_producer: |- + Question: Are women descriptively represented in formal political positions? - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + Clarification: Women's political participation is understood to include women's descriptive representation in the legislature and an equal share in the overall distribution of power. - Responses: - 0: Little or no justification in terms of the common good is usually offered. - 1: Specific business, geographic, group, party, or constituency interests are for the most part offered as justifications. - 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. - 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. - 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. + Scale: Interval, from low to high (0-1). - Indicator name: `v2dlcommon` + Indicator name: `v2x_genpp` unit: '' display: numDecimalPlaces: 3 - justcomgd_polch_vdem_low: - title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_justcomgd_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 5.9.1 Rule of law index + rule_of_law_vdem: + title: Rule of Law index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. + description_from_producer: |- + Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? + + Scale: Interval, from low to high (0-1). - justcomgd_polch_vdem_high: - title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_justcomgd_polch_vdem + Indicator name: `v2x_rule` unit: '' display: numDecimalPlaces: 3 - ## 3.6.0.3 Respect counterarguments - counterarg_polch_vdem: - title: Respect for counterarguments - description_short: |- - Best estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. - description_from_producer: &description_prod_counterarg_polch_vdem |- - Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? - - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + ## 5.11.1 Core civil society index [not in use] + civ_soc_str_vdem: + title: Core civil society index (<< estimate >> estimate) + description_from_producer: |- + Question: How robust is civil society? - Responses: - 0: Counterarguments are not allowed or if articulated, punished. - 1: Counterarguments are allowed at least from some parties, but almost always are ignored. 2: Elites tend to acknowledge counterarguments but then explicitly degrade them by making a negative statement about them or the individuals and groups that propose them. - 3: Elites tend to acknowledge counterarguments without making explicit negative or positive statements about them. - 4: Elites almost always acknowledge counterarguments and explicitly value them, even if they ultimately reject them for the most part. - 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. + Clarification: The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. - Scale: Ordinal, converted to interval by the measurement model. + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. - Indicator name: `v2dlcountr` - unit: '' - display: - numDecimalPlaces: 3 + Scale: Interval, from low to high (0-1). - counterarg_polch_vdem_low: - title: "{tables.vdem.variables.counterarg_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_counterarg_polch_vdem + Indicator name: `v2xcs_ccsi` unit: '' display: numDecimalPlaces: 3 - counterarg_polch_vdem_high: - title: "{tables.vdem.variables.counterarg_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_counterarg_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 + ################################################################################################## + ################################################################################################## + # TABLE: MULTI-DIMENSIONAL TABLES WITHOUT REGIONS + vdem_multi_without_regions: + title: "" + description: "" + variables: + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men + accessjust_m_row: + title: Access to justice for men (<< estimate >> estimate) (re-estimate) + description_short: << estimate.title() >> estimate of whether men have access to justice or not. + description_from_producer: |- + Question: Do men enjoy secure and effective access to justice? - ### 3.6.0.4 Range of consultation - elitecons_polch_vdem: - title: Elite consultation - description_short: |- - Best estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. - description_from_producer: &description_prod_elitecons_polch_vdem |- - Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? + Clarification: This question specifies the extent to which men can bring cases before the courts without risk to their personal safety, trials are fair, and men have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - Clarification: Because practices vary greatly from policy to policy, base your answer on the style that is most typical of policymaking. + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. Responses: - 0: No consultation. The leader or a very small group (e.g. military council) makes authoritative decisions on their own. - 1: Very little and narrow. Consultation with only a narrow circle of loyal party/ruling elites. 2: Consultation includes the former plus a larger group that is loyal to the government, such as the ruling party's or parties' local executives and/or women, youth and other branches. - 3: Consultation includes the former plus leaders of other parties. - 4: Consultation includes the former plus a select range of society/labor/business representatives. - 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. + 0: Secure and effective access to justice for men is non-existent. + 1: Secure and effective access to justice for men is usually not established or widely respected. 2: Secure and effective access to justice for men is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for men is usually observed. + 4: Secure and effective access to justice for men is almost always observed. Scale: Ordinal, converted to interval by the measurement model. + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstm_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - Indicator name: `v2dlconslt` - unit: '' - display: - numDecimalPlaces: 3 - - elitecons_polch_vdem_low: - title: "{tables.vdem.variables.elitecons_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_elitecons_polch_vdem + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - elitecons_polch_vdem_high: - title: "{tables.vdem.variables.elitecons_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_elitecons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 + # [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women + accessjust_w_row: + title: Access to justice for women (<< estimate >> estimate) (re-estimate) + description_short: << estimate.title() >> estimate of whether women have access to justice or not. + description_from_producer: |- + Question: Do women enjoy equal, secure, and effective access to justice? - ## 3.6.0.5 Engaged society - soccons_polch_vdem: - title: Engaged society - description_short: |- - Best estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. - description_from_producer: &description_prod_soccons_polch_vdem |- - Question: When important policy changes are being considered, how wide and how independent are public deliberations? + Clarification: This question specifies the extent to which women can bring cases before the courts without risk to their personal safety, trials are fair, and women have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. + This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. Responses: - 0: Public deliberation is never, or almost never allowed. - 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. - 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. - 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. - 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. - 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. + 0: Secure and effective access to justice for women is non-existent. + 1: Secure and effective access to justice for women is usually not established or widely respected. 2: Secure and effective access to justice for women is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. + 3: Secure and effective access to justice for women is usually observed. + 4: Secure and effective access to justice for women is almost always observed. Scale: Ordinal, converted to interval by the measurement model. + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - Indicator name: `v2dlengage` + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - soccons_polch_vdem_low: - title: "{tables.vdem.variables.soccons_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_soccons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 2.2.13 Civil society participation index + civsoc_particip_vdem: + title: Civil society participation index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which major civil society organization are routinely consulted by policymakers, how many people are involved in them, women can participate, and candidate nomination for the legislature within parties is decentralized or made through primaries. + description_from_producer: |- + Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? + + Clarification: + The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + + The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + + Scale: + Interval, from low to high (0-1). - soccons_polch_vdem_high: - title: "{tables.vdem.variables.soccons_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_soccons_polch_vdem + Indicator name: `v2x_cspart` unit: '' display: numDecimalPlaces: 3 - ## 3.7.0.6 Judicial corruption decision - corr_jud_vdem: - title: Judicial corruption - description_from_producer: &description_prod_corr_jud_vdem |- - Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? + ## 3.6.0.3 Respect counterarguments + counterarg_polch_vdem: + title: Respect for counterarguments (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. + description_from_producer: |- + Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. Responses: - 0: Always. - 1: Usually. - 2: About half of the time. 3: Not usually. - 4: Never. + 0: Counterarguments are not allowed or if articulated, punished. + 1: Counterarguments are allowed at least from some parties, but almost always are ignored. 2: Elites tend to acknowledge counterarguments but then explicitly degrade them by making a negative statement about them or the individuals and groups that propose them. + 3: Elites tend to acknowledge counterarguments without making explicit negative or positive statements about them. + 4: Elites almost always acknowledge counterarguments and explicitly value them, even if they ultimately reject them for the most part. + 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. Scale: Ordinal, converted to interval by the measurement model. - Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. - - Indicator name: `v2jucorrdc` + Indicator name: `v2dlcountr` unit: '' display: numDecimalPlaces: 3 - corr_jud_vdem_low: - title: "{tables.vdem.variables.corr_jud_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_jud_vdem - unit: '' - display: - numDecimalPlaces: 3 + # 2.2.17 Deliberative component index + delib_vdem: + title: Deliberative political institutions index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. + description_from_producer: |- + Question: To what extent is the deliberative principle of democracy achieved? + + Clarification: + The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. + + To measure these features of a polity we try to determine the extent to which political elites give public justifications for their positions on matters of public policy, justify their positions in terms of the public good, acknowledge and respect counter-arguments; and how wide the range of consultation is at elite levels. + + Scale: + Interval, from low to high (0-1). - corr_jud_vdem_high: - title: "{tables.vdem.variables.corr_jud_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_jud_vdem + Indicator name: `v2xdl_delib` unit: '' display: numDecimalPlaces: 3 - ## 3.8.2.2 Rigorous and impartial public administration - public_admin_vdem: - title: Rigorous and impartial public administration + ## 2.1.5 Egalitarian democracy index + egaldem_vdem: + title: Egalitarian democracy index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. - description_from_producer: &description_prod_public_admin_vdem |- - Question: Are public officials rigorous and impartial in the performance of their duties? + << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. + description_from_producer: |- + Question: To what extent is the ideal of egalitarian democracy achieved? Clarification: - This question focuses on the extent to which public officials generally abide by the law and treat like cases alike, or conversely, the extent to which public administration is characterized by arbitrariness and biases (i.e., nepotism, cronyism, or discrimination). - - The question covers the public officials that handle the cases of ordinary people. If no functioning public administration exists, the lowest score (0) applies. - - Responses: - 0: The law is not respected by public officials. Arbitrary or biased administration of the law is rampant. - 1: The law is weakly respected by public officials. Arbitrary or biased administration of the law is widespread. - 2: The law is modestly respected by public officials. Arbitrary or biased administration of the law is moderate. - 3: The law is mostly respected by public officials. Arbitrary or biased administration of the law is limited. - 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. + The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. - Scale: Ordinal, converted to interval by the measurement model. + Scale: Interval, from low to high (0-1). - Indicator name: `v2clrspct` + Indicator name: `v2x_egaldem` unit: '' display: numDecimalPlaces: 3 - public_admin_vdem_low: - title: "{tables.vdem.variables.public_admin_vdem.title} (lower bound)" - description_from_producer: *description_prod_public_admin_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index + electdem_dich_row_owid: + title: Electoral democracy (re-estimate) + description_short: |- + << estimate.title() >> estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. + description_from_producer: *description_prod_electdem_vdem + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 0.5 to classify the original indicator (`v2x_polyarchy_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - public_admin_vdem_high: - title: "{tables.vdem.variables.public_admin_vdem.title} (upper bound)" - description_from_producer: *description_prod_public_admin_vdem + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 3.8.2.6 Social group equality in respect for civil liberties - socgr_civ_libs_vdem: - title: Equality of civil liberties across social groups - description_short: |- - Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. - description_from_producer: &description_prod_socgr_civ_libs_vdem |- - Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair + electfreefair_row: + title: Free and fair elections (<< estimate >> estimate) (re-estimate) + description_short: << estimate.title() >> estimate of whether national elections were free and fair or not. + description_from_producer: |- + Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? - Clarification: Here, civil liberties are understood to include access to justice, private property rights, freedom of movement, and freedom from forced labor. + Clarification: The only thing that should not be considered in coding this is the extent of suffrage (by law). Thus, a free and fair election may occur even if the law excludes significant groups (an issue measured separately). Responses: - 0: Members of some social groups enjoy much fewer civil liberties than the general population. 1: Members of some social groups enjoy substantially fewer civil liberties than the general population. - 2: Members of some social groups enjoy moderately fewer civil liberties than the general population. - 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. + 0: No, not at all. The elections were fundamentally flawed and the official results had little if anything to do with the 'will of the people' (i.e., who became president; or who won the legislative majority). + 1: Not really. While the elections allowed for some competition, the irregularities in the end affected the outcome of the election (i.e., who became president; or who won the legislative majority). + 2: Ambiguous. There was substantial competition and freedom of participation but there were also significant irregularities. It is hard to determine whether the irregularities affected the outcome or not (as defined above). + 3: Yes, somewhat. There were deficiencies and some degree of fraud and irregularities but these did not in the end affect the outcome (as defined above). + 4: Yes. There was some amount of human error and logistical restrictions but these were largely unintentional and without significant consequences. Scale: Ordinal, converted to interval by the measurement model. + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 2 to classify the original indicator (`v2elfrfair_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - Indicator name: `v2clsocgrp` + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - socgr_civ_libs_vdem_low: - title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_socgr_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 2.2.6 Clean elections index + electfreefair_vdem: + title: Clean elections index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence are absent, and the election management body is autonomous and has enough staff and resources. + description_from_producer: |- + Question: To what extent are elections free and fair? + + Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. - socgr_civ_libs_vdem_high: - title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_socgr_civ_libs_vdem + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xel_frefair` unit: '' display: numDecimalPlaces: 3 - ## 3.9.0.1 Domestic autonomy - dom_auton_vdem: - title: Domestic policymaking free from foreign influence + ## [CUSTOM] + electmulpar_hoe_row_owid: + title: Multi-party elections for government's chief executive (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which domestic policy is free from the interference of other states. - description_from_producer: &description_prod_dom_auton_vdem |- - Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? - Clarification: The question of domestic autonomy does not include restrictions emanating from treaties (e.g., NATO), international organizations (e.g., the WTO), or confederations (e.g., the European Union) if these agreements are freely negotiated by the state and if the state is free to exit from that treaty, organization, or confederation. Nor does it include restrictions on policymaking emanating from international market forces and trans-national corporations. - - Responses: - 0: Non-autonomous. National level authority is exercised by an external power, either by law or in practice. The most common examples of this are direct colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). It also includes situations in which domestic actors provide de jure cover for de facto control by a foreign power (e.g. Vichy France). However, control of some part of the territory of a state by an enemy during war is not considered control by external actors if the sovereign government remains on scene and continues to wage conventional war (e.g., the USSR during WW II). - 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to rule, decides who can or cannot rule through formal rules or informal understandings, or precludes certain policies through explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples include Soviet "satellite" states in Eastern Europe, and situations where colonial powers grant limited powers of national self- government to their possessions (e.g., protectorates and limited home government). - 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. + unit: '' + description_processing: |- + {definitions.auxiliary.description_processing_row} - Scale: Ordinal, converted to interval by the measurement model. + Finally, we make some additional minor changes to the coding rules. - Indicator name: `v2svdomaut` - unit: '' - display: - numDecimalPlaces: 3 + The two most consequential changes we make relate to RoW's identification of whether a country's chief executive is elected. First, one way RoW considers a chief executive to have been elected — even if they are not directly elected or appointed by the legislature — is if they are the head of state, they depend on the approval of the legislature, and there were multi-party elections for the executive. This last part is likely a coding error because to be consistent with RoW's other definitions, this should depend on multi-party legislative, not executive, elections. Only if the legislature has been chosen in multi-party elections does it make an otherwise unelected chief executive—who must be approved by that legislature—dependent on multi-party elections. We correct this error. - dom_auton_vdem_low: - title: "{tables.vdem.variables.dom_auton_vdem.title} (lower bound)" - description_from_producer: *description_prod_dom_auton_vdem - unit: '' + Second, RoW considers a chief executive to have been elected if the country had chosen both its legislature and executive in multi-party elections. But this considers some chief executives as elected even if they came to power through force after elections were previously held. Examples include the coup d'états led by Fulgencio Batista in Cuba in 1952 and by Muhammadu Buhari in Nigeria in 1983. We instead consider such chief executives as unelected. display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - dom_auton_vdem_high: - title: "{tables.vdem.variables.dom_auton_vdem.title} (upper bound)" - description_from_producer: *description_prod_dom_auton_vdem + ## [CUSTOM, based on `v2elmulpar_osp`] + electmulpar_leg_row: + title: Multiparty elections for legislature (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of whether multi-party elections for the national legislature were held or not. + description_processing: |- + Use the value from `v2elmulpar_osp` whenever `v2eltype` is 0, 1, 4 or 5. Otherwise the value is missing. unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 3.9.0.2 International autonomy - int_auton_vdem: - title: Foreign policymaking free from foreign influence + ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty + electmulpar_row: + title: Multiparty elections (<< estimate >> estimate) (re-estimate) description_short: |- - Best estimate of the extent to which foreign policy is free from the interference of other states. - description_from_producer: &description_prod_int_auton_vdem |- - Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? + << estimate.title() >> estimate of whether national multi-party elections were held or not. + description_from_producer: |- + Question: Question: Was this national election multiparty? Responses: - 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). - 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). - 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. - - Indicator name: `v2svinlaut` - unit: '' - display: - numDecimalPlaces: 3 + 0: No. No-party or single-party and there is no meaningful competition (includes situations where a few parties are legal but they are all de facto controlled by the dominant party). + 1: Not really. No-party or single-party (defined as above) but multiple candidates from the same party and/or independents contest legislative seats or the presidency. + 2: Constrained. At least one real opposition party is allowed to contest but competition is highly constrained — legally or informally. + 3: Almost. Elections are multiparty in principle but either one main opposition party is prevented (de jure or de facto) from contesting, or conditions such as civil unrest (excluding natural disasters) prevent competition in a portion of the territory. + 4: Yes. Elections are multiparty, even though a few marginal parties may not be permitted to contest (e.g. far-right/left extremist parties, anti-democratic religious or ethnic parties). - int_auton_vdem_low: - title: "{tables.vdem.variables.int_auton_vdem.title} (lower bound)" - description_from_producer: *description_prod_int_auton_vdem - unit: '' - display: - numDecimalPlaces: 3 + Scale: Ordinal, converted to interval by the measurement model. + description_processing: |- + We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. - int_auton_vdem_high: - title: "{tables.vdem.variables.int_auton_vdem.title} (upper bound)" - description_from_producer: *description_prod_int_auton_vdem + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 3.9.0.3 State authority over territory - terr_contr_vdem: - title: Territory under state control + ### 3.6.0.4 Range of consultation + elitecons_polch_vdem: + title: Elite consultation (<< estimate >> estimate) description_short: |- - Best estimate of the percentage of territory controlled by the government. - description_from_producer: &description_prod_terr_contr_vdem |- - Question: Over what percentage (%) of the territory does the state have effective control? - - Clarification: - With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. + << estimate.title() >> estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. + description_from_producer: |- + Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? - By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. + Clarification: Because practices vary greatly from policy to policy, base your answer on the style that is most typical of policymaking. - Indicator name: `v2svstterr` - unit: '%' - display: - numDecimalPlaces: 3 + Responses: + 0: No consultation. The leader or a very small group (e.g. military council) makes authoritative decisions on their own. + 1: Very little and narrow. Consultation with only a narrow circle of loyal party/ruling elites. 2: Consultation includes the former plus a larger group that is loyal to the government, such as the ruling party's or parties' local executives and/or women, youth and other branches. + 3: Consultation includes the former plus leaders of other parties. + 4: Consultation includes the former plus a select range of society/labor/business representatives. + 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. - terr_contr_vdem_low: - title: "{tables.vdem.variables.terr_contr_vdem.title} (lower bound)" - description_from_producer: *description_prod_terr_contr_vdem - unit: '' - display: - numDecimalPlaces: 3 + Scale: Ordinal, converted to interval by the measurement model. - terr_contr_vdem_high: - title: "{tables.vdem.variables.terr_contr_vdem.title} (upper bound)" - description_from_producer: *description_prod_terr_contr_vdem + Indicator name: `v2dlconslt` unit: '' display: numDecimalPlaces: 3 - ## 3.12.0.2 Power distributed by social group - socgr_pow_vdem: - title: Equality of political power across social groups + ## 2.2.20 Equal access index + equal_access_vdem: + title: Equal access to power index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. - description_from_producer: &description_prod_socgr_pow_vdem |- - Question: Is political power distributed according to social groups? + << estimate.title() >> estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. + description_from_producer: |- + Question: How equal is access to power? - Clarification: A social group is differentiated within a country by caste, ethnicity, language, race, region, religion, or some combination thereof. (It does not include identities grounded in sexual orientation or socioeconomic status.) Social group identity is contextually defined and is likely to vary across countries and through time. Social group identities are also likely to cross-cut, so that a given person could be defined in multiple ways, i.e., as part of multiple groups. Nonetheless, at any given point in time there are social groups within a society that are understood — by those residing within that society — to be different, in ways that may be politically relevant. + Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. - Responses: - 0: Political power is monopolized by one social group comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 1: Political power is monopolized by several social groups comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. - 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. + Scale: Interval, from low to high (0-1). - Indicator name: `v2pepwrsoc` + Indicator name: `v2xeg_eqaccess` unit: '' display: numDecimalPlaces: 3 - socgr_pow_vdem_low: - title: "{tables.vdem.variables.socgr_pow_vdem.title} (lower bound)" - description_from_producer: *description_prod_socgr_pow_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 2.2.19 Equal protection index + equal_rights_vdem: + title: Equal rights protection index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which the state protects the rights and freedoms across social groups equally. + description_from_producer: |- + Question: How equal is the protection of rights and freedoms across social groups by the state? + + Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. + + Scale: Interval, from low to high (0-1). - socgr_pow_vdem_high: - title: "{tables.vdem.variables.socgr_pow_vdem.title} (upper bound)" - description_from_producer: *description_prod_socgr_pow_vdem + Indicator name: `v2xeg_eqprotec` unit: '' display: numDecimalPlaces: 3 - ## 5.4.3 Presidentialism Index - personalism_vdem: - title: Presidentialism Index + ## 2.2.21 Equal distribution of resources index + equal_res_vdem: + title: Equal resource distribution index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. - description_from_producer: &description_prod_personalism_vdem |- - Question: To what extent is the regime characterized by presidentialism? + << estimate.title() >> estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. + description_from_producer: |- + Question: How equal is the distribution of resources? - Clarification: - Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem's index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. + Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. Scale: Interval, from low to high (0-1). - Indicator name: `v2xnp_pres` + Indicator name: `v2xeg_eqdr` unit: '' display: numDecimalPlaces: 3 - personalism_vdem_low: - title: "{tables.vdem.variables.personalism_vdem.title} (lower bound)" - description_from_producer: *description_prod_personalism_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 2.2.4 Freedom of association thick index + freeassoc_vdem: + title: Freedom of association thick index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which parties, including opposition parties, are allowed to form and participate in elections, and the extent to which civil society organizations are allowed to form and operate freely. + description_from_producer: |- + Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? + + Scale: Interval, from low to high (0-1). - personalism_vdem_high: - title: "{tables.vdem.variables.personalism_vdem.title} (upper bound)" - description_from_producer: *description_prod_personalism_vdem + Indicator name: `v2x_frassoc_thick` unit: '' display: numDecimalPlaces: 3 - ## 5.5.1 Civil liberties index - civ_libs_vdem: - title: Civil liberties index + ## 2.2.3 Freedom of Expression and Alternative Sources of Information index + freeexpr_vdem: + title: Freedom of Expression and Alternative Sources of Information index (<< estimate >> estimate) description_short: |- - Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. - description_from_producer: &description_prod_civ_libs_dem |- - Question: To what extent is civil liberty respected? + << estimate.title() >> estimate of the extent to which people can discuss political matters at home and in the public sphere, the press and media are free and can present different political perspectives, and the freedom of academic and cultural expression. + description_from_producer: |- + Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? - Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. + Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_civlib` + Indicator name: `v2x_freexp_altinf` unit: '' display: numDecimalPlaces: 3 - civ_libs_vdem_low: - title: "{tables.vdem.variables.civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_civ_libs_dem - unit: '' - display: - numDecimalPlaces: 3 + ## 2.2.9 Equality before the law and individual liberty index + indiv_libs_vdem: + title: Equality before the law and individual liberty index (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which extent to which citizens enjoy physical integrity rights, freedoms of religion, of movement, and from forced labor, as well as access to justice, laws are transparent and public administration is impartial. + description_from_producer: |- + Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? - civ_libs_vdem_high: - title: "{tables.vdem.variables.civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_civ_libs_dem + Scale: Interval, from low to high (0-1). + + Indicator name: `v2xcl_rol` unit: '' display: numDecimalPlaces: 3 - ## 5.5.4 Private civil liberties index - priv_libs_vdem: - title: Private civil liberties index + ## 2.2.10 Judicial constraints on the executive index + judicial_constr_vdem: + title: Judicial constraints on the executive index (<< estimate >> estimate) description_short: |- - Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. - description_from_producer: &description_prod_priv_libs_vdem |- - Question: To what extent are private liberties respected? - - Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. + << estimate.title() >> estimate of the extent to which the executive respects the constitution, complies with the judiciary and high courts, and higher and lower courts are independent. + description_from_producer: |- + Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? Scale: Interval, from low to high (0-1). - Indicator name: `v2x_clpriv` + Indicator name: `v2x_jucon` unit: '' display: numDecimalPlaces: 3 - priv_libs_vdem_low: - title: "{tables.vdem.variables.priv_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_priv_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## 3.6.0.2 Common good + justcomgd_polch_vdem: + title: Common good justifications (<< estimate >> estimate) + description_short: |- + << estimate.title() >> estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. + description_from_producer: |- + Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? + + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. + + Responses: + 0: Little or no justification in terms of the common good is usually offered. + 1: Specific business, geographic, group, party, or constituency interests are for the most part offered as justifications. + 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. + 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. + 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. - priv_libs_vdem_high: - title: "{tables.vdem.variables.priv_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_priv_libs_vdem + Indicator name: `v2dlcommon` unit: '' display: numDecimalPlaces: 3 - ## 5.5.3 Political civil liberties index - pol_libs_vdem: - title: Political civil liberties index + ## 3.6.0.1 Reasoned justification + justified_polch_vdem: + title: Justified political positions (<< estimate >> estimate) description_short: |- - Central estimate of the extent to which people enjoy the freedoms of expression and association. - description_from_producer: &description_prod_pol_libs_vdem |- - Question: To what extent are political liberties respected? - - Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. + << estimate.title() >> estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. + description_from_producer: |- + Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? - Scale: Interval, from low to high (0-1). + Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. - Indicator name: `v2x_clpol` - unit: '' - display: - numDecimalPlaces: 3 + Responses: - pol_libs_vdem_low: - title: "{tables.vdem.variables.pol_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_pol_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 + 0: No justification. Elites almost always only dictate that something should or should not be done, but no reasoning about justification is given. For example, "We must cut spending." + 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] + 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." + 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." - pol_libs_vdem_high: - title: "{tables.vdem.variables.pol_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_pol_libs_vdem + Indicator name: `v2dlreason` unit: '' display: numDecimalPlaces: 3 - ## 5.5.2 Physical violence index - phys_integr_libs_vdem: - title: Physical integrity liberties + ## 2.2.11 Legislative constraints on the executive index + legis_constr_vdem: + title: Legislative constraints on the executive index (<< estimate >> estimate) description_short: |- - Central estimate of the extent to which people are free from government torture and political killings. - description_from_producer: &description_prod_phys_integr_libs_vdem |- - Question: To what extent is physical integrity respected? + << estimate.title() >> estimate of the extent to which the legislature, including opposition parties, questions executive officials and oversees and investigates the executive. + description_from_producer: |- + Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? - Clarification: Physical integrity is understood as freedom from political killings and torture by the government. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect violence committed by government agents and that are not directly referring to elections. + Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? Scale: Interval, from low to high (0-1). - Indicator name: `v2x_clphy` + Indicator name: `v2xlg_legcon` unit: '' display: numDecimalPlaces: 3 - phys_integr_libs_vdem_low: - title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_phys_integr_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index + lib_dich_row: + title: Liberal political institutions (<< estimate >> estimate) (re-estimate) + description_short: << estimate.title() >> estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). - phys_integr_libs_vdem_high: - title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_phys_integr_libs_vdem + {definitions.auxiliary.description_processing_row} unit: '' display: - numDecimalPlaces: 3 - - ## 5.7.1 Political corruption index - corruption_vdem: - title: Political corruption index - description_short: |- - Best estimate of the extent to which a country is affected by political corruption. - description_from_producer: &description_prod_corruption_vdem |- - Question: How pervasive is political corruption? - - Clarification: The directionality of the V-Dem corruption index runs from less corrupt to more corrupt unlike the other V-Dem variables that generally run from less democratic to more democratic situation. The corruption index includes measures of six distinct types of corruption that cover both different areas and levels of the polity realm, distinguishing between executive, legislative and judicial corruption. Within the executive realm, the measures also distinguish between corruption mostly pertaining to bribery and corruption due to embezzlement. Finally, they differentiate between corruption in the highest echelons of the executive at the level of the rulers/cabinet on the one hand, and in the public sector at large on the other. The measures thus tap into several distinguished types of corruption: both 'petty' and 'grand'; both bribery and theft; both corruption aimed and influencing law making and that affecting implementation. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_corr` - unit: '' - display: - numDecimalPlaces: 3 - - corruption_vdem_low: - title: "{tables.vdem.variables.corruption_vdem.title} (lower bound)" - description_from_producer: *description_prod_corruption_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corruption_vdem_high: - title: "{tables.vdem.variables.corruption_vdem.title} (upper bound)" - description_from_producer: *description_prod_corruption_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.7.3 Public sector corruption index [Not in use] - corr_publsec_vdem: - title: Public sector corruption index - description_from_producer: &description_prod_corr_publsec_vdem |- - Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? - - Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_pubcorr` - unit: '' - display: - numDecimalPlaces: 3 - - corr_publsec_vdem_low: - title: "{tables.vdem.variables.corr_publsec_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_publsec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_publsec_vdem_high: - title: "{tables.vdem.variables.corr_publsec_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_publsec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.7.2 Executive corruption index [Not in use] - corr_exec_vdem: - title: Executive corruption index - description_from_producer: &description_prod_corr_exec_vdem |- - Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? - - Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_execorr` - unit: '' - display: - numDecimalPlaces: 3 - - corr_exec_vdem_low: - title: "{tables.vdem.variables.corr_exec_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_exec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_exec_vdem_high: - title: "{tables.vdem.variables.corr_exec_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_exec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.8.1 Women political empowerment index - wom_emp_vdem: - title: Women's political empowerment index - description_short: |- - Best estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. - description_from_producer: &description_prod_wom_emp_vdem |- - Question: How politically empowered are women? - - Clarification: Women's political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women's open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_gender` - unit: '' - display: - numDecimalPlaces: 3 - - wom_emp_vdem_low: - title: "{tables.vdem.variables.wom_emp_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_emp_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_emp_vdem_high: - title: "{tables.vdem.variables.wom_emp_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_emp_vdem - unit: '' - display: - numDecimalPlaces: 3 + numDecimalPlaces: 0 - ## 5.8.2 Women civil liberties index - wom_civ_libs_vdem: - title: Women's civil rights index + ## 2.2.8 Liberal component index + lib_vdem: + title: Liberal component index (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. - description_from_producer: &description_prod_wom_civ_libs_vdem |- - Question: Do women have the ability to make meaningful decisions in key areas of their lives? + << estimate.title() >> estimate of the extent of individual and minority rights, equality before the law, and executive constraints. + description_from_producer: |- + Question: To what extent is the liberal principle of democracy achieved? - Clarification: Women's civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. + Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_gencl` - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_libs_vdem_low: - title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_libs_vdem_high: - title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_civ_libs_vdem + Indicator name: `v2x_liberal` unit: '' display: numDecimalPlaces: 3 - ## 5.8.3 Women civil society participation index - wom_civ_soc_vdem: - title: Women's civil society participation index + ## 2.2.15 Local government index + locelect_vdem: + title: Elected local governments (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. - description_from_producer: &description_prod_wom_civ_soc_vdem |- - Question: Do women have the ability to express themselves and to form and participate in groups? + << estimate.title() >> estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. + description_from_producer: |- + Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? - Clarification: Women's civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. + Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_gencs` - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_soc_vdem_low: - title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_civ_soc_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_soc_vdem_high: - title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_civ_soc_vdem + Indicator name: `v2xel_locelec` unit: '' display: numDecimalPlaces: 3 - ## 5.8.4 Women political participation index - wom_pol_par_vdem: - title: Women's political participation index + ## 2.2.12 Participatory component index + particip_vdem: + title: Participatory political institutions (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which women are represented in the legislature and have an equal share of political power. - description_from_producer: &description_prod_wom_pol_par_vdem |- - Question: Are women descriptively represented in formal political positions? + << estimate.title() >> estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. + description_from_producer: |- + Question: To what extent is the participatory principle achieved? - Clarification: Women's political participation is understood to include women's descriptive representation in the legislature and an equal share in the overall distribution of power. + Clarification: + The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_genpp` - unit: '' - display: - numDecimalPlaces: 3 - - wom_pol_par_vdem_low: - title: "{tables.vdem.variables.wom_pol_par_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_pol_par_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_pol_par_vdem_high: - title: "{tables.vdem.variables.wom_pol_par_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_pol_par_vdem + Indicator name: `v2x_partip` unit: '' display: numDecimalPlaces: 3 - ## 5.9.1 Rule of law index - rule_of_law_vdem: - title: Rule of Law index + ## 2.2.16 Regional government index + regelect_vdem: + title: Elected regional governments (<< estimate >> estimate) description_short: |- - Best estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. - description_from_producer: &description_prod_rule_of_law_vdem |- - Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_rule` - unit: '' - display: - numDecimalPlaces: 3 - - rule_of_law_vdem_low: - title: "{tables.vdem.variables.rule_of_law_vdem.title} (lower bound)" - description_from_producer: *description_prod_rule_of_law_vdem - unit: '' - display: - numDecimalPlaces: 3 - - rule_of_law_vdem_high: - title: "{tables.vdem.variables.rule_of_law_vdem.title} (upper bound)" - description_from_producer: *description_prod_rule_of_law_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.11.1 Core civil society index [not in use] - civ_soc_str_vdem: - title: Core civil society index - description_from_producer: &description_prod_civ_soc_str_vdem |- - Question: How robust is civil society? - - Clarification: The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. + << estimate.title() >> estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. + description_from_producer: |- + Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? - The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. + Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. Scale: Interval, from low to high (0-1). - Indicator name: `v2xcs_ccsi` - unit: '' - display: - numDecimalPlaces: 3 - - civ_soc_str_vdem_low: - title: "{tables.vdem.variables.civ_soc_str_vdem.title} (lower bound)" - description_from_producer: *description_prod_civ_soc_str_vdem - unit: '' - display: - numDecimalPlaces: 3 - - civ_soc_str_vdem_high: - title: "{tables.vdem.variables.civ_soc_str_vdem.title} (upper bound)" - description_from_producer: *description_prod_civ_soc_str_vdem + Indicator name: `v2xel_regelec` unit: '' display: numDecimalPlaces: 3 - ## 9.4.2 Government effectiveness - goveffective_vdem_wbgi: - title: Government effectiveness + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement + transplaws_row: + title: Transparent laws with predictable enforcement (<< estimate >> estimate) (re-estimate) description_short: |- - Denotes perceptions of the quality of public services, the civil service, and policy formulation and implementation (positive values mean higher effectiveness) based on the data from the World Governance Indicators. - + << estimate.title() >> estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. description_from_producer: |- - "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government's commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. - - Indicator name: `e_wbgi_gee` - unit: '' - display: - numDecimalPlaces: 3 - - ## 9.9.3 Corruption perception index [not in use] - corruption_cpi: - title: Corruption perceptions index - description_from_producer: |- - The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). - - Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. - unit: '' - display: - numDecimalPlaces: 0 + Question: Are the laws of the land clear, well publicized, coherent (consistent with each other), relatively stable from year to year, and enforced in a predictable manner? - ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty - electmulpar_row: - title: Multiparty elections (re-estimate) - description_short: |- - Best estimate of whether national multi-party elections were held or not. - description_from_producer: &description_prod_electmulpar_vdem |- - Question: Question: Was this national election multiparty? + Clarification: This question focuses on the transparency and predictability of the laws of the land. Responses: - 0: No. No-party or single-party and there is no meaningful competition (includes situations where a few parties are legal but they are all de facto controlled by the dominant party). - 1: Not really. No-party or single-party (defined as above) but multiple candidates from the same party and/or independents contest legislative seats or the presidency. - 2: Constrained. At least one real opposition party is allowed to contest but competition is highly constrained — legally or informally. - 3: Almost. Elections are multiparty in principle but either one main opposition party is prevented (de jure or de facto) from contesting, or conditions such as civil unrest (excluding natural disasters) prevent competition in a portion of the territory. - 4: Yes. Elections are multiparty, even though a few marginal parties may not be permitted to contest (e.g. far-right/left extremist parties, anti-democratic religious or ethnic parties). + 0: Transparency and predictability are almost non-existent. The laws of the land are created and/or enforced in completely arbitrary fashion. + 1: Transparency and predictability are severely limited. The laws of the land are more often than not created and/or enforced in arbitrary fashion. + 2: Transparency and predictability are somewhat limited. The laws of the land are mostly created in a non-arbitrary fashion but enforcement is rather arbitrary in some parts of the country. + 3: Transparency and predictability are fairly strong. The laws of the land are usually created and enforced in a non-arbitrary fashion. + 4: Transparency and predictability are very strong. The laws of the land are created and enforced in a non-arbitrary fashion. Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_electmulpar_row |- - We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2cltrnslw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). {definitions.auxiliary.description_processing_row} unit: '' display: numDecimalPlaces: 0 - electmulpar_high_row: - title: "{tables.vdem.variables.electmulpar_row.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether national multi-party elections were held or not. - description_from_producer: *description_prod_electmulpar_vdem - description_processing: *description_processing_electmulpar_row - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_low_row: - title: "{tables.vdem.variables.electmulpar_row.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether national multi-party elections were held or not. - description_from_producer: *description_prod_electmulpar_vdem - description_processing: *description_processing_electmulpar_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [CUSTOM] - electmulpar_hoe_row_owid: - title: Multi-party elections for government's chief executive - description_short: |- - - unit: '' - description_processing: &description_processing_electmulpar_hoe_row_owid |- - {definitions.auxiliary.description_processing_row} - - Finally, we make some additional minor changes to the coding rules. - - The two most consequential changes we make relate to RoW's identification of whether a country's chief executive is elected. First, one way RoW considers a chief executive to have been elected — even if they are not directly elected or appointed by the legislature — is if they are the head of state, they depend on the approval of the legislature, and there were multi-party elections for the executive. This last part is likely a coding error because to be consistent with RoW's other definitions, this should depend on multi-party legislative, not executive, elections. Only if the legislature has been chosen in multi-party elections does it make an otherwise unelected chief executive—who must be approved by that legislature—dependent on multi-party elections. We correct this error. - - Second, RoW considers a chief executive to have been elected if the country had chosen both its legislature and executive in multi-party elections. But this considers some chief executives as elected even if they came to power through force after elections were previously held. Examples include the coup d'états led by Fulgencio Batista in Cuba in 1952 and by Muhammadu Buhari in Nigeria in 1983. We instead consider such chief executives as unelected. - display: - numDecimalPlaces: 0 - - electmulpar_hoe_high_row_owid: - title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (upper bound)" - unit: '' - description_processing: *description_processing_electmulpar_hoe_row_owid - display: - numDecimalPlaces: 0 - - electmulpar_hoe_low_row_owid: - title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (lower bound)" - unit: '' - description_processing: *description_processing_electmulpar_hoe_row_owid - display: - numDecimalPlaces: 0 - - ## [CUSTOM, based on `v2elmulpar_osp`] - electmulpar_leg_row: - title: Multiparty elections for legislature - description_short: |- - Best estimate of whether multi-party elections for the national legislature were held or not. - description_processing: &description_proc_electmulpar_leg_row |- - Use the value from `v2elmulpar_osp` whenever `v2eltype` is 0, 1, 4 or 5. Otherwise the value is missing. - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_leg_high_row: - title: "{tables.vdem.variables.electmulpar_leg_row.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether multi-party elections for the national legislature were held or not. - description_processing: *description_proc_electmulpar_leg_row - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_leg_low_row: - title: "{tables.vdem.variables.electmulpar_leg_row.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether multi-party elections for the national legislature were held or not. - description_processing: *description_proc_electmulpar_leg_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index - electdem_dich_row_owid: - title: Electoral democracy (re-estimate) - description_short: |- - Best estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - description_processing: |- - We employ Lührmann et al.'s criteria and use a threshold of 0.5 to classify the original indicator (`v2x_polyarchy_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - electdem_dich_high_row_owid: - title: "{tables.vdem.variables.electdem_dich_row_owid.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 0 - - electdem_dich_low_row_owid: - title: "{tables.vdem.variables.electdem_dich_row_owid.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair - electfreefair_row: - title: Free and fair elections (re-estimate) - description_short: Best estimate of whether national elections were free and fair or not. - description_from_producer: &description_prod_electfreefair_row |- - Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? - - Clarification: The only thing that should not be considered in coding this is the extent of suffrage (by law). Thus, a free and fair election may occur even if the law excludes significant groups (an issue measured separately). - - Responses: - 0: No, not at all. The elections were fundamentally flawed and the official results had little if anything to do with the 'will of the people' (i.e., who became president; or who won the legislative majority). - 1: Not really. While the elections allowed for some competition, the irregularities in the end affected the outcome of the election (i.e., who became president; or who won the legislative majority). - 2: Ambiguous. There was substantial competition and freedom of participation but there were also significant irregularities. It is hard to determine whether the irregularities affected the outcome or not (as defined above). - 3: Yes, somewhat. There were deficiencies and some degree of fraud and irregularities but these did not in the end affect the outcome (as defined above). - 4: Yes. There was some amount of human error and logistical restrictions but these were largely unintentional and without significant consequences. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_electfreefair_row |- - We employ Lührmann et al.'s criteria and use a threshold of 2 to classify the original indicator (`v2elfrfair_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - electfreefair_high_row: - title: "{tables.vdem.variables.electfreefair_row.title} (upper bound)" - description_short: Upper-bound estimate of whether national elections were free and fair or not. - description_from_producer: *description_prod_electfreefair_row - description_processing: *description_processing_electfreefair_row - unit: '' - display: - numDecimalPlaces: 0 - - electfreefair_low_row: - title: "{tables.vdem.variables.electfreefair_row.title} (lower bound)" - description_short: Lower-bound estimate of whether national elections were free and fair or not. - description_from_producer: *description_prod_electfreefair_row - description_processing: *description_processing_electfreefair_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index - lib_dich_row: - title: Liberal political institutions (re-estimate) - description_short: Best estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: &description_processing_lib_dich_row |- - We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - lib_dich_high_row: - title: "{tables.vdem.variables.lib_dich_row.title} (upper bound)" - description_short: Upper-bound estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: *description_processing_lib_dich_row - unit: '' - display: - numDecimalPlaces: 0 - - lib_dich_low_row: - title: "{tables.vdem.variables.lib_dich_row.title} (lower bound)" - description_short: Lower-bound estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: *description_processing_lib_dich_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men - accessjust_m_row: - title: Access to justice for men (re-estimate) - description_short: Best estimate of whether men have access to justice or not. - description_from_producer: &description_prod_accessjust_m_row |- - Question: Do men enjoy secure and effective access to justice? - - Clarification: This question specifies the extent to which men can bring cases before the courts without risk to their personal safety, trials are fair, and men have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - - This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. - - Responses: - 0: Secure and effective access to justice for men is non-existent. - 1: Secure and effective access to justice for men is usually not established or widely respected. 2: Secure and effective access to justice for men is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. - 3: Secure and effective access to justice for men is usually observed. - 4: Secure and effective access to justice for men is almost always observed. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_accessjust_m_row |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstm_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_m_high_row: - title: "{tables.vdem.variables.accessjust_m_row.title} (upper bound)" - description_short: Upper-bound estimate of whether men have access to justice or not. - description_from_producer: *description_prod_accessjust_m_row - description_processing: *description_processing_accessjust_m_row - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_m_low_row: - title: "{tables.vdem.variables.accessjust_m_row.title} (lower bound)" - description_short: Lower-bound estimate of whether men have access to justice or not. - description_from_producer: *description_prod_accessjust_m_row - description_processing: *description_processing_accessjust_m_row - unit: '' - display: - numDecimalPlaces: 0 - - # [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women - accessjust_w_row: - title: Access to justice for women (re-estimate) - description_short: Best estimate of whether women have access to justice or not. - description_from_producer: &description_prod_accessjust_w_row |- - Question: Do women enjoy equal, secure, and effective access to justice? - - Clarification: This question specifies the extent to which women can bring cases before the courts without risk to their personal safety, trials are fair, and women have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - - This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. - - Responses: - 0: Secure and effective access to justice for women is non-existent. - 1: Secure and effective access to justice for women is usually not established or widely respected. 2: Secure and effective access to justice for women is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. - 3: Secure and effective access to justice for women is usually observed. - 4: Secure and effective access to justice for women is almost always observed. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_accessjust_w_row |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_w_high_row: - title: "{tables.vdem.variables.accessjust_w_row.title} (upper bound)" - description_short: Upper-bound estimate of whether women have access to justice or not. - description_from_producer: *description_prod_accessjust_w_row - description_processing: *description_processing_accessjust_w_row - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_w_low_row: - title: "{tables.vdem.variables.accessjust_w_row.title} (lower bound)" - description_short: Lower-bound estimate of whether women have access to justice or not. - description_from_producer: *description_prod_accessjust_w_row - description_processing: *description_processing_accessjust_w_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement - transplaws_row: - title: Transparent laws with predictable enforcement (re-estimate) - description_short: |- - Best estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: &description_prod_transplaws |- - Question: Are the laws of the land clear, well publicized, coherent (consistent with each other), relatively stable from year to year, and enforced in a predictable manner? - - Clarification: This question focuses on the transparency and predictability of the laws of the land. - - Responses: - 0: Transparency and predictability are almost non-existent. The laws of the land are created and/or enforced in completely arbitrary fashion. - 1: Transparency and predictability are severely limited. The laws of the land are more often than not created and/or enforced in arbitrary fashion. - 2: Transparency and predictability are somewhat limited. The laws of the land are mostly created in a non-arbitrary fashion but enforcement is rather arbitrary in some parts of the country. - 3: Transparency and predictability are fairly strong. The laws of the land are usually created and enforced in a non-arbitrary fashion. - 4: Transparency and predictability are very strong. The laws of the land are created and enforced in a non-arbitrary fashion. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_transplaws |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2cltrnslw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - transplaws_high_row: - title: "{tables.vdem.variables.transplaws_row.title} (upper bound)" - description_short: |- - Upper estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: *description_prod_transplaws - description_processing: *description_processing_transplaws - unit: '' - display: - numDecimalPlaces: 0 - - transplaws_low_row: - title: "{tables.vdem.variables.transplaws_row.title} (lower bound)" - description_short: |- - Lower estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: *description_prod_transplaws - description_processing: *description_processing_transplaws - unit: '' - display: - numDecimalPlaces: 0 - - ## HOE female (custom) - # NOTE: Add adjustment in citation_full - wom_hoe_vdem: # wom_hoe_vdem_owid - title: Woman head of executive - description_short: |- - The variable denotes whether the chief executive of government in office on December 31 is a woman. - description_processing: |- - Assigns the value based on the gender of the most powerful chief: either Head of state or Head of government. - - Uses gender from HOS: - - If head of state is more powerful than head of government, and head of state is the head of the executive. - - If head of state is also head of government. - - If head of government is less powerful than head of state. - - Uses HOG if: - - If head of state is less powerful than head of government - - We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. - unit: '' - display: - numDecimalPlaces: 0 - - ## Other regime indicators - regime_amb_row_owid: - title: Political regime (inc. ambiguous categories) - unit: '' - description_short: |- - Political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg, including ambiguous categories. - description_key: - - It distinguishes between closed autocracies (score 0), electoral autocracies (score 3), electoral democracies (score 6), and liberal democracies (score 9) as the main types. - - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. - - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). - description_processing: "{definitions.auxiliary.description_processing_row}" - display: - numDecimalPlaces: 0 - - regime_redux_row_owid: - title: Political regime - description_short: |- - Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. - description_key: - - It distinguishes between closed autocracies (score 0), electoral autocracies (score 1), and electoral democracies (score 2, including liberal democracies). - - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. - - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - description_processing: "{definitions.auxiliary.description_processing_row}" - unit: '' - display: - numDecimalPlaces: 0 - - # NEW - num_years_in_electdem_consecutive: # electdem_age_row_owid - title: Age of electoral democracy - description_short: Number of consecutive years in electoral democracy. - description_key: &description_key_num_electdem - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - unit: years - - num_years_in_electdem: # electdem_exp_row_owid - title: Experience with electoral democracy - description_short: Number of total years in electoral democracy. It sums all periods of electoral democracy. - description_key: *description_key_num_electdem - unit: years - - num_years_in_electdem_cat: # electdem_age_group_row_owid - title: Electoral democracy age group - description_short: Category of electoral democracies based on the country's age of electoral democracy. - description_key: *description_key_num_electdem - unit: '' - - num_years_in_libdem_consecutive: # libdem_age_row_owid - title: Age of liberal democracy - description_short: Number of consecutive years in electoral democracy. - description_key: &description_key_num_libdem - - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - unit: years - - num_years_in_libdem: # libdem_exp_row_owid - title: Experience with liberal democracy - description_processing: Number of total years in liberal democracy. It sums all periods of liberal democracy. - description_key: *description_key_num_libdem - unit : years - - num_years_in_libdem_cat: # libdem_age_group_row_owid - title: Liberal democracy age group - description_short: Category of liberal democracies based on the country's age of liberal democracy. - description_processing: Number of consecutive years in liberal democracy. - description_key: *description_key_num_libdem - unit : '' - - wom_parl_vdem_cat: # wom_parl_gr_vdem_owid - title: Women in parliament (category) - description_short: Categorisation of women's political representation in parliament - unit: '' - - # Not used - regime_imputed: - title: Data imputed from another country - description_short: Denotes whether we imputed regime information from another country this one was historically a part of. - unit: '' - display: - numDecimalPlaces: 0 - - regime_row_owid: - title: regime_row_owid - unit: '' - display: - numDecimalPlaces: 0 + ################################################################################################## + ################################################################################################## + # TABLE: COUNT OF COUNTRIES IN X REGIME + vdem_num_countries: + common: + unit: "countries" + variables: + num_countries_regime: + title: |- + <% if category == '-1' %> + Number of countries with unknown regime + <% else %> + Number of << category.replace('cracy', 'cracies') >> + <% endif %> + num_countries_regime_amb: + title: |- + <% if category == '-1' %> + Number of countries with unknown (ambiguous) regime + <% else %> + Number of << category.replace('cracy', 'cracies') >> (ambiguous) + <% endif %> + + num_countries_hoe: + title: |- + <% if category == '-1' %> + Number of countries in which chief executive's gender is unknown + <% else %> + Number of countries in which chief executive is a << category.lower() >> + <% endif %> + num_countries_hog: + title: |- + <% if category == '-1' %> + Number of countries in which head of government's gender is unknown + <% else %> + Number of countries in which head of government is a << category.lower() >> + <% endif %> + num_countries_hos: + title: |- + <% if category == '-1' %> + Number of countries in which head of state's gender is unknown + <% else %> + Number of countries in which head of state is a << category.lower() >> + <% endif %> + num_countries_wom_parl: + title: | + <% if category == '-1' %> + Number of countries with an unknown number of women in parliament + <% elif category == '0% women' %> + Number of countries with no women in parliament + <% else %> + Number of countries with << category >> in parliament + <% endif %> + unit: "countries" + + num_countries_years_in_electdem: + title: |- + <% if category == '-1' %> + Number of electoral democracies with an unknown age + <% else %> + Number of electoral democracies aged << category >> + <% endif %> + num_countries_years_in_libdem: + title: |- + <% if category == '-1' %> + Number of liberal democracies with an unknown age + <% else %> + Number of liberal democracies aged << category >> + <% endif %> + + ################################################################################################## + ################################################################################################## + # TABLE: NUMBER OF PEOPLE LIVING IN COUNTRIES WITH X REGIME + vdem_population: + common: + unit: "people" + variables: + population_regime: + title: |- + <% if category == '-1' %> + People living in countries without regime data + <% else %> + People living in << category.replace('cracy', 'cracies') >> + <% endif %> + population_regime_amb: + title: |- + <% if category == '-1' %> + People living in countries without regime (ambiguous) data + <% else %> + People living in << category.replace('cracy', 'cracies') >> (ambiguous) + <% endif %> + + population_hoe: + title: |- + <% if category == '-1' %> + People living in countries in which chief executive's gender is unknown + <% else %> + People living in countries in which head of executive is a << category.lower() >> + <% endif %> + population_hog: + title: |- + <% if category == '-1' %> + People living in countries in which head of executive's gender is unknown + <% else %> + People living in countries in which head of government is a << category.lower() >> + <% endif %> + population_hos: + title: |- + <% if category == '-1' %> + People living in countries in which head of state's gender is unknown + <% else %> + People living in countries in which head of state is a << category.lower() >> + <% endif %> + + population_wom_parl: + title: | + <% if category == '-1' %> + People living in countries with an unknown number of women in parliament + <% elif category == '0% women' %> + People living in countries with no women in parliament + <% else %> + People living in countries with << category >> in parliament + <% endif %> + unit: "countries" + + population_years_in_electdem: + title: |- + <% if category == '-1' %> + People living in electoral democracies with an unknown age + <% else %> + People living in electoral democracies aged << category >> + <% endif %> + population_years_in_libdem: + title: |- + <% if category == '-1' %> + People living in liberal democracies with an unknown age + <% else %> + People living in liberal democracies aged << category >> + <% endif %> diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem.py similarity index 74% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem.py index e7d2282e760..3e2fb219c9b 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.py @@ -3,12 +3,12 @@ from copy import deepcopy from typing import cast +import vdem_aggregate as aggregate # VDEM's aggregating library import vdem_clean as clean # VDEM's cleaning library import vdem_impute as impute # VDEM's imputing library import vdem_refine as refine # VDEM's imputing library from owid.catalog import Table -from etl.data_helpers import geo from etl.helpers import PathFinder, create_dataset # Get paths and naming conventions for current step. @@ -72,34 +72,74 @@ def run(dest_dir: str) -> None: # # %% Copy origins # Copy origins (some indicators will loose their 'origins' in metadata) - origins = deepcopy(tb["country"].metadata.origins) + origins = tb["country"].metadata.origins # %% PART 1: CLEAN # The following lines (until "PART 2") are the cleaning steps. # This is a transcription from Bastian's work: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_clean.do - - tb = clean.run(tb) + paths.log.info("1/ Cleaning data...") + tb = clean.run(tb, paths.country_mapping_path) # %% PART 2: IMPUTE # The following lines concern imputing steps. # Equivalent to: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do - + paths.log.info("2/ Imputing data...") tb = impute.run(tb) # %% PART 3: REFINE + paths.log.info("3/ Refining data...") tb = refine.run(tb) - # %% Add origins in case any was lost, adjust citation full - # Bring origins back - columns = [col for col in tb.columns if col not in ["country", "year"]] - for col in columns: - tb[col].metadata.origins = origins + # %% PART 4: AGGREGATES + paths.log.info("4/ Aggregating data...") + tb_uni, tb_multi_without_regions, tb_multi_with_regions, tb_countries_counts, tb_population_counts = aggregate.run( + tb, ds_regions, ds_population + ) + + # %% PART 5: Format and prepare tables + paths.log.info("5/ Formatting tables...") + tb_uni = tb_uni.format() + tb_multi_without_regions = tb_multi_without_regions.format( + keys=["country", "year", "estimate"], short_name="vdem_multi_without_regions" + ) + tb_multi_with_regions = tb_multi_with_regions.format( + keys=["country", "year", "estimate", "aggregate_method"], short_name="vdem_multi_with_regions" + ) + tb_countries_counts = tb_countries_counts.format( + keys=["country", "year", "category"], short_name="vdem_num_countries" + ) + tb_population_counts = tb_population_counts.format( + keys=["year", "country", "category"], short_name="vdem_population" + ) + tables = [ + # Main indicators (uni-dimensional) + tb_uni, + # Main indicators (multi-dimensional) without regions + tb_multi_without_regions, + # Main indicators (multi-dimensional) with regions + tb_multi_with_regions, + # Number of countries with X properties + tb_countries_counts, + # Number of people living in countries with X property + tb_population_counts, + ] + + # Add origins in case any was lost, adjust citation full + for tb in tables: + columns = [col for col in tb.columns if col not in ["country", "year"]] + for col in columns: + tb[col].metadata.origins = deepcopy(origins) + + # %% Save + # + # Save outputs. + # # Tweak citation full for some indicators - tb = adjust_citation_full(tb) + # tb = adjust_citation_full(tb.copy()) # %% Set index - tb = tb.format() + # tb = tb.format() # %% Save # @@ -107,7 +147,7 @@ def run(dest_dir: str) -> None: # # Create a new garden dataset with the same metadata as the meadow dataset. ds_garden = create_dataset( - dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata + dest_dir, tables=tables, check_variables_metadata=True, default_metadata=ds_meadow.metadata ) # Save changes in the new garden dataset. @@ -201,17 +241,17 @@ def append_citation_full(tb: Table) -> Table: **{f"wom_emp_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, **{f"wom_pol_par_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, # Combined citations - **{f"egal_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_COPPEDGE}" for dim in DIMENSIONS}, - **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, - **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017); {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"egal_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_COPPEDGE}" for dim in DIMENSIONS}, + **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017);\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, ## - **{f"equal_res_vdem{dim}": f"{CITATION_SIGMAN}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"equal_res_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, **{ f"personalism_vdem{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" for dim in DIMENSIONS }, - **{f"wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, - **{f"wom_civ_soc_vdem{dim}": f"{CITATION_SUNDSTROM}; {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + **{f"wom_civ_soc_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, } for indicator_name, citation_additional in citation_full.items(): tb[indicator_name].metadata.origins[0].citation_full += f";\n\n{citation_additional}" diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py new file mode 100644 index 00000000000..a08bad03475 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py @@ -0,0 +1,705 @@ +"""Load a meadow dataset and create a garden dataset.""" +from itertools import chain +from typing import Dict, Optional, Tuple, cast + +import pandas as pd +from owid.catalog import Dataset, Table +from owid.catalog.processing import concat +from shared import add_population_in_dummies, expand_observations, from_wide_to_long + +from etl.data_helpers import geo +from etl.helpers import PathFinder, create_dataset + +# Get paths and naming conventions for current step. +paths = PathFinder(__file__) + +# REGION AGGREGATES +REGIONS = { + "Africa": { + "additional_members": [ + "Somaliland", + "Zanzibar", + ] + }, + "Asia": { + "additional_members": [ + "Palestine/Gaza", + "Palestine/West Bank", + ] + }, + "North America": {}, + "South America": {}, + "Europe": { + "additional_members": [ + "Baden", + "Bavaria", + "Brunswick", + "Duchy of Nassau", + "Hamburg", + "Hanover", + "Hesse Electoral", + "Hesse Grand Ducal", + "Mecklenburg Schwerin", + "Modena", + "Oldenburg", + "Parma", + "Piedmont-Sardinia", + "Saxe-Weimar-Eisenach", + "Saxony", + "Tuscany", + "Two Sicilies", + "Wurttemberg", + ] + }, + "Oceania": {}, +} +# Indicators for which we estimate region-averages +_indicators_avg = [ + "electdem_vdem", + "libdem_vdem", + "participdem_vdem", + "delibdem_vdem", + "egal_vdem", + "civ_libs_vdem", + "phys_integr_libs_vdem", + "pol_libs_vdem", + "priv_libs_vdem", + "wom_emp_vdem", + "wom_civ_libs_vdem", + "wom_civ_soc_vdem", + "wom_pol_par_vdem", + "socgr_civ_libs_vdem", + "socgr_pow_vdem", + "terr_contr_vdem", + "rule_of_law_vdem", + "public_admin_vdem", + "int_auton_vdem", + "dom_auton_vdem", + "corruption_vdem", + "corr_publsec_vdem", + "corr_exec_vdem", + "corr_leg_vdem", + "corr_jud_vdem", + "personalism_vdem", + "civ_soc_str_vdem", +] +INDICATORS_REGION_AVERAGES = [[f"{ind_name}{dim}" for dim in ["", "_low", "_high"]] for ind_name in _indicators_avg] +INDICATORS_REGION_AVERAGES = list(chain.from_iterable(INDICATORS_REGION_AVERAGES)) + ["wom_parl_vdem"] + + +def run(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Tuple[Table, Table, Table, Table, Table]: + # Create table with sums and averages + tb_countries_counts, tb_countries_avg = make_table_countries(tb, ds_regions) + + # Create table with population-weighted averages + tb_population_counts, tb_population_avg = make_table_population(tb, ds_regions, ds_population) + + # Consolidate main table with additional regional aggregates + tb_uni, tb_multi_without_regions, tb_multi_with_regions = make_main_tables(tb, tb_countries_avg, tb_population_avg) + + return tb_uni, tb_multi_without_regions, tb_multi_with_regions, tb_countries_counts, tb_population_counts + + +# %% NUM_COUNTRIES TABLES +def make_table_countries(tb: Table, ds_regions: Dataset) -> Tuple[Table, Table]: + """Estimate number of countries in X and averages over countries for each region.""" + # Remove imputed countries (they did not exist, so should not count them!) + tb_ = tb.loc[~tb["regime_imputed"]].copy() + + # Convert country to string + tb_["country"] = tb_["country"].astype("string") + + # Sanity check: all countries are in the regions + members_tracked = set() + for region, region_props in REGIONS.items(): + members_tracked |= set( + geo.list_members_of_region(region, ds_regions, additional_members=region_props.get("additional_members")) + ) + assert tb_["country"].isin(members_tracked).all(), "Some countries are not in the regions!" + + # Generate counts of countries in X category + tb_sum = make_table_countries_counts(tb_, ds_regions) + # Generate averages of countries in X category + tb_avg = make_table_countries_avg(tb_, ds_regions) + + # Merge tb_sum and tb_avg. Sanity-check that there is no overlap in columns (except for index) + assert set(tb_sum.columns).intersection(set(tb_avg.columns)) == {"year", "country"}, "Unexpected column overlap!" + # tb_ = tb_sum.merge(tb_avg, on=["country", "year"], how="outer") + + return tb_sum, tb_avg + + +def make_table_countries_counts(tb: Table, ds_regions: Dataset) -> Table: + """Get region indicators of type "Number of countries".""" + tb_ = tb.copy() + # Generate dummy indicators + tb_ = make_table_with_dummies(tb_) + + # Estimate region aggregates + tb_ = add_regions_and_global_aggregates(tb_, ds_regions) + + # Sanity check on output shape + assert tb_.shape[1] == 52, "Unexpected number of columns." + + # Wide to long format + tb_ = from_wide_to_long(tb_) + + # Remove some dimensions + tb_.loc[ + tb_["category"].isin(["closed autocracy", "electoral autocracy", "electoral democracy"]), + ["num_countries_years_in_electdem", "num_countries_years_in_libdem"], + ] = float("nan") + + # Remove data pre-1900 for num_countries_wom_parl + tb_.loc[tb_["year"] < 1900, "num_countries_wom_parl"] = float("nan") + + return tb_ + + +def make_table_countries_avg(tb: Table, ds_regions: Dataset) -> Table: + """Get region indicators of type "Average of countries".""" + tb_ = tb.copy() + + # Keep only relevant columns + tb_ = tb_.loc[:, ["year", "country"] + INDICATORS_REGION_AVERAGES] + + # Estimate region aggregates + tb_ = add_regions_and_global_aggregates( + tb=tb_, + ds_regions=ds_regions, + aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, + ) + + # Sanity check on output shape + assert tb_.shape[1] == 84, "Unexpected number of columns." + + return tb_ + + +# %% POPULATION TABLES +def make_table_population(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Tuple[Table, Table]: + """Estimate number of people in X regime, and averages over countries for each region.""" + tb_ = tb.copy() + + # Drop historical countries (don't want to double-count population) + tb_ = expand_observations_without_leading_to_duplicates(tb_) + + # Generate counts of people in X category + tb_sum = make_table_population_counts(tb_, ds_regions, ds_population) + # Generate averages of countries in X category + tb_avg = make_table_population_avg(tb_, ds_regions, ds_population) + + # Merge tb_sum and tb_avg. Sanity-check that there is no overlap in columns (except for index) + assert set(tb_sum.columns).intersection(set(tb_avg.columns)) == {"year", "country"}, "Unexpected column overlap!" + + return tb_sum, tb_avg + + +def make_table_population_counts(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Table: + """Estimate number of people in X regime.""" + tb_ = tb.copy() + + # Get dummy indicators + tb_ = make_table_with_dummies(tb_) + + # Add population in dummies (population value replaces 1, 0 otherwise) + tb_ = add_population_in_dummies( + tb_, + ds_population, + expected_countries_without_population=[ + # Germany + "Baden", + "Bavaria", + "Brunswick", + "Duchy of Nassau", + "Hamburg", + "Hanover", + "Hesse Electoral", + "Hesse Grand Ducal", + "Mecklenburg Schwerin", + "Oldenburg", + "Saxony", + "Saxe-Weimar-Eisenach", + "Wurttemberg", + "Zanzibar", + # Italy + "Tuscany", + "Modena", + "Two Sicilies", + "Parma", + "Piedmont-Sardinia", + # Others + "Somaliland", + "Palestine/Gaza", + "Palestine/West Bank", + "Democratic Republic of Vietnam", + "Republic of Vietnam", + ], + ) + + # Get region aggregates + tb_ = add_regions_and_global_aggregates( + tb=tb_, + ds_regions=ds_regions, + ) + + # Sanity check on output shape + assert tb_.shape[1] == 52, "Unexpected number of columns." + + # Long format + tb_ = from_wide_to_long(tb_) + + # Rename columns + tb_ = tb_.rename( + columns={ + "num_countries_hoe": "population_hoe", + "num_countries_hog": "population_hog", + "num_countries_hos": "population_hos", + "num_countries_regime": "population_regime", + "num_countries_regime_amb": "population_regime_amb", + "num_countries_wom_parl": "population_wom_parl", + "num_countries_years_in_electdem": "population_years_in_electdem", + "num_countries_years_in_libdem": "population_years_in_libdem", + } + ) + + # Remove some dimensions + tb_.loc[ + tb_["category"].isin(["closed autocracy", "electoral autocracy", "electoral democracy"]), + ["population_years_in_electdem", "population_years_in_libdem"], + ] = float("nan") + return tb_ + + +def make_table_population_avg(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Table: + """Get region/world average estimates on some indicators.""" + tb_ = tb.copy() + + # Keep only relevant columns + tb_ = tb_.loc[:, ["year", "country"] + INDICATORS_REGION_AVERAGES] + + # Add population in dummies (population value replaces 1, 0 otherwise) + tb_ = add_population_in_dummies( + tb_, + ds_population, + expected_countries_without_population=[ + # Germany + "Baden", + "Bavaria", + "Brunswick", + "Duchy of Nassau", + "Hamburg", + "Hanover", + "Hesse Electoral", + "Hesse Grand Ducal", + "Mecklenburg Schwerin", + "Oldenburg", + "Saxony", + "Saxe-Weimar-Eisenach", + "Wurttemberg", + "Zanzibar", + # Italy + "Tuscany", + "Modena", + "Two Sicilies", + "Parma", + "Piedmont-Sardinia", + # Others + "Somaliland", + "Palestine/Gaza", + "Palestine/West Bank", + "Democratic Republic of Vietnam", + "Republic of Vietnam", + ], + ) + + # Get region aggregates + tb_ = add_regions_and_global_aggregates( + tb=tb_, + ds_regions=ds_regions, + aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, + ) + + # Rename columns + # tb_ = tb_.rename(columns={col: f"popw_{col}" for col in INDICATORS_REGION_AVERAGES}) + # Sanity check on output shape + assert tb_.shape[1] == 84, "Unexpected number of columns." + + return tb_ + + +def expand_observations_without_leading_to_duplicates(tb: Table) -> Table: + """Expand observations (accounting for overlaps between former and current countries). + + If the data has data for "USSR" and "Russia" for the same year, we should drop the "USSR" row. + """ + # Extend observations to have all country-years + tb = expand_observations(tb) + + # Drop former and current countries for some periods of years + ## We've kept countries that were two sides of a current country (need to keep them since each side could have different regimes) + ## West and East Germany, North and South Yemen, North and South Vietnam + YEARS_YEMEN = (1918, 1990) + YEARS_GERMANY = (1949, 1990) + YEARS_VIETNAM = (1945, 1975) + tb = tb.loc[ + ~( + # Yemen + ((tb["country"] == "Yemen Arab Republic") & ((tb["year"] > YEARS_YEMEN[1]) | (tb["year"] < YEARS_YEMEN[0]))) + | ( + (tb["country"] == "Yemen People's Republic") + & ((tb["year"] > YEARS_YEMEN[1]) | (tb["year"] < YEARS_YEMEN[0])) + ) + | ((tb["country"] == "Yemen") & (tb["year"] >= YEARS_YEMEN[0]) & (tb["year"] <= YEARS_YEMEN[1])) + # Germany + | ((tb["country"] == "West Germany") & ((tb["year"] > YEARS_GERMANY[1]) | (tb["year"] < YEARS_GERMANY[0]))) + | ((tb["country"] == "East Germany") & ((tb["year"] > YEARS_GERMANY[1]) | (tb["year"] < YEARS_GERMANY[0]))) + | ((tb["country"] == "Germany") & (tb["year"] >= YEARS_GERMANY[0]) & (tb["year"] <= YEARS_GERMANY[1])) + # Vietnam + | ((tb["country"] == "Republic of Vietnam") & (tb["year"] > YEARS_VIETNAM[1])) + | ( + (tb["country"] == "Democratic Republic of Vietnam") + & ((tb["year"] > YEARS_VIETNAM[1]) | (tb["year"] < YEARS_VIETNAM[0])) + ) + | ((tb["country"] == "Vietnam") & (tb["year"] <= YEARS_VIETNAM[1])) + ) + ] + + # Replace "Republic of Vietnam" -> "Vietnam" for years before 1945 + tb.loc[(tb["country"] == "Republic of Vietnam") & (tb["year"] < YEARS_VIETNAM[0]), "country"] = "Vietnam" + + # Sanity checks + country_overlaps = [ + ("Republic of Vietnam", "Vietnam"), + ("Democratic Republic of Vietnam", "Vietnam"), + ("Republic of Vietnam", "Vietnam"), + ("Yemen Arab Republic", "Yemen"), + ("Yemen People's Republic", "Yemen"), + ("West Germany", "Germany"), + ("East Germany", "Germany"), + ] + for countries in country_overlaps: + assert tb.loc[tb.country.isin(countries)].groupby("year").size().max() == 1, f"Overlap found for {countries}!" + + return tb + + +# %% MAIN TABLES +def make_main_tables(tb: Table, tb_countries_avg: Table, tb_population_avg: Table) -> Tuple[Table, Table, Table]: + """Integrate the indicators from region aggregates and add dimensions to indicators. + + This method generates three tables: + + - Unidimensional indicators: Table with uni-dimensional indicators and without regional data. + - Multidimensional indicators without regions: Table with multi-dimensional indicators and without regional data. + - Multidimensional indicators with regions: Table with multi-dimensional indicators and with regional data. + + Note: We have estimated regional aggregates with two methods: 'simple mean' or 'population-weighted mean'. We add both flavours, and differentiate them with an additional dimension. (see column `aggregate_method`). + """ + # Re-shape tables with region averages (WIDE -> LONG) + tb_countries_avg = from_wide_to_long( + tb_countries_avg, + indicator_name_callback=lambda x: x.replace("_low", "").replace("_high", ""), + indicator_category_callback=lambda x: "low" if "_low" in x else "high" if "_high" in x else "best", + column_dimension_name="estimate", + ) + tb_population_avg = from_wide_to_long( + tb_population_avg, + indicator_name_callback=lambda x: x.replace("_low", "").replace("_high", ""), + indicator_category_callback=lambda x: "low" if "_low" in x else "high" if "_high" in x else "best", + column_dimension_name="estimate", + ) + assert set(tb_population_avg) == set( + tb_countries_avg + ), "Columns in tb_population_avg and tb_countries_avg do not match!" + + # Get uni- and multi-dimensional indicator tables + tb_uni, tb_multi = _split_into_uni_and_multi(tb) + + # Split multi-dimensional in two: table with region aggregates, table without + columns_index = ["year", "country", "estimate"] + tb_multi_with_regions = tb_multi[tb_population_avg.columns].copy() + tb_multi_without_regions = tb_multi.drop( + columns=[col for col in tb_population_avg.columns if col not in columns_index] + ).copy() + + # Merge multi-dimensional table with region aggregates. + # Since there are two ways of estimating the regional aggregates, we create two versions of the indicators + tb_multi_with_regions["aggregate_method"] = "average" + tb_multi_with_regions_popw = tb_multi.copy() + tb_multi_with_regions_popw["aggregate_method"] = "population-weighted average" + tb_countries_avg["aggregate_method"] = "average" + tb_population_avg["aggregate_method"] = "population-weighted average" + # Combine + tb_multi_with_regions = concat( + [tb_multi_with_regions, tb_multi_with_regions_popw, tb_countries_avg, tb_population_avg], ignore_index=True + ) + + return tb_uni, tb_multi_without_regions, tb_multi_with_regions + + +def _split_into_uni_and_multi(tb: Table) -> Tuple[Table, Table]: + """Split a table into two: one with uni-dimensional indicators, and one with multi-dimensional indicators. + + The table with multi-dimensional indicators will have an additional column (`category`) to differentiate between the different dimension values. + """ + # Get list of indicators with multi-dimensions (and with one dimension) + index = ["country", "year"] + indicators_multi = [col for col in tb.columns if "_low" in col] + indicators_multi = ( + indicators_multi + + [i.replace("_low", "_high") for i in indicators_multi] + + [i.replace("_low", "") for i in indicators_multi] + + ["wom_parl_vdem"] + ) + indicators_uni = [col for col in tb.columns if col not in indicators_multi + index] + + # Create two tables + tb_multi = tb.loc[:, index + indicators_multi].copy() + tb_uni = tb.loc[:, index + indicators_uni].copy() + + # Reformat multi-dimensions indicators + tb_multi = from_wide_to_long( + tb_multi, + indicator_name_callback=lambda x: x.replace("_low", "").replace("_high", ""), + indicator_category_callback=lambda x: "low" if "_low" in x else "high" if "_high" in x else "best", + column_dimension_name="estimate", + ) + # Set dtypes + col_ints = [ + "transplaws_row", + "lib_dich_row", + "electmulpar_row", + "electmulpar_leg_row", + "electmulpar_hoe_row_owid", + "electfreefair_row", + "electdem_dich_row_owid", + "accessjust_m_row", + "accessjust_w_row", + ] + col_ints = [col for col in col_ints if col in tb_multi.columns] + col_float = [col for col in tb_multi.columns if col not in col_ints + ["country", "year", "estimate"]] + tb_multi[col_ints] = tb_multi[col_ints].astype("Int32") + tb_multi[col_float] = tb_multi[col_float].astype("Float32") + + return tb_uni, tb_multi + + +def _add_note_on_region_averages(tb: Table) -> Table: + note = "We have estimated the values for regions by averaging the values from the countries in the region." + for col in INDICATORS_REGION_AVERAGES: + if tb[col].metadata.description_processing: + tb[col].metadata.description_processing += f"\n\n{note}" + else: + tb[col].metadata.description_processing = f"{note}" + return tb + + +# %% OTHERS +def add_regions_and_global_aggregates( + tb: Table, ds_regions: Dataset, aggregations: Optional[Dict[str, str]] = None +) -> Table: + """Add regions, and world aggregates.""" + tb = geo.add_regions_to_table( + tb, + ds_regions, + regions=REGIONS, + aggregations=aggregations, + ) + tb = tb.loc[tb["country"].isin(REGIONS.keys())] + + # Add world + tb_w = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") + tb = concat([tb, tb_w], ignore_index=True, short_name="region_counts") + + return tb + + +def make_table_with_dummies(tb: Table) -> Table: + """Format table to have dummy indicators. + + From a table with categorical indicators, create a new table with dummy indicator for each indicator-category pair. + + Example input: + + | year | country | regime | regime_amb | + |------|---------|-----------|------------| + | 2000 | USA | 1 | 0 | + | 2000 | CAN | 0 | 1 | + | 2000 | DEU | NaN | NaN | + + + Example output: + + | year | country | regime_0 | regime_1 | regime_-1 | regime_amb_0 | regime_amb_0 | regime_amb_-1 | + |------|---------|----------|----------|-----------|--------------|--------------|---------------| + | 2000 | USA | 0 | 1 | 0 | 1 | 0 | 0 | + | 2000 | CAN | 1 | 0 | 0 | 0 | 1 | 0 | + | 2000 | DEU | 0 | 0 | 1 | 0 | 0 | 1 | + + Note that '-1' denotes NA (missing value) category. + + """ + tb_ = tb.copy() + + # Define indicators for which we will create dummies + indicators = [ + { + "name": "regime_row_owid", + "name_new": "num_countries_regime", + # "values_expected": set(map(str, range(4))), + "values_expected": { + "0": "closed autocracy", + "1": "electoral autocracy", + "2": "electoral democracy", + "3": "liberal democracy", + }, + "has_na": True, + }, + { + "name": "regime_amb_row_owid", + "name_new": "num_countries_regime_amb", + # "values_expected": set(map(str, range(10))), + "values_expected": { + "0": "closed autocracy", + "1": "closed (maybe electoral) autocracy", + "2": "electoral (maybe closed) autocracy", + "3": "electoral autocracy", + "4": "electoral autocracy (maybe electoral democracy)", + "5": "electoral democracy (maybe electoral autocracy)", + "6": "electoral democracy", + "7": "electoral democracy (maybe liberal democracy)", + "8": "liberal democracy (maybe electoral democracy)", + "9": "liberal democracy", + }, + "has_na": True, + }, + { + "name": "num_years_in_electdem_cat", + "name_new": "num_countries_years_in_electdem", + "values_expected": { + "closed autocracy", + "electoral autocracy", + "1-18 years", + "19-30 years", + "31-60 years", + "61-90 years", + "91+ years", + }, + "has_na": True, + }, + { + "name": "num_years_in_libdem_cat", + "name_new": "num_countries_years_in_libdem", + "values_expected": { + "closed autocracy", + "electoral autocracy", + "electoral democracy", + "1-18 years", + "19-30 years", + "31-60 years", + "61-90 years", + "91+ years", + }, + "has_na": True, + }, + { + "name": "wom_parl_vdem_cat", + "name_new": "num_countries_wom_parl", + "values_expected": { + "0% women", + "0-10% women", + "10-20% women", + "20-30% women", + "30-40% women", + "40-50% women", + "50%+ women", + }, + "has_na": True, + }, + { + "name": "wom_hog_vdem", + "name_new": "num_countries_hog", + "values_expected": { + "0": "Man", + "1": "Woman", + }, + "has_na": True, + }, + { + "name": "wom_hos_vdem", + "name_new": "num_countries_hos", + "values_expected": { + "0": "Man", + "1": "Woman", + }, + "has_na": True, + }, + { + "name": "wom_hoe_vdem", + "name_new": "num_countries_hoe", + "values_expected": { + "0": "Man", + "1": "Woman", + }, + "has_na": True, + }, + ] + + # Convert to string + indicator_names = [indicator["name"] for indicator in indicators] + tb_[indicator_names] = tb_[indicator_names].astype("string") + + # Sanity check that the categories for each indicator are as expected + for indicator in indicators: + values_expected = indicator["values_expected"] + # Check and fix NA (convert NAs to -1 category) + if indicator["has_na"]: + # Assert that there are actually NaNs + assert tb_[indicator["name"]].isna().any(), "No NA found!" + # If NA, we should not have category '-1', otherwise these would get merged! + assert "-1" not in set( + tb_[indicator["name"]].unique() + ), f"Error for indicator `{indicator['name']}`. Found -1, which is not allowed when `has_na=True`!" + tb_[indicator["name"]] = tb_[indicator["name"]].fillna("-1") + # Add '-1' as a possible category + if isinstance(values_expected, dict): + indicator["values_expected"]["-1"] = "-1" + else: + values_expected |= {"-1"} + else: + assert not tb_[indicator["name"]].isna().any(), "NA found!" + + values_found = set(tb_[indicator["name"]].unique()) + assert values_found == set( + values_expected + ), f"Error for indicator `{indicator['name']}`. Expected {set(values_expected)} but found {values_found}" + + # Rename dimension values + if isinstance(values_expected, dict): + tb_[indicator["name"]] = tb_[indicator["name"]].map(indicator["values_expected"]) + + ## Rename columns + tb_ = tb_.rename(columns={indicator["name"]: indicator["name_new"] for indicator in indicators}) + indicator_names = [indicator["name_new"] for indicator in indicators] + + ## Get dummy indicator table + tb_ = cast(Table, pd.get_dummies(tb_, dummy_na=True, columns=indicator_names)) + + ## Add missing metadata to dummy indicators + dummy_cols = [] + for indicator in indicators: + ## get list of dummy indicator column names + if isinstance(indicator["values_expected"], dict): + dummy_columns = [f"{indicator['name_new']}_{v}" for v in indicator["values_expected"].values()] + else: + dummy_columns = [f"{indicator['name_new']}_{v}" for v in indicator["values_expected"]] + ## assign metadata to dummy column indicators + for col in dummy_columns: + tb_[col].metadata = tb[indicator["name"]].metadata + dummy_cols.extend(dummy_columns) + + ### Select subset of columns + tb_ = tb_.loc[:, ["year", "country"] + dummy_cols] + + return tb_ diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_clean.py similarity index 99% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem_clean.py index c297d716c68..6d3422f4b38 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_clean.py @@ -8,13 +8,9 @@ from owid.catalog import Table from etl.data_helpers import geo -from etl.helpers import PathFinder -# Get paths and naming conventions for current step. -paths = PathFinder(__file__) - -def run(tb: Table) -> Table: +def run(tb: Table, country_mapping_path) -> Table: tb = cast(Table, tb) tb = initial_cleaning(tb) @@ -22,7 +18,7 @@ def run(tb: Table) -> Table: tb = clean_female_flag(tb) # Harmonize country names - tb = geo.harmonize_countries(df=tb, countries_file=paths.country_mapping_path) + tb = geo.harmonize_countries(df=tb, countries_file=country_mapping_path) # Sort tb = tb.sort_values(["country", "year"]) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_impute.py similarity index 98% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem_impute.py index 5ae0d6eef4b..0602ee9eb30 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_impute.py @@ -9,7 +9,7 @@ paths = PathFinder(__file__) # IMPUTE: We will infer indicator values for some countries based on their historical equivalences. -path = paths.directory / "countries_impute.yml" +path = paths.directory / "vdem.countries_impute.yml" COUNTRIES_IMPUTE = yaml.safe_load(path.read_text()) # Expected overlaps diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py similarity index 91% rename from etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py index 4ccf1a12ea6..8bd5b6e2479 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py @@ -1,3 +1,5 @@ +from typing import cast + import numpy as np import pandas as pd from owid.catalog import Table, Variable @@ -7,6 +9,16 @@ def run(tb: Table) -> Table: tb = add_years_in_democracy(tb) tb = add_categories_years_in_democracy(tb) tb = add_categories_women_in_parliament(tb) + # Ensure int types + tb_ = tb.astype( + { + "regime_row_owid": "Int64", + "regime_amb_row_owid": "Int64", + "wom_hoe_vdem": "Int64", + } + ) + + tb_ = cast(Table, tb_) return tb @@ -63,11 +75,11 @@ def add_categories_years_in_democracy(tb: Table) -> Table: np.inf, ] labels = [ - "1-18", - "19-30", - "31-60", - "61-90", - "91+", + "1-18 years", + "19-30 years", + "31-60 years", + "61-90 years", + "91+ years", ] # 1. Create variable for age group of electoral demcoracies: column = "num_years_in_electdem" @@ -100,6 +112,7 @@ def add_categories_years_in_democracy(tb: Table) -> Table: def add_categories_women_in_parliament(tb: Table) -> Table: """Add categorical variable on the percentage of women in parliament.""" bins = [ + -np.inf, 0, 10, 20, @@ -109,6 +122,7 @@ def add_categories_women_in_parliament(tb: Table) -> Table: np.inf, ] labels = [ + "0% women", "0-10% women", "10-20% women", "20-30% women", diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py deleted file mode 100644 index 53235dd7735..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/__init__.py +++ /dev/null @@ -1,266 +0,0 @@ -"""Load a meadow dataset and create a garden dataset.""" -from typing import cast - -import pandas as pd -from owid.catalog import Dataset, Table -from owid.catalog.processing import concat - -from etl.data_helpers import geo -from etl.helpers import PathFinder, create_dataset - -# Get paths and naming conventions for current step. -paths = PathFinder(__file__) - -# REGION AGGREGATES -REGIONS = { - "Africa": { - "additional_members": [ - "Somaliland", - "Zanzibar", - ] - }, - "Asia": { - "additional_members": [ - "Palestine/Gaza", - "Palestine/West Bank", - ] - }, - "North America": {}, - "South America": {}, - "Europe": { - "additional_members": [ - "Baden", - "Bavaria", - "Brunswick", - "Duchy of Nassau", - "Hamburg", - "Hanover", - "Hesse Electoral", - "Hesse Grand Ducal", - "Mecklenburg Schwerin", - "Modena", - "Oldenburg", - "Parma", - "Piedmont-Sardinia", - "Saxe-Weimar-Eisenach", - "Saxony", - "Tuscany", - "Two Sicilies", - "Wurttemberg", - ] - }, - "Oceania": {}, -} - - -def run(dest_dir: str) -> None: - # %% Load data - # - # Load inputs. - # - # Load meadow dataset. - ds_meadow = paths.load_dataset("vdem") - ds_regions = paths.load_dataset("regions") - ds_population = paths.load_dataset("population") - - # Read table from meadow dataset. - tb = ds_meadow["vdem"].reset_index() - - # - # Process data. - # - # %% Remove imputed countries - tb_ = tb.loc[~tb["regime_imputed"]].copy() - - tb_["country"] = tb_["country"].astype("string") - - # %% Sanity check: all countries are in the regions - members_tracked = set() - for region, region_props in REGIONS.items(): - members_tracked |= set( - geo.list_members_of_region(region, ds_regions, additional_members=region_props.get("additional_members")) - ) - assert tb_["country"].isin(members_tracked).all(), "Some countries are not in the regions!" - - # %% Get counts - # Generate dummy indicators - tb_sum = make_table_countries_counts(tb_, ds_regions) - tb_avg = make_table_countries_avg(tb_, ds_regions) - - # %% Set index - tb = tb.format() - - # %% Save - # - # Save outputs. - # - # Create a new garden dataset with the same metadata as the meadow dataset. - ds_garden = create_dataset( - dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_meadow.metadata - ) - - # Save changes in the new garden dataset. - ds_garden.save() - - -def make_table_countries_counts(tb: Table, ds_regions: Dataset) -> Table: - """Get region indicators of type "Number of countries".""" - tb_ = tb.copy() - # Generate dummy indicators - tb_ = make_table_with_dummies(tb_) - - tb_ = geo.add_regions_to_table( - tb_, - ds_regions, - regions=REGIONS, - ) - # Keep only regions - tb_ = tb_.loc[tb_["country"].isin(REGIONS.keys())] - - # Get value for the World and add to table - tb_w = tb_.groupby("year", as_index=False).sum().assign(country="World") - tb_ = concat([tb_, tb_w], ignore_index=True, short_name="region_counts") - - return tb_ - - -def make_table_countries_avg(tb: Table, ds_regions: Dataset) -> Table: - tb_ = tb.copy() - return tb_ - - -def make_table_with_dummies(tb: Table) -> Table: - """Format table to have dummy indicators. - - From a table with categorical indicators, create a new table with dummy indicator for each indicator-category pair. - - Example input: - - | year | country | regime | regime_amb | - |------|---------|-----------|------------| - | 2000 | USA | 1 | 0 | - | 2000 | CAN | 0 | 1 | - | 2000 | DEU | NaN | NaN | - - - Example output: - - | year | country | regime_0 | regime_1 | regime_-1 | regime_amb_0 | regime_amb_0 | regime_amb_-1 | - |------|---------|----------|----------|-----------|--------------|--------------|---------------| - | 2000 | USA | 0 | 1 | 0 | 1 | 0 | 0 | - | 2000 | CAN | 1 | 0 | 0 | 0 | 1 | 0 | - | 2000 | DEU | 0 | 0 | 1 | 0 | 0 | 1 | - - Note that '-1' denotes NA (missing value) category. - - """ - tb_ = tb.copy() - - # Define indicators for which we will create dummies - indicators = [ - { - "name": "regime_row_owid", - "values_expected": set(map(str, range(4))), - "has_na": True, - }, - { - "name": "regime_amb_row_owid", - "values_expected": set(map(str, range(10))), - "has_na": True, - }, - { - "name": "num_years_in_electdem_cat", - "values_expected": { - "closed autocracy", - "electoral autocracy", - "1-18", - "19-30", - "31-60", - "61-90", - "91+", - }, - "has_na": True, - }, - { - "name": "num_years_in_libdem_cat", - "values_expected": { - "closed autocracy", - "electoral autocracy", - "electoral democracy", - "1-18", - "19-30", - "31-60", - "61-90", - "91+", - }, - "has_na": True, - }, - { - "name": "wom_parl_vdem_cat", - "values_expected": { - "0-10% women", - "10-20% women", - "20-30% women", - "30-40% women", - "40-50% women", - "50%+ women", - }, - "has_na": True, - }, - { - "name": "wom_hog_vdem", - "values_expected": {"0", "1"}, - "has_na": True, - }, - { - "name": "wom_hos_vdem", - "values_expected": {"0", "1"}, - "has_na": True, - }, - { - "name": "wom_hoe_vdem", - "values_expected": {"0", "1"}, - "has_na": True, - }, - ] - - # Convert to string - indicator_names = [indicator["name"] for indicator in indicators] - tb_[indicator_names] = tb_[indicator_names].astype("string") - - # Sanity check that the categories for each indicator are as expected - for indicator in indicators: - values_expected = indicator["values_expected"] - # Check and fix NA (convert NAs to -1 category) - if indicator["has_na"]: - # Assert that there are actually NaNs - assert tb_[indicator["name"]].isna().any(), "No NA found!" - # If NA, we should not have category '-1', otherwise these would get merged! - assert "-1" not in set( - tb_[indicator["name"]].unique() - ), f"Error for indicator `{indicator['name']}`. Found -1, which is not allowed when `has_na=True`!" - tb_[indicator["name"]] = tb_[indicator["name"]].fillna("-1") - # Add '-1' as a possible category - values_expected |= {"-1"} - else: - assert not tb_[indicator["name"]].isna().any(), "NA found!" - - values_found = set(tb_[indicator["name"]].unique()) - assert ( - values_found == values_expected - ), f"Error for indicator `{indicator['name']}`. Expected {indicator['values_expected']} but found {values_found}" - - ## Get dummy indicator table - tb_ = cast(Table, pd.get_dummies(tb_, dummy_na=True, columns=indicator_names)) - - ## Add missing metadata to dummy indicators - dummy_cols = [] - for indicator in indicators: - for col in (_dummy_cols := [f"{indicator['name']}_{v}" for v in indicator["values_expected"]]): - tb_[col].metadata = tb[indicator["name"]].metadata - dummy_cols.extend(_dummy_cols) - - ### Select subset of columns - tb_ = tb_.loc[:, ["year", "country"] + dummy_cols] - - return tb_ diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml deleted file mode 100644 index 2c0f3a82b34..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/countries_impute.yml +++ /dev/null @@ -1,618 +0,0 @@ -# List specifying how to impute specific country. -# -# As an example: -# -# - country: Panama -# country_impute: Colombia -# year_min: 1832 -# year_max: 1902 -# annotation: Some text that could be surfaced in the metadata -# -# This means that we want to inherit the classifications for Panama from Colombia between 1832 and 1902. -# -# We note that `country` can also be a list of countries. -# -# Transcription from: https://github.com/owid/notebooks/blob/main/BastianHerre/democracy/scripts/vdem_row_impute.do - - -# ALGERIA (1789-1899) -- country: Algeria - annotation: |- - 1789-1899: imperial power France 1848-1961 (Wimmer and Min 2006), colonized by France since at least 1886-1962 (Cshapes 2.0); We favor no imputation. - -# ANGOLA (1789-1899) -- country: Angola - annotation: |- - Colony of Portugal 1886-1975 (CShapes 2.0); colony of imperial power Portugal 16th century-1974 (Wimmer and Min 2006); We favor no imputation. - -# ARMENIA (1789-1989) -- country: Armenia - country_impute: Russia - year_min: 1918 - year_max: 1989 - annotation: |- - Mixed rule 17th century-1917, imperial power Russia 1918-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); We favor no imputation for early years. - -# AUSTRIA (1939-1944) -- country: Austria - annotation: |- - 1938-1944 imperial power Germany (Wimmer and Min 2006), independent 1939-1944 (CShapes 2.0), independent 1918-1938 (Butcher and Griffiths 2020); We favor no imputation. - -# AZERBAIJAN (1789-1989) -- country: Azerbaijan - country_impute: Russia - year_min: 1813 - year_max: 1989 - annotation: |- - Imperial power Russia 1813-1917, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0) not colonized (Ertan et al. 2016). - -# BANGLADESH (1945-1948) -- country: Bangladesh - country_impute: Pakistan - year_min: 1947 - year_max: 1970 - annotation: "1947-1970 imperial power/part of Pakistan (Wimmer and Min 2006, Cshapes 2.0)" -- country: Bangladesh - country_impute: India - year_min: 1789 - year_max: 1946 - annotation: |- - 1765-1946 imperial power United Kingdom, 1886-1946 part of colony India (Cshapes 2.0), colonized in 1757 (Ertan et al. 2016) - -# BELARUS (1789-1989) -- country: Belarus - country_impute: Russia - year_min: 1795 - year_max: 1989 - annotation: |- - imperial power Russia 1795-1990 (Wimmer and Min 2006); 1886-1991 part of Russia (Cshapes 2.0), not mentioned in Ertan et al. (2016), independent since 1991 (Butcher and Griffiths 2020). - -# BELGIUM (1789-1829) -- country: Belgium - country_impute: France - year_min: 1796 - year_max: 1813 - annotation: |- - Imperial power Netherlands 1814-1831 (Wimmer and Min 2006), part of Austria - 1794, part of France 1795-1813, part of Netherlands 1814-1831 (Encyclopedia Britannica). -- country: Belgium - country_impute: Austria - year_min: 1789 - year_max: 1790 -- country: Belgium - country_impute: Netherlands - year_min: 1814 - year_max: 1829 - -# BENIN (1789-1899) -- country: Benin - annotation: |- - 1789-1899: Colonized by France 1895-1961 (CShapes 2.0), imperial power 1863-1959 (Wimmer and Min 2006); I favor no imputation. - -# BOLIVIA (1789-1824) -- country: Bolivia - annotation: |- - 1789-1824: Imperial power Spain 16th century - 1823 (Wimmer and Min 2006), independence in 1825 (Butcher and Griffiths 2020); I favor no imputation. - -# BULGARIA (1789-1877) -- country: Bulgaria - country_impute: Turkey - year_min: 1789 - year_max: 1877 - annotation: |- - Imperial power Turkey 15th century-1878, independent in 1886 (CShapes 2.0). - -# BURKINA FASO (1789-1918, 1932-1946) -- country: Burkina Faso - annotation: |- - 1789-1918, 1932-1946: imperial power France 1895-1959 (Wimmer and Min 2006); colony of France 1895-1960 (Cshapes 2.0); colonized by France in 1896 (Ertan et al. 2016); I favor no imputation. - -# BURUNDI (1789-1915) -- country: Burundi - annotation: |- - 1789-1915: imperial power Germany 1890-1922, Belgium 1923-1961 (Wimmer and Min 2006); I favor no imputation. - -# CAMEROON (1789-1960) -- country: Cameroon - annotation: |- - Imperial power Germany 1884-1914, mixed rule 1915-1959 (Wimmer and Min 2006), colonized by Germany since at least 1886-1916, occupied by United Kingdom 1916-1919, mandate by France 1919-1959 (Cshapes 2.0); [I favor no imputation]. - -# CAMBODIA (1789-1899) -- country: Cambodia - annotation: |- - Colonized by France 1886-1953 (CShapes 2.0), imperial power France 1857-1952 (Wimmer and Min 2006), colonized in 1863 (Ertan et al. 2016); I favor no imputation. - -# CANADA (1789-1840) -- country: Canada - annotation: |- - Independent since 1886 (CShapes 2.0), imperial power United Kingdom 1763-1866, colonized by Britain and France in 1700 (Ertan et al. 2016); I favor no imputation. - -# CENTRAL AFRICAN REPUBLIC (1789-1919) -- country: Central African Republic - annotation: |- - 1789-1919: Colonized by France 1900-1961 (CShapes 2.0), imperial power France 1890-1959 (Wimmer and Min 2006), colonized by France in 1887/1903 (Ertan et al. 2016); I favor no imputation. - -# COLOMBIA (1789-1809) -- country: Colombia - annotation: |- - 1789-1809: Imperial power Spain 16th century - 1820 (Wimmer and Min 2006), independence in 1819 (Butcher and Griffiths 2020); I favor no imputation. - -# COTE D'IVOIRE (1789-1899) -- country: Cote d'Ivoire - annotation: |- - 1789-1899: colonized by France 1890-1961 (CShapes 2.0), colonized by France 1887-1959 (Wimmer and Min 2006); I favor no imputation. - -# CROATIA (1945-1990) -- country: Croatia - country_impute: Serbia - year_min: 1945 - year_max: 1990 - annotation: |- - Austria-Hungary imperial power 1699-1917, mixed rule 1918, Yugoslavia 1919-1990 (Wimmer and Min 2006); Austria-Hungary 1886-1918, 1919 partially Hungary and Yugoslavia, 1920-1992 Yugoslavia; I favor no imputation for earlier era. - -# CHAD (1789-1919) -- country: Chad - annotation: |- - 1789-1919: colonized by France 1900-1960 (CShapes 2.0), imperial power Sudan 1805-1889, France 1890-1959 (Wimmer and Min 2006); I favor no imputation. - -# CZECHIA (1789-1917) -- country: Czechia - country_impute: Austria - year_min: 1789 - year_max: 1917 - annotation: |- - Imperial power Austria-Hungary 16th century-1917 (Wimmer and Min 2006), part of Austria-Hungary since at least 1886 (Cshapes 2.0), Czech part under Austrian control (Encyclopedia Britannica). - -# DEMOCRATIC REPUBLIC OF CONGO (1789-1899) -- country: Democratic Republic of Congo - annotation: |- - 1789-1899: imperial power Belgium 1885-1959 (Wimmer and Min 2006), colonized in 1885 (Ertan et al. 2016); - -# ESTONIA (1789-1917, 1940-1989) -- country: Estonia - country_impute: Russia - year_min: 1789 - year_max: 1917 - annotation: |- - Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006). -- country: Estonia - country_impute: Russia - year_min: 1940 - year_max: 1989 - -# FINLAND (1789-1862) -- country: Finland - country_impute: Sweden - year_min: 1789 - year_max: 1808 - annotation: |- - Part of Russia 1886-1916 (CShapes 2.0), imperial power Russia 1809-1916 (Wimmer and Min 2006), independence in 1917 (Butcher and Griffiths 2020), part of Sweden 14th century-1808. -- country: Finland - country_impute: Russia - year_min: 1809 - year_max: 1862 - -## GEORGIA (1789-1989) -- country: Georgia - country_impute: Russia - year_min: 1801 - year_max: 1989 - annotation: |- - Imperial power Russia 1801-1918, 1920-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991, not colonized (Ertan et al. 2016), independent since 1991 (Butcher and Griffiths 2020). - -# GHANA (1789-1901) -- country: Ghana - annotation: |- - Colonized by United Kingdom 1886-1957 (CShapes 2.0), imperial power Portugal 15th century - 1823, United Kingdom 1874-1956 (Wimmer and Min 2006); I favor no imputation. - -# GREECE (1789-1821) -- country: Greece - country_impute: Turkey - year_min: 1789 - year_max: 1821 - annotation: |- - Imperial power Turkey 15th century - 1826, independent 1918-1919 (Wimmer and Min 2006, Cshapes 2.0); independent from 1828 to 1941 (Butcher and Griffiths 2020). - -# GUINEA (1789-1899) -- country: Guinea - annotation: |- - 1789-1899: colonized by France 1893-1958 (CShapes 2.0), imperial power France 1849-1957 (Wimmer and Min 2006); I favor no imputation. - -# ISRAEL (1789-1947) -- country: Israel - country_impute: Turkey - year_min: 1789 - year_max: 1919 - annotation: |- - 1789-1947: Imperial power Turkey 1516-1916, United Kingdom 1917-1947 (Wimmer and Min 2006), part of Turkey 1886-1920, occupied by United Kingdom 1921-1948 (CShapes 2.0); I favor no imputation. - -# IRAQ (1789-1919) -- country: Iraq - country_impute: Turkey - year_min: 1789 - year_max: 1919 - annotation: |- - 1789-1919: part of Turkey 1886-1920, mandate of United Kingdom 1921-1933 (CShapes 2.0); imperial power Turkey 16th century-1913, imperial power United Kingdom 1914-1931 (Wimmer and Min 2006). - -# IRAN (1789-1899) -- country: Iran - annotation: |- - 1789-1899: no imperial onset (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), not colonized (Ertan et al. 2016). We favor no imputation. - -# IRELAND (1789-1918) -- country: Ireland - country_impute: United Kingdom - year_min: 1789 - year_max: 1918 - annotation: |- - Imperial power United Kingdom 11th century-1919 (Wimmer and Min 2006), part of United Kingdom since at least 1886-1922, independent since 1922 (Butcher and Griffiths 2020). - -# ITALY (1789-1860) -- country: Italy - country_impute: Piedmont-Sardinia - year_min: 1815 - year_max: 1860 - annotation: |- - 1814-1860 part of Austria-Hungary (Wimmer and Min 2006) or Piedmont-Sardinia since 1815 (Butcher and Griffiths 2020) - -# KAZAKHSTAN (1789-1989) -- country: Kazakhstan - country_impute: Russia - year_min: 1789 - year_max: 1990 - annotation: |- - 1789-1989: imperial power Russia 1730-1990 (Wimmer and Min 2006), part of Russia 1886-1991 (Cshapes 2.0); not colonized (Ertan et al. 2016). - -# KENYA (1789-1899) -- country: Kenya - annotation: |- - 1789-1899: protectorate of United Kingdom 1889-1920, colony of United Kingdom 1921-1963 (CShapes 2.0); imperial power United Kingdom 1895-1962 (Wimmer and Min 2006); I favor no imputation. - -# KYRGYZSTAN (1789-1989) -- country: Kyrgyzstan - country_impute: Russia - year_min: 1876 - year_max: 1989 - annotation: |- - Imperial power Russia 1876-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1991 (Cshapes 2.0), not colonized (Ertan et al. 2016), incorporated into Russia in mid-19th century (Encyclopedia Britannica). - -# LAOS (1789-1899) -- country: Laos - country_impute: Thailand - year_min: 1789 - year_max: 1892 - annotation: |- - Part of Thailand 1886-1893, colonized by France 1894-1954 (CShapes 2.0), imperial power Thailand 1778-1889, France 1890-1952 (Wimmer and Min 2006). - -# LATVIA (1789-1919, 1940-1989) -- country: Latvia - country_impute: Russia - year_min: 1789 - year_max: 1919 - annotation: |- - Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1710-1918 and 1940-1990 (Wimmer and Min 2006); I include 1919. -- country: Latvia - country_impute: Russia - year_min: 1940 - year_max: 1989 - -# LIBYA (1789-1899) -- country: Libya - annotation: |- - 1789-1899: Imperial power Turkey 1551-1911, Italy 1912-1942 (Wimmer and Min 2006), colonized by Italy in 1911 (Ertan et al. 2016); I favor no im - -# LITHUANIA (1789-1917) -- country: Lithuania - country_impute: Russia - year_min: 1795 - year_max: 1917 - annotation: |- - Part of Russia 1886-1918 and 1941-1991 (CShapes 2.0), imperial power Russia 1795-1918 (Wimmer and Min 2006). -- country: Lithuania - country_impute: Russia - year_min: 1940 - year_max: 1989 - annotation: |- - Imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia 1940-1991 (CShapes 2.0), independent 1918-1940, 1991- (Butcher and Griffiths 2020). - -# MADAGASCAR (1789-1816) -- country: Madagascar - annotation: |- - Independent 1886-1896 (CShapes 2.0), imperial power France 1894-1959 (Wimmer and Min 2006), independent 1816-1895 (Butcher and Griffiths 2020), no indication of being part of another country 1789-1816 (Encyclopedia Britannica); I favor no imputation. - -# MALAWI (1789-1899) -- country: Malawi - annotation: |- - 1789-1899: colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1889-1963 (Wimmer and Min 2006); I favor no imputation. - -# MALAYSIA (1789-1899) -- country: Malaysia - annotation: |- - 1789-1899: colonized by United Kingdom 1886-1957, imperial power United Kingdom 1795-1956 (Wimmer and Min 2006); I favor no imputation. - -# MALI (1789-1899) -- country: Mali - annotation: |- - Colonized by France since 1896 (CShapes 2.0), imperial power France since 1895 (Wimmer and Min 2006); I favor no imputation. - -# MOLDOVA (1789-1989) -- country: Moldova - country_impute: Russia - year_min: 1789 - year_max: 1919 - annotation: |- - Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). -- country: Moldova - country_impute: Russia - year_min: 1940 - year_max: 1989 - annotation: |- - Mixed rule 17th century-1939, imperial power Russia 1940-1990 (Wimmer and Min 2006), part of Russia since at least 1886-1919, part of Russia and Romania 1920-1939, part of Russia 1940-1991 (CShapes 2.0, Encyclopedia Britannica). - -# MOZAMBIQUE (1789-1899, 1974-1993) -- country: Mozambique - annotation: |- - 1789-1899, 1974-1993: imperial power Portugal 1885-1974 (Wimmer and Min 2006); colony of Portugal 1886-1975 (Cshapes 2.0), colonized by Portugal, approximated as 1750 (Ertan et al. 2016); We favor no imputation. - -# NETHERLANDS (1811-1812) -- country: Netherlands - country_impute: France - year_min: 1811 - year_max: 1812 - -# NIGER (1789-1921) -- country: Niger - annotation: |- - Colony of France 1896-1960 (CShapes 2.0), imperial power France 1904-1959 (Wimmer and Min 2006); I favor no imputation. - -# NIGERIA (1789-1913) -- country: Nigeria - annotation: |- - 1861-1959 imperial power United Kingdom (Wimmer and Min 2006), colony of United Kingdom (Cshapes 2.0), colonized by United Kingdom in 1885 (Ertan et al. 2016); We favor no imputation. - -# NORTH KOREA (1789-1944) -- country: North Korea - country_impute: South Korea - year_min: 1789 - year_max: 1910 - annotation: |- - Korea since the 14th century until 1909, imperial power Japan 1910-1944 (Wimmer and Min 2006), independent Korea since at least 1886-1910, colony of Japan -1945 (Cshapes 2.0), not listed (Ertan et al. 2016) - -# NORTH MACEDONIA (1789-1990) -- country: North Macedonia - country_impute: Turkey - year_min: 1789 - year_max: 1913 -- country: North Macedonia - country_impute: Serbia - year_min: 1914 - year_max: 1990 - -# PALESTINE (1949-2019) -- country: Palestine - annotation: |- - No information no information (Wimmer and Min 2006, Ertan et al. 2016, Butcher and Griffiths 2020). V-Dem includes Gaza and West Bank separately; We therefore favor no imputation. - -# PAKISTAN (1789-1946) -- country: Pakistan - country_impute: India - year_min: 1947 - year_max: 1970 - annotation: |- - 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) - -# PAPUA NEW GUINEA (1789-1899) -- country: Papua New Guinea - annotation: |- - 1789-1899: Colonized by United Kingdom 1886-1920 and Germany 1886-1914, Australia 1915-1975 (CShapes 2.0), imperial power United Kingdom 1883-1904, Australia 1905-1974 (Wimmer and Min 2006), colonized by United Kingdom and Germany in 1884 (Ertan et al. 2016); I favor no imputation. - -# PERU (1789-1820) -- country: Peru - annotation: |- - 1789-1820: Imperial power Spain 16th century - 1824 (Wimmer and Min 2006), independence in 1821 (Butcher and Griffiths 2020); I favor no imputation. - -# PHILIPPINES (1789-1899) -- country: Philippines - annotation: |- - Imperial power Spain 16th century-1898, United States 1899-1945 (Wimmer and Min 2006), colony of Spain since at least 1886-1898, colony of United States 1899-1946 (Cshapes 2.0); We favor no imputation. - -# POLAND -- country: Poland - annotation: |- - Poland 1789-1808, 1868-1917, 1939-1943: no information 1800-1808, 1795-1914 mixed rule (Wimmer and Min 2006), 1939-1943 independent (Cshapes 2.0); We favor no imputation. - -# PUERTO RICO (1940, 1950-2021) -- country: Puerto Rico - annotation: |- - 1940, 1950-2021: colony of Spain since at least 1886-1898, colony of United States 1899- (CShapes 2.0), colony of Spain since 16th century (Encyclopedia Britannica); We favor no imputation. - -# ROMANIA (1789-1830, 1854-1856, 1859-1899) -- country: Romania - annotation: |- - 1688-1858 imperial power Austria-Hungary (Wimmer and Min 2006), independent since at least 1886 (Cshapes 2.0), independent since 1878 (Butcher and Griffiths 2020), Transylvania part of Austria-Hungary, other parts under Ottoman influence; We favor no imputation. - -# RWANDA (1789-1915) -- country: Rwanda - annotation: |- - Colonized by Germany 1891-1916 (CShapes 2.0), imperial power Germany 1890-1915 (Wimmer and Min 2006); I favor no imputation. - -# SAUDI ARABIA (1819-1821) -- country: Saudi Arabia - country_impute: Turkey - year_min: 1819 - year_max: 1821 - annotation: |- - Part of Turkey 1886-1919, nothing 1920-1932 (CShapes 2.0), not included (Wimmer and Min 2006), not colonized (Ertan et al. 2016), independent 1816-1818 (Butcher and Griffiths 2020), part of Ottoman Empire (Encyclopedia Britannica). - -# SENEGAL (1789-1903) -- country: Senegal - annotation: |- - 1789-1903: colonized by France 1886-1961 (CShapes 2.0), imperial power France 1854-1959 (Wimmer and Min 2006); I favor no imputation. - -# SERBIA (1789-1833, 1932-1934) -- country: Serbia - country_impute: Turkey - year_min: 1789 - year_max: 1833 - annotation: |- - Im perial power Turkey 14th century - 1877 (Wimmer and Min 2006); part of the Ottoman Empire (Encyclopedia Britannica); no imperial power 1932-1934 (Wimmer and Min 2006), independent 1932-1934 (Cshapes 2.0); We favor no imputation for later period. - -# SIERRA LEONE (1789-1899) -- country: Sierra Leone - annotation: |- - 1789-1899: Imperial power United Kingdom 1808-1960 (Wimmer and Min 2006), colonized by United Kingdom in 1808/1896 (Ertan et al. 2016); I favor no imputation. - -# SLOVAKIA (1789-1992) -- country: Slovakia - country_impute: Hungary - year_min: 1789 - year_max: 1918 - annotation: |- - Imperial power Austria-Hungary 16th century-1913, mixed rule 1914-1918, 1919-1992 imperial power Czechoslovakia (Wimmer and Min 2006), part of Austria-Hungary since at least 1886-1918, part of Czechoslovakia 1919-1992 (Cshapes 2.0), Slovak part under Hungarian control (Encyclopedia Britannica). -- country: Slovakia - country_impute: Czechia - year_min: 1919 - year_max: 1992 - -# SLOVENIA (1789-1988) -- country: Slovenia - country_impute: Serbia - year_min: 1919 - year_max: 1988 - annotation: |- - Part of Austria-Hungary 1886-1918, of Austria 1919, of Yugoslavia 1920-1992 (CShapes 2.0), imperial power Austria-Hungary 1804-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006), appears more closely affiliated with Austria, as Hungary barely referenced (Encyclopedia Britannica). -- country: Slovenia - country_impute: Austria - year_min: 1804 - year_max: 1918 - -# SOMALIA (1789-1899) -- country: Somalia - annotation: |- - 1789-1899: colonized by United Kingdom 1886-1961, Italy 1890-1941 (CShapes 2.0), imperial power Turkey 1870-1883, United Kingdom 1884-1888, mixed rule 1889-1941 (Wimmer and Min 2006), occupied by Egypt 1870-1885 (Encyclopedia Britannica); I favor no imputation. - -# SOUTH AFRICA (1789-1899) -- country: South Africa - annotation: |- - Imperial power United Kingdom 1814-1909 (Wimmer and Min 2006); (mostly) colonized by United Kingdom 1886-1911 (Cshapes 2.0), colonized by United Kingdom in 1806, earlier also by Dutch settlers (Ertan et al. 2016); We favor no imputation. - -# SOUTH SUDAN (1789-2010) -- country: South Sudan - country_impute: Egypt - year_min: 1821 - year_max: 1884 - annotation: |- - not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). -- country: South Sudan - country_impute: Sudan - year_min: 1900 - year_max: 2010 - anotation: |- - not listed, but Egypt imperial power of Sudan 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955, part of Sudan until 2012 (Cshapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020). - -# SRI LANKA (1789-1899) -- country: Sri Lanka - annotation: |- - 1789-1899: colonized by United Kingdom as Ceylon (Cshapes 2.0); I favor no imputation. - -# SUDAN (1789-1899) -- country: Sudan - country_impute: Egypt - year_min: 1821 - year_max: 1884 - annotation: |- - Egypt imperial power 1821-1881, mixed rule 1882-1955 (Wimmer and Min 2006), colony of United Kingdom 1898-1955 (CShapes 2.0), colonized by United Kingdom in 1898 (Ertan et al. 2016), independent 1885-1898 (Butcher and Griffiths 2020); in 1886, colony Egypt of United Kingdom covers little of today's Sudan (CShapes 2.0); Egypt invades Sudanese territory in 1820, indigenous forces surrender in 1821, Mahdists capture Khartoum from Egypt and the British in 1885 (Encyclopedia Britannica). - -# SYRIA (1789-1917, 1920-1921) -- country: Syria - country_impute: Turkey - year_min: 1789 - year_max: 1830 - annotation: |- - Part of Turkey 1886-1920 (CShapes 2.0), imperial power Turkey 1840-1919, France 1920-1943 (Wimmer and Min 2006), colonized by France in 1920 (Ertan et al. 2016), part of of Ottoman Empire 16th century-1830, of Egypt 1831-1839 (Encyclopedia Britannica). -- country: Syria - country_impute: Egypt - year_min: 1831 - year_max: 1839 -- country: Syria - country_impute: Turkey - year_min: 1840 - year_max: 1917 - -# TAIWAN (1789-1899) -- country: Taiwan - country_impute: China - year_min: 1789 - year_max: 1894 - annotation: |- - Part of China 1886-1895, colony of Japan afterwards (CShapes 2.0), imperial power China 17th century - 1947 (Wimmer and Min 2006), colonized by Japan 1895-1945 (Ertan et al. 2016). - -# TAJIKISTAN (1789-1989) -- country: Tajikistan - country_impute: Russia - year_min: 1868 - year_max: 1989 - annotation: |- - Imperial power Russia 1921-1990 (Wimmer and Min 2006), part of Russia, part of Russia's protectorate Bokhara 1886-1920, part of Russia 1920-1990 (Cshapes 2.0), independent since 1991, Bokhara independent 1816-1868 (Butcher and Griffiths 2020). - -# TANZANIA (1789-1914) -- country: Tanzania - annotation: |- - Imperial power/colonized by Germany and United Kingdom (Wimmer and Min 2006, Cshapes 2.0); We favor no imputation. - -# TURKMENISTAN (1789-1989) -- country: Turkmenistan - country_impute: Russia - year_min: 1896 - year_max: 1989 - annotation: |- - Imperial power Russia 1897-1990 (Wimmer and Min 2006), (mostly) part of Russia since 1886-1991, part protectorate Khiva 1886-1920 (Cshapes 2.0), not colonized (Ertan et al. 2016), resistance against Russia broken in 1881 (Encyclopedia Britannica). - -# UGANDA (1789-1899) -- country: Uganda - annotation: |- - 1789-1899: part of Kenya, protectorate of United Kingdom 1892-1894 (CShapes 2.0); own protectorate of United Kingdom 1895-1962; imperial power United Kingdom 1890-1961 (Wimmer and Min 2006); I favor no imputation. - -# UKRAINE (1789-1989) -- country: Ukraine - country_impute: Russia - year_min: 1946 - year_max: 1989 - annotation: |- - 1946-1989 imperial power/part of Russia (Wimmer and Min 2006, Cshapes 2.0), 1921-1945 and 1816-1918 mixed rule (Wimmer and Min 2006). - -# UZBEKISTAN (1789-1911, 1921-1989) -- country: Uzbekistan - country_impute: Russia - year_min: 1865 - year_max: 1911 - annotation: |- - 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. -- country: Uzbekistan - country_impute: Russia - year_min: 1921 - year_max: 1989 - annotation: |- - 1865-1990 imperial power Russia (Wimmer and Min 2006), 1886-1991 part of Russia (Khiva and Bokhara partially as protectorates), not colonized (Ertan et al. 2016), Khiva and Bokhara as independent until -1872 and -1867. - -# VIETNAM (1789-1944) -- country: Vietnam - annotation: |- - 1861-1953 imperial power France (Wimmer and Min 2006) or 1886-1893 independent and 1894-1954 colonized by France (Cshapes 2.0), colonized by France in 1867 (Ertan et al. 2016), independent 1802-1884 (Butcher and Griffiths 2020); We favor no imputation. - -# YEMEN (1851-1917) -- country: Yemen - country_impute: Turkey - year_min: 1851 - year_max: 1917 - annotation: |- - Mixed rule by Turkey and United Kingdom 1849-1918, part of Turkey 1886-1918 (CShapes 2.0), United Kingdom not on CShapes map. - -# ZAMBIA (1789-1910) -- country: Zambia - annotation: |- - Colonized by United Kingdom 1892-1964 (CShapes 2.0), imperial power United Kingdom 1890-1963 (Wimmer and Min 2006); I favor no imputation. - -# ZIMBABWE (1789-1899) -- country: Zimbabwe - annotation: |- - 1789-1899: Colonized by United Kingdom 1889-1965 (CShapes 2.0), imperial power United Kingdom 1890-1964 (Wimmer and Min 2006); I favor no imputation. diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json deleted file mode 100644 index 9f943c95a1f..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/debug.overlaps.json +++ /dev/null @@ -1,3069 +0,0 @@ -[ - { - 1789: {'Yemen', - "Yemen People's Republic" - }, - 1790: {'Yemen', - "Yemen People's Republic" - }, - 1791: {'Yemen', - "Yemen People's Republic" - }, - 1792: {'Yemen', - "Yemen People's Republic" - }, - 1793: {'Yemen', - "Yemen People's Republic" - }, - 1794: {'Yemen', - "Yemen People's Republic" - }, - 1795: {'Yemen', - "Yemen People's Republic" - }, - 1796: {'Yemen', - "Yemen People's Republic" - }, - 1797: {'Yemen', - "Yemen People's Republic" - }, - 1798: {'Yemen', - "Yemen People's Republic" - }, - 1799: {'Yemen', - "Yemen People's Republic" - }, - 1800: {'Yemen', - "Yemen People's Republic" - }, - 1801: {'Yemen', - "Yemen People's Republic" - }, - 1802: {'Yemen', - "Yemen People's Republic" - }, - 1803: {'Yemen', - "Yemen People's Republic" - }, - 1804: {'Yemen', - "Yemen People's Republic" - }, - 1805: {'Yemen', - "Yemen People's Republic" - }, - 1806: {'Yemen', - "Yemen People's Republic" - }, - 1807: {'Yemen', - "Yemen People's Republic" - }, - 1808: {'Yemen', - "Yemen People's Republic" - }, - 1809: {'Yemen', - "Yemen People's Republic" - }, - 1810: {'Yemen', - "Yemen People's Republic" - }, - 1811: {'Yemen', - "Yemen People's Republic" - }, - 1812: {'Yemen', - "Yemen People's Republic" - }, - 1813: {'Yemen', - "Yemen People's Republic" - }, - 1814: {'Yemen', - "Yemen People's Republic" - }, - 1815: {'Yemen', - "Yemen People's Republic" - }, - 1816: {'Yemen', - "Yemen People's Republic" - }, - 1817: {'Yemen', - "Yemen People's Republic" - }, - 1818: {'Yemen', - "Yemen People's Republic" - }, - 1819: {'Yemen', - "Yemen People's Republic" - }, - 1820: {'Yemen', - "Yemen People's Republic" - }, - 1821: {'Yemen', - "Yemen People's Republic" - }, - 1822: {'Yemen', - "Yemen People's Republic" - }, - 1823: {'Yemen', - "Yemen People's Republic" - }, - 1824: {'Yemen', - "Yemen People's Republic" - }, - 1825: {'Yemen', - "Yemen People's Republic" - }, - 1826: {'Yemen', - "Yemen People's Republic" - }, - 1827: {'Yemen', - "Yemen People's Republic" - }, - 1828: {'Yemen', - "Yemen People's Republic" - }, - 1829: {'Yemen', - "Yemen People's Republic" - }, - 1830: {'Yemen', - "Yemen People's Republic" - }, - 1831: {'Yemen', - "Yemen People's Republic" - }, - 1832: {'Yemen', - "Yemen People's Republic" - }, - 1833: {'Yemen', - "Yemen People's Republic" - }, - 1834: {'Yemen', - "Yemen People's Republic" - }, - 1835: {'Yemen', - "Yemen People's Republic" - }, - 1836: {'Yemen', - "Yemen People's Republic" - }, - 1837: {'Yemen', - "Yemen People's Republic" - }, - 1838: {'Yemen', - "Yemen People's Republic" - }, - 1839: {'Yemen', - "Yemen People's Republic" - }, - 1840: {'Yemen', - "Yemen People's Republic" - }, - 1841: {'Yemen', - "Yemen People's Republic" - }, - 1842: {'Yemen', - "Yemen People's Republic" - }, - 1843: {'Yemen', - "Yemen People's Republic" - }, - 1844: {'Yemen', - "Yemen People's Republic" - }, - 1845: {'Yemen', - "Yemen People's Republic" - }, - 1846: {'Yemen', - "Yemen People's Republic" - }, - 1847: {'Yemen', - "Yemen People's Republic" - }, - 1848: {'Yemen', - "Yemen People's Republic" - }, - 1849: {'Yemen', - "Yemen People's Republic" - }, - 1850: {'Yemen', - "Yemen People's Republic" - }, - 1851: {'Yemen', - "Yemen People's Republic" - }, - 1852: {'Yemen', - "Yemen People's Republic" - }, - 1853: {'Yemen', - "Yemen People's Republic" - }, - 1854: {'Yemen', - "Yemen People's Republic" - }, - 1855: {'Yemen', - "Yemen People's Republic" - }, - 1856: {'Yemen', - "Yemen People's Republic" - }, - 1857: {'Yemen', - "Yemen People's Republic" - }, - 1858: {'Yemen', - "Yemen People's Republic" - }, - 1859: {'Yemen', - "Yemen People's Republic" - }, - 1860: {'Yemen', - "Yemen People's Republic" - }, - 1861: {'Yemen', - "Yemen People's Republic" - }, - 1862: {'Yemen', - "Yemen People's Republic" - }, - 1863: {'Yemen', - "Yemen People's Republic" - }, - 1864: {'Yemen', - "Yemen People's Republic" - }, - 1865: {'Yemen', - "Yemen People's Republic" - }, - 1866: {'Yemen', - "Yemen People's Republic" - }, - 1867: {'Yemen', - "Yemen People's Republic" - }, - 1868: {'Yemen', - "Yemen People's Republic" - }, - 1869: {'Yemen', - "Yemen People's Republic" - }, - 1870: {'Yemen', - "Yemen People's Republic" - }, - 1871: {'Yemen', - "Yemen People's Republic" - }, - 1872: {'Yemen', - "Yemen People's Republic" - }, - 1873: {'Yemen', - "Yemen People's Republic" - }, - 1874: {'Yemen', - "Yemen People's Republic" - }, - 1875: {'Yemen', - "Yemen People's Republic" - }, - 1876: {'Yemen', - "Yemen People's Republic" - }, - 1877: {'Yemen', - "Yemen People's Republic" - }, - 1878: {'Yemen', - "Yemen People's Republic" - }, - 1879: {'Yemen', - "Yemen People's Republic" - }, - 1880: {'Yemen', - "Yemen People's Republic" - }, - 1881: {'Yemen', - "Yemen People's Republic" - }, - 1882: {'Yemen', - "Yemen People's Republic" - }, - 1883: {'Yemen', - "Yemen People's Republic" - }, - 1884: {'Yemen', - "Yemen People's Republic" - }, - 1885: {'Yemen', - "Yemen People's Republic" - }, - 1886: {'Yemen', - "Yemen People's Republic" - }, - 1887: {'Yemen', - "Yemen People's Republic" - }, - 1888: {'Yemen', - "Yemen People's Republic" - }, - 1889: {'Yemen', - "Yemen People's Republic" - }, - 1890: {'Yemen', - "Yemen People's Republic" - }, - 1891: {'Yemen', - "Yemen People's Republic" - }, - 1892: {'Yemen', - "Yemen People's Republic" - }, - 1893: {'Yemen', - "Yemen People's Republic" - }, - 1894: {'Yemen', - "Yemen People's Republic" - }, - 1895: {'Yemen', - "Yemen People's Republic" - }, - 1896: {'Yemen', - "Yemen People's Republic" - }, - 1897: {'Yemen', - "Yemen People's Republic" - }, - 1898: {'Yemen', - "Yemen People's Republic" - }, - 1899: {'Yemen', - "Yemen People's Republic" - }, - 1900: {'Yemen', - "Yemen People's Republic" - }, - 1901: {'Yemen', - "Yemen People's Republic" - }, - 1902: {'Yemen', - "Yemen People's Republic" - }, - 1903: {'Yemen', - "Yemen People's Republic" - }, - 1904: {'Yemen', - "Yemen People's Republic" - }, - 1905: {'Yemen', - "Yemen People's Republic" - }, - 1906: {'Yemen', - "Yemen People's Republic" - }, - 1907: {'Yemen', - "Yemen People's Republic" - }, - 1908: {'Yemen', - "Yemen People's Republic" - }, - 1909: {'Yemen', - "Yemen People's Republic" - }, - 1910: {'Yemen', - "Yemen People's Republic" - }, - 1911: {'Yemen', - "Yemen People's Republic" - }, - 1912: {'Yemen', - "Yemen People's Republic" - }, - 1913: {'Yemen', - "Yemen People's Republic" - }, - 1914: {'Yemen', - "Yemen People's Republic" - }, - 1915: {'Yemen', - "Yemen People's Republic" - }, - 1916: {'Yemen', - "Yemen People's Republic" - }, - 1917: {'Yemen', - "Yemen People's Republic" - }, - 1918: {'Yemen', - "Yemen People's Republic" - }, - 1919: {'Yemen', - "Yemen People's Republic" - }, - 1920: {'Yemen', - "Yemen People's Republic" - }, - 1921: {'Yemen', - "Yemen People's Republic" - }, - 1922: {'Yemen', - "Yemen People's Republic" - }, - 1923: {'Yemen', - "Yemen People's Republic" - }, - 1924: {'Yemen', - "Yemen People's Republic" - }, - 1925: {'Yemen', - "Yemen People's Republic" - }, - 1926: {'Yemen', - "Yemen People's Republic" - }, - 1927: {'Yemen', - "Yemen People's Republic" - }, - 1928: {'Yemen', - "Yemen People's Republic" - }, - 1929: {'Yemen', - "Yemen People's Republic" - }, - 1930: {'Yemen', - "Yemen People's Republic" - }, - 1931: {'Yemen', - "Yemen People's Republic" - }, - 1932: {'Yemen', - "Yemen People's Republic" - }, - 1933: {'Yemen', - "Yemen People's Republic" - }, - 1934: {'Yemen', - "Yemen People's Republic" - }, - 1935: {'Yemen', - "Yemen People's Republic" - }, - 1936: {'Yemen', - "Yemen People's Republic" - }, - 1937: {'Yemen', - "Yemen People's Republic" - }, - 1938: {'Yemen', - "Yemen People's Republic" - }, - 1939: {'Yemen', - "Yemen People's Republic" - }, - 1940: {'Yemen', - "Yemen People's Republic" - }, - 1941: {'Yemen', - "Yemen People's Republic" - }, - 1942: {'Yemen', - "Yemen People's Republic" - }, - 1943: {'Yemen', - "Yemen People's Republic" - }, - 1944: {'Yemen', - "Yemen People's Republic" - }, - 1945: {'Yemen', - "Yemen People's Republic" - }, - 1946: {'Yemen', - "Yemen People's Republic" - }, - 1947: {'Yemen', - "Yemen People's Republic" - }, - 1948: {'Yemen', - "Yemen People's Republic" - }, - 1949: {'Yemen', - "Yemen People's Republic" - }, - 1950: {'Yemen', - "Yemen People's Republic" - }, - 1951: {'Yemen', - "Yemen People's Republic" - }, - 1952: {'Yemen', - "Yemen People's Republic" - }, - 1953: {'Yemen', - "Yemen People's Republic" - }, - 1954: {'Yemen', - "Yemen People's Republic" - }, - 1955: {'Yemen', - "Yemen People's Republic" - }, - 1956: {'Yemen', - "Yemen People's Republic" - }, - 1957: {'Yemen', - "Yemen People's Republic" - }, - 1958: {'Yemen', - "Yemen People's Republic" - }, - 1959: {'Yemen', - "Yemen People's Republic" - }, - 1960: {'Yemen', - "Yemen People's Republic" - }, - 1961: {'Yemen', - "Yemen People's Republic" - }, - 1962: {'Yemen', - "Yemen People's Republic" - }, - 1963: {'Yemen', - "Yemen People's Republic" - }, - 1964: {'Yemen', - "Yemen People's Republic" - }, - 1965: {'Yemen', - "Yemen People's Republic" - }, - 1966: {'Yemen', - "Yemen People's Republic" - }, - 1967: {'Yemen', - "Yemen People's Republic" - }, - 1968: {'Yemen', - "Yemen People's Republic" - }, - 1969: {'Yemen', - "Yemen People's Republic" - }, - 1970: {'Yemen', - "Yemen People's Republic" - }, - 1971: {'Yemen', - "Yemen People's Republic" - }, - 1972: {'Yemen', - "Yemen People's Republic" - }, - 1973: {'Yemen', - "Yemen People's Republic" - }, - 1974: {'Yemen', - "Yemen People's Republic" - }, - 1975: {'Yemen', - "Yemen People's Republic" - }, - 1976: {'Yemen', - "Yemen People's Republic" - }, - 1977: {'Yemen', - "Yemen People's Republic" - }, - 1978: {'Yemen', - "Yemen People's Republic" - }, - 1979: {'Yemen', - "Yemen People's Republic" - }, - 1980: {'Yemen', - "Yemen People's Republic" - }, - 1981: {'Yemen', - "Yemen People's Republic" - }, - 1982: {'Yemen', - "Yemen People's Republic" - }, - 1983: {'Yemen', - "Yemen People's Republic" - }, - 1984: {'Yemen', - "Yemen People's Republic" - }, - 1985: {'Yemen', - "Yemen People's Republic" - }, - 1986: {'Yemen', - "Yemen People's Republic" - }, - 1987: {'Yemen', - "Yemen People's Republic" - }, - 1988: {'Yemen', - "Yemen People's Republic" - }, - 1989: {'Yemen', - "Yemen People's Republic" - }, - 1990: {'Yemen', - "Yemen People's Republic" - }, - 1991: {'Yemen', - "Yemen People's Republic" - }, - 1992: {'Yemen', - "Yemen People's Republic" - }, - 1993: {'Yemen', - "Yemen People's Republic" - }, - 1994: {'Yemen', - "Yemen People's Republic" - }, - 1995: {'Yemen', - "Yemen People's Republic" - }, - 1996: {'Yemen', - "Yemen People's Republic" - }, - 1997: {'Yemen', - "Yemen People's Republic" - }, - 1998: {'Yemen', - "Yemen People's Republic" - }, - 1999: {'Yemen', - "Yemen People's Republic" - }, - 2000: {'Yemen', - "Yemen People's Republic" - }, - 2001: {'Yemen', - "Yemen People's Republic" - }, - 2002: {'Yemen', - "Yemen People's Republic" - }, - 2003: {'Yemen', - "Yemen People's Republic" - }, - 2004: {'Yemen', - "Yemen People's Republic" - }, - 2005: {'Yemen', - "Yemen People's Republic" - }, - 2006: {'Yemen', - "Yemen People's Republic" - }, - 2007: {'Yemen', - "Yemen People's Republic" - }, - 2008: {'Yemen', - "Yemen People's Republic" - }, - 2009: {'Yemen', - "Yemen People's Republic" - }, - 2010: {'Yemen', - "Yemen People's Republic" - }, - 2011: {'Yemen', - "Yemen People's Republic" - }, - 2012: {'Yemen', - "Yemen People's Republic" - }, - 2013: {'Yemen', - "Yemen People's Republic" - }, - 2014: {'Yemen', - "Yemen People's Republic" - }, - 2015: {'Yemen', - "Yemen People's Republic" - }, - 2016: {'Yemen', - "Yemen People's Republic" - }, - 2017: {'Yemen', - "Yemen People's Republic" - }, - 2018: {'Yemen', - "Yemen People's Republic" - }, - 2019: {'Yemen', - "Yemen People's Republic" - }, - 2020: {'Yemen', - "Yemen People's Republic" - }, - 2021: {'Yemen', - "Yemen People's Republic" - }, - 2022: {'Yemen', - "Yemen People's Republic" - }, - 2023: {'Yemen', - "Yemen People's Republic" - } - }, - { - 1789: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1790: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1791: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1792: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1793: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1794: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1795: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1796: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1797: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1798: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1799: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1800: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1801: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1802: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1803: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1804: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1805: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1806: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1807: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1808: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1809: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1810: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1811: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1812: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1813: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1814: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1815: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1816: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1817: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1818: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1819: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1820: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1821: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1822: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1823: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1824: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1825: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1826: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1827: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1828: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1829: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1830: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1831: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1832: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1833: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1834: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1835: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1836: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1837: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1838: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1839: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1840: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1841: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1842: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1843: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1844: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1845: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1846: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1847: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1848: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1849: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1850: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1851: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1852: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1853: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1854: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1855: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1856: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1857: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1858: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1859: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1860: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1861: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1862: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1863: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1864: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1865: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1866: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1867: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1868: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1869: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1870: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1871: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1872: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1873: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1874: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1875: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1876: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1877: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1878: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1879: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1880: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1881: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1882: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1883: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1884: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1885: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1886: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1887: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1888: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1889: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1890: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1891: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1892: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1893: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1894: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1895: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1896: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1897: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1898: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1899: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1900: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1901: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1902: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1903: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1904: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1905: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1906: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1907: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1908: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1909: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1910: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1911: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1912: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1913: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1914: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1915: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1916: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1917: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1918: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1919: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1920: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1921: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1922: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1923: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1924: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1925: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1926: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1927: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1928: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1929: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1930: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1931: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1932: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1933: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1934: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1935: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1936: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1937: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1938: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1939: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1940: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1941: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1942: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1943: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1944: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1945: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1946: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1947: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1948: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1949: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1950: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1951: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1952: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1953: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1954: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1955: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1956: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1957: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1958: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1959: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1960: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1961: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1962: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1963: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1964: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1965: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1966: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1967: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1968: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1969: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1970: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1971: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1972: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1973: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1974: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1975: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1976: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1977: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1978: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1979: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1980: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1981: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1982: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1983: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1984: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1985: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1986: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1987: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1988: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1989: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1990: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1991: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1992: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1993: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1994: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1995: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1996: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1997: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1998: {'Duchy of Parma and Piacenza', 'Italy' - }, - 1999: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2000: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2001: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2002: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2003: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2004: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2005: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2006: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2007: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2008: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2009: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2010: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2011: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2012: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2013: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2014: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2015: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2016: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2017: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2018: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2019: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2020: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2021: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2022: {'Duchy of Parma and Piacenza', 'Italy' - }, - 2023: {'Duchy of Parma and Piacenza', 'Italy' - } - }, - { - 1789: {'East Germany', 'Germany' - }, - 1790: {'East Germany', 'Germany' - }, - 1791: {'East Germany', 'Germany' - }, - 1792: {'East Germany', 'Germany' - }, - 1793: {'East Germany', 'Germany' - }, - 1794: {'East Germany', 'Germany' - }, - 1795: {'East Germany', 'Germany' - }, - 1796: {'East Germany', 'Germany' - }, - 1797: {'East Germany', 'Germany' - }, - 1798: {'East Germany', 'Germany' - }, - 1799: {'East Germany', 'Germany' - }, - 1800: {'East Germany', 'Germany' - }, - 1801: {'East Germany', 'Germany' - }, - 1802: {'East Germany', 'Germany' - }, - 1803: {'East Germany', 'Germany' - }, - 1804: {'East Germany', 'Germany' - }, - 1805: {'East Germany', 'Germany' - }, - 1806: {'East Germany', 'Germany' - }, - 1807: {'East Germany', 'Germany' - }, - 1808: {'East Germany', 'Germany' - }, - 1809: {'East Germany', 'Germany' - }, - 1810: {'East Germany', 'Germany' - }, - 1811: {'East Germany', 'Germany' - }, - 1812: {'East Germany', 'Germany' - }, - 1813: {'East Germany', 'Germany' - }, - 1814: {'East Germany', 'Germany' - }, - 1815: {'East Germany', 'Germany' - }, - 1816: {'East Germany', 'Germany' - }, - 1817: {'East Germany', 'Germany' - }, - 1818: {'East Germany', 'Germany' - }, - 1819: {'East Germany', 'Germany' - }, - 1820: {'East Germany', 'Germany' - }, - 1821: {'East Germany', 'Germany' - }, - 1822: {'East Germany', 'Germany' - }, - 1823: {'East Germany', 'Germany' - }, - 1824: {'East Germany', 'Germany' - }, - 1825: {'East Germany', 'Germany' - }, - 1826: {'East Germany', 'Germany' - }, - 1827: {'East Germany', 'Germany' - }, - 1828: {'East Germany', 'Germany' - }, - 1829: {'East Germany', 'Germany' - }, - 1830: {'East Germany', 'Germany' - }, - 1831: {'East Germany', 'Germany' - }, - 1832: {'East Germany', 'Germany' - }, - 1833: {'East Germany', 'Germany' - }, - 1834: {'East Germany', 'Germany' - }, - 1835: {'East Germany', 'Germany' - }, - 1836: {'East Germany', 'Germany' - }, - 1837: {'East Germany', 'Germany' - }, - 1838: {'East Germany', 'Germany' - }, - 1839: {'East Germany', 'Germany' - }, - 1840: {'East Germany', 'Germany' - }, - 1841: {'East Germany', 'Germany' - }, - 1842: {'East Germany', 'Germany' - }, - 1843: {'East Germany', 'Germany' - }, - 1844: {'East Germany', 'Germany' - }, - 1845: {'East Germany', 'Germany' - }, - 1846: {'East Germany', 'Germany' - }, - 1847: {'East Germany', 'Germany' - }, - 1848: {'East Germany', 'Germany' - }, - 1849: {'East Germany', 'Germany' - }, - 1850: {'East Germany', 'Germany' - }, - 1851: {'East Germany', 'Germany' - }, - 1852: {'East Germany', 'Germany' - }, - 1853: {'East Germany', 'Germany' - }, - 1854: {'East Germany', 'Germany' - }, - 1855: {'East Germany', 'Germany' - }, - 1856: {'East Germany', 'Germany' - }, - 1857: {'East Germany', 'Germany' - }, - 1858: {'East Germany', 'Germany' - }, - 1859: {'East Germany', 'Germany' - }, - 1860: {'East Germany', 'Germany' - }, - 1861: {'East Germany', 'Germany' - }, - 1862: {'East Germany', 'Germany' - }, - 1863: {'East Germany', 'Germany' - }, - 1864: {'East Germany', 'Germany' - }, - 1865: {'East Germany', 'Germany' - }, - 1866: {'East Germany', 'Germany' - }, - 1867: {'East Germany', 'Germany' - }, - 1868: {'East Germany', 'Germany' - }, - 1869: {'East Germany', 'Germany' - }, - 1870: {'East Germany', 'Germany' - }, - 1871: {'East Germany', 'Germany' - }, - 1872: {'East Germany', 'Germany' - }, - 1873: {'East Germany', 'Germany' - }, - 1874: {'East Germany', 'Germany' - }, - 1875: {'East Germany', 'Germany' - }, - 1876: {'East Germany', 'Germany' - }, - 1877: {'East Germany', 'Germany' - }, - 1878: {'East Germany', 'Germany' - }, - 1879: {'East Germany', 'Germany' - }, - 1880: {'East Germany', 'Germany' - }, - 1881: {'East Germany', 'Germany' - }, - 1882: {'East Germany', 'Germany' - }, - 1883: {'East Germany', 'Germany' - }, - 1884: {'East Germany', 'Germany' - }, - 1885: {'East Germany', 'Germany' - }, - 1886: {'East Germany', 'Germany' - }, - 1887: {'East Germany', 'Germany' - }, - 1888: {'East Germany', 'Germany' - }, - 1889: {'East Germany', 'Germany' - }, - 1890: {'East Germany', 'Germany' - }, - 1891: {'East Germany', 'Germany' - }, - 1892: {'East Germany', 'Germany' - }, - 1893: {'East Germany', 'Germany' - }, - 1894: {'East Germany', 'Germany' - }, - 1895: {'East Germany', 'Germany' - }, - 1896: {'East Germany', 'Germany' - }, - 1897: {'East Germany', 'Germany' - }, - 1898: {'East Germany', 'Germany' - }, - 1899: {'East Germany', 'Germany' - }, - 1900: {'East Germany', 'Germany' - }, - 1901: {'East Germany', 'Germany' - }, - 1902: {'East Germany', 'Germany' - }, - 1903: {'East Germany', 'Germany' - }, - 1904: {'East Germany', 'Germany' - }, - 1905: {'East Germany', 'Germany' - }, - 1906: {'East Germany', 'Germany' - }, - 1907: {'East Germany', 'Germany' - }, - 1908: {'East Germany', 'Germany' - }, - 1909: {'East Germany', 'Germany' - }, - 1910: {'East Germany', 'Germany' - }, - 1911: {'East Germany', 'Germany' - }, - 1912: {'East Germany', 'Germany' - }, - 1913: {'East Germany', 'Germany' - }, - 1914: {'East Germany', 'Germany' - }, - 1915: {'East Germany', 'Germany' - }, - 1916: {'East Germany', 'Germany' - }, - 1917: {'East Germany', 'Germany' - }, - 1918: {'East Germany', 'Germany' - }, - 1919: {'East Germany', 'Germany' - }, - 1920: {'East Germany', 'Germany' - }, - 1921: {'East Germany', 'Germany' - }, - 1922: {'East Germany', 'Germany' - }, - 1923: {'East Germany', 'Germany' - }, - 1924: {'East Germany', 'Germany' - }, - 1925: {'East Germany', 'Germany' - }, - 1926: {'East Germany', 'Germany' - }, - 1927: {'East Germany', 'Germany' - }, - 1928: {'East Germany', 'Germany' - }, - 1929: {'East Germany', 'Germany' - }, - 1930: {'East Germany', 'Germany' - }, - 1931: {'East Germany', 'Germany' - }, - 1932: {'East Germany', 'Germany' - }, - 1933: {'East Germany', 'Germany' - }, - 1934: {'East Germany', 'Germany' - }, - 1935: {'East Germany', 'Germany' - }, - 1936: {'East Germany', 'Germany' - }, - 1937: {'East Germany', 'Germany' - }, - 1938: {'East Germany', 'Germany' - }, - 1939: {'East Germany', 'Germany' - }, - 1940: {'East Germany', 'Germany' - }, - 1941: {'East Germany', 'Germany' - }, - 1942: {'East Germany', 'Germany' - }, - 1943: {'East Germany', 'Germany' - }, - 1944: {'East Germany', 'Germany' - }, - 1945: {'East Germany', 'Germany' - }, - 1946: {'East Germany', 'Germany' - }, - 1947: {'East Germany', 'Germany' - }, - 1948: {'East Germany', 'Germany' - }, - 1949: {'East Germany', 'Germany' - }, - 1950: {'East Germany', 'Germany' - }, - 1951: {'East Germany', 'Germany' - }, - 1952: {'East Germany', 'Germany' - }, - 1953: {'East Germany', 'Germany' - }, - 1954: {'East Germany', 'Germany' - }, - 1955: {'East Germany', 'Germany' - }, - 1956: {'East Germany', 'Germany' - }, - 1957: {'East Germany', 'Germany' - }, - 1958: {'East Germany', 'Germany' - }, - 1959: {'East Germany', 'Germany' - }, - 1960: {'East Germany', 'Germany' - }, - 1961: {'East Germany', 'Germany' - }, - 1962: {'East Germany', 'Germany' - }, - 1963: {'East Germany', 'Germany' - }, - 1964: {'East Germany', 'Germany' - }, - 1965: {'East Germany', 'Germany' - }, - 1966: {'East Germany', 'Germany' - }, - 1967: {'East Germany', 'Germany' - }, - 1968: {'East Germany', 'Germany' - }, - 1969: {'East Germany', 'Germany' - }, - 1970: {'East Germany', 'Germany' - }, - 1971: {'East Germany', 'Germany' - }, - 1972: {'East Germany', 'Germany' - }, - 1973: {'East Germany', 'Germany' - }, - 1974: {'East Germany', 'Germany' - }, - 1975: {'East Germany', 'Germany' - }, - 1976: {'East Germany', 'Germany' - }, - 1977: {'East Germany', 'Germany' - }, - 1978: {'East Germany', 'Germany' - }, - 1979: {'East Germany', 'Germany' - }, - 1980: {'East Germany', 'Germany' - }, - 1981: {'East Germany', 'Germany' - }, - 1982: {'East Germany', 'Germany' - }, - 1983: {'East Germany', 'Germany' - }, - 1984: {'East Germany', 'Germany' - }, - 1985: {'East Germany', 'Germany' - }, - 1986: {'East Germany', 'Germany' - }, - 1987: {'East Germany', 'Germany' - }, - 1988: {'East Germany', 'Germany' - }, - 1989: {'East Germany', 'Germany' - }, - 1990: {'East Germany', 'Germany' - }, - 1991: {'East Germany', 'Germany' - }, - 1992: {'East Germany', 'Germany' - }, - 1993: {'East Germany', 'Germany' - }, - 1994: {'East Germany', 'Germany' - }, - 1995: {'East Germany', 'Germany' - }, - 1996: {'East Germany', 'Germany' - }, - 1997: {'East Germany', 'Germany' - }, - 1998: {'East Germany', 'Germany' - }, - 1999: {'East Germany', 'Germany' - }, - 2000: {'East Germany', 'Germany' - }, - 2001: {'East Germany', 'Germany' - }, - 2002: {'East Germany', 'Germany' - }, - 2003: {'East Germany', 'Germany' - }, - 2004: {'East Germany', 'Germany' - }, - 2005: {'East Germany', 'Germany' - }, - 2006: {'East Germany', 'Germany' - }, - 2007: {'East Germany', 'Germany' - }, - 2008: {'East Germany', 'Germany' - }, - 2009: {'East Germany', 'Germany' - }, - 2010: {'East Germany', 'Germany' - }, - 2011: {'East Germany', 'Germany' - }, - 2012: {'East Germany', 'Germany' - }, - 2013: {'East Germany', 'Germany' - }, - 2014: {'East Germany', 'Germany' - }, - 2015: {'East Germany', 'Germany' - }, - 2016: {'East Germany', 'Germany' - }, - 2017: {'East Germany', 'Germany' - }, - 2018: {'East Germany', 'Germany' - }, - 2019: {'East Germany', 'Germany' - }, - 2020: {'East Germany', 'Germany' - }, - 2021: {'East Germany', 'Germany' - }, - 2022: {'East Germany', 'Germany' - }, - 2023: {'East Germany', 'Germany' - } - }, - { - 1789: {'Germany', 'Grand Duchy of Baden' - }, - 1790: {'Germany', 'Grand Duchy of Baden' - }, - 1791: {'Germany', 'Grand Duchy of Baden' - }, - 1792: {'Germany', 'Grand Duchy of Baden' - }, - 1793: {'Germany', 'Grand Duchy of Baden' - }, - 1794: {'Germany', 'Grand Duchy of Baden' - }, - 1795: {'Germany', 'Grand Duchy of Baden' - }, - 1796: {'Germany', 'Grand Duchy of Baden' - }, - 1797: {'Germany', 'Grand Duchy of Baden' - }, - 1798: {'Germany', 'Grand Duchy of Baden' - }, - 1799: {'Germany', 'Grand Duchy of Baden' - }, - 1800: {'Germany', 'Grand Duchy of Baden' - }, - 1801: {'Germany', 'Grand Duchy of Baden' - }, - 1802: {'Germany', 'Grand Duchy of Baden' - }, - 1803: {'Germany', 'Grand Duchy of Baden' - }, - 1804: {'Germany', 'Grand Duchy of Baden' - }, - 1805: {'Germany', 'Grand Duchy of Baden' - }, - 1806: {'Germany', 'Grand Duchy of Baden' - }, - 1807: {'Germany', 'Grand Duchy of Baden' - }, - 1808: {'Germany', 'Grand Duchy of Baden' - }, - 1809: {'Germany', 'Grand Duchy of Baden' - }, - 1810: {'Germany', 'Grand Duchy of Baden' - }, - 1811: {'Germany', 'Grand Duchy of Baden' - }, - 1812: {'Germany', 'Grand Duchy of Baden' - }, - 1813: {'Germany', 'Grand Duchy of Baden' - }, - 1814: {'Germany', 'Grand Duchy of Baden' - }, - 1815: {'Germany', 'Grand Duchy of Baden' - }, - 1816: {'Germany', 'Grand Duchy of Baden' - }, - 1817: {'Germany', 'Grand Duchy of Baden' - }, - 1818: {'Germany', 'Grand Duchy of Baden' - }, - 1819: {'Germany', 'Grand Duchy of Baden' - }, - 1820: {'Germany', 'Grand Duchy of Baden' - }, - 1821: {'Germany', 'Grand Duchy of Baden' - }, - 1822: {'Germany', 'Grand Duchy of Baden' - }, - 1823: {'Germany', 'Grand Duchy of Baden' - }, - 1824: {'Germany', 'Grand Duchy of Baden' - }, - 1825: {'Germany', 'Grand Duchy of Baden' - }, - 1826: {'Germany', 'Grand Duchy of Baden' - }, - 1827: {'Germany', 'Grand Duchy of Baden' - }, - 1828: {'Germany', 'Grand Duchy of Baden' - }, - 1829: {'Germany', 'Grand Duchy of Baden' - }, - 1830: {'Germany', 'Grand Duchy of Baden' - }, - 1831: {'Germany', 'Grand Duchy of Baden' - }, - 1832: {'Germany', 'Grand Duchy of Baden' - }, - 1833: {'Germany', 'Grand Duchy of Baden' - }, - 1834: {'Germany', 'Grand Duchy of Baden' - }, - 1835: {'Germany', 'Grand Duchy of Baden' - }, - 1836: {'Germany', 'Grand Duchy of Baden' - }, - 1837: {'Germany', 'Grand Duchy of Baden' - }, - 1838: {'Germany', 'Grand Duchy of Baden' - }, - 1839: {'Germany', 'Grand Duchy of Baden' - }, - 1840: {'Germany', 'Grand Duchy of Baden' - }, - 1841: {'Germany', 'Grand Duchy of Baden' - }, - 1842: {'Germany', 'Grand Duchy of Baden' - }, - 1843: {'Germany', 'Grand Duchy of Baden' - }, - 1844: {'Germany', 'Grand Duchy of Baden' - }, - 1845: {'Germany', 'Grand Duchy of Baden' - }, - 1846: {'Germany', 'Grand Duchy of Baden' - }, - 1847: {'Germany', 'Grand Duchy of Baden' - }, - 1848: {'Germany', 'Grand Duchy of Baden' - }, - 1849: {'Germany', 'Grand Duchy of Baden' - }, - 1850: {'Germany', 'Grand Duchy of Baden' - }, - 1851: {'Germany', 'Grand Duchy of Baden' - }, - 1852: {'Germany', 'Grand Duchy of Baden' - }, - 1853: {'Germany', 'Grand Duchy of Baden' - }, - 1854: {'Germany', 'Grand Duchy of Baden' - }, - 1855: {'Germany', 'Grand Duchy of Baden' - }, - 1856: {'Germany', 'Grand Duchy of Baden' - }, - 1857: {'Germany', 'Grand Duchy of Baden' - }, - 1858: {'Germany', 'Grand Duchy of Baden' - }, - 1859: {'Germany', 'Grand Duchy of Baden' - }, - 1860: {'Germany', 'Grand Duchy of Baden' - }, - 1861: {'Germany', 'Grand Duchy of Baden' - }, - 1862: {'Germany', 'Grand Duchy of Baden' - }, - 1863: {'Germany', 'Grand Duchy of Baden' - }, - 1864: {'Germany', 'Grand Duchy of Baden' - }, - 1865: {'Germany', 'Grand Duchy of Baden' - }, - 1866: {'Germany', 'Grand Duchy of Baden' - }, - 1867: {'Germany', 'Grand Duchy of Baden' - }, - 1868: {'Germany', 'Grand Duchy of Baden' - }, - 1869: {'Germany', 'Grand Duchy of Baden' - }, - 1870: {'Germany', 'Grand Duchy of Baden' - }, - 1871: {'Germany', 'Grand Duchy of Baden' - }, - 1872: {'Germany', 'Grand Duchy of Baden' - }, - 1873: {'Germany', 'Grand Duchy of Baden' - }, - 1874: {'Germany', 'Grand Duchy of Baden' - }, - 1875: {'Germany', 'Grand Duchy of Baden' - }, - 1876: {'Germany', 'Grand Duchy of Baden' - }, - 1877: {'Germany', 'Grand Duchy of Baden' - }, - 1878: {'Germany', 'Grand Duchy of Baden' - }, - 1879: {'Germany', 'Grand Duchy of Baden' - }, - 1880: {'Germany', 'Grand Duchy of Baden' - }, - 1881: {'Germany', 'Grand Duchy of Baden' - }, - 1882: {'Germany', 'Grand Duchy of Baden' - }, - 1883: {'Germany', 'Grand Duchy of Baden' - }, - 1884: {'Germany', 'Grand Duchy of Baden' - }, - 1885: {'Germany', 'Grand Duchy of Baden' - }, - 1886: {'Germany', 'Grand Duchy of Baden' - }, - 1887: {'Germany', 'Grand Duchy of Baden' - }, - 1888: {'Germany', 'Grand Duchy of Baden' - }, - 1889: {'Germany', 'Grand Duchy of Baden' - }, - 1890: {'Germany', 'Grand Duchy of Baden' - }, - 1891: {'Germany', 'Grand Duchy of Baden' - }, - 1892: {'Germany', 'Grand Duchy of Baden' - }, - 1893: {'Germany', 'Grand Duchy of Baden' - }, - 1894: {'Germany', 'Grand Duchy of Baden' - }, - 1895: {'Germany', 'Grand Duchy of Baden' - }, - 1896: {'Germany', 'Grand Duchy of Baden' - }, - 1897: {'Germany', 'Grand Duchy of Baden' - }, - 1898: {'Germany', 'Grand Duchy of Baden' - }, - 1899: {'Germany', 'Grand Duchy of Baden' - }, - 1900: {'Germany', 'Grand Duchy of Baden' - }, - 1901: {'Germany', 'Grand Duchy of Baden' - }, - 1902: {'Germany', 'Grand Duchy of Baden' - }, - 1903: {'Germany', 'Grand Duchy of Baden' - }, - 1904: {'Germany', 'Grand Duchy of Baden' - }, - 1905: {'Germany', 'Grand Duchy of Baden' - }, - 1906: {'Germany', 'Grand Duchy of Baden' - }, - 1907: {'Germany', 'Grand Duchy of Baden' - }, - 1908: {'Germany', 'Grand Duchy of Baden' - }, - 1909: {'Germany', 'Grand Duchy of Baden' - }, - 1910: {'Germany', 'Grand Duchy of Baden' - }, - 1911: {'Germany', 'Grand Duchy of Baden' - }, - 1912: {'Germany', 'Grand Duchy of Baden' - }, - 1913: {'Germany', 'Grand Duchy of Baden' - }, - 1914: {'Germany', 'Grand Duchy of Baden' - }, - 1915: {'Germany', 'Grand Duchy of Baden' - }, - 1916: {'Germany', 'Grand Duchy of Baden' - }, - 1917: {'Germany', 'Grand Duchy of Baden' - }, - 1918: {'Germany', 'Grand Duchy of Baden' - }, - 1919: {'Germany', 'Grand Duchy of Baden' - }, - 1920: {'Germany', 'Grand Duchy of Baden' - }, - 1921: {'Germany', 'Grand Duchy of Baden' - }, - 1922: {'Germany', 'Grand Duchy of Baden' - }, - 1923: {'Germany', 'Grand Duchy of Baden' - }, - 1924: {'Germany', 'Grand Duchy of Baden' - }, - 1925: {'Germany', 'Grand Duchy of Baden' - }, - 1926: {'Germany', 'Grand Duchy of Baden' - }, - 1927: {'Germany', 'Grand Duchy of Baden' - }, - 1928: {'Germany', 'Grand Duchy of Baden' - }, - 1929: {'Germany', 'Grand Duchy of Baden' - }, - 1930: {'Germany', 'Grand Duchy of Baden' - }, - 1931: {'Germany', 'Grand Duchy of Baden' - }, - 1932: {'Germany', 'Grand Duchy of Baden' - }, - 1933: {'Germany', 'Grand Duchy of Baden' - }, - 1934: {'Germany', 'Grand Duchy of Baden' - }, - 1935: {'Germany', 'Grand Duchy of Baden' - }, - 1936: {'Germany', 'Grand Duchy of Baden' - }, - 1937: {'Germany', 'Grand Duchy of Baden' - }, - 1938: {'Germany', 'Grand Duchy of Baden' - }, - 1939: {'Germany', 'Grand Duchy of Baden' - }, - 1940: {'Germany', 'Grand Duchy of Baden' - }, - 1941: {'Germany', 'Grand Duchy of Baden' - }, - 1942: {'Germany', 'Grand Duchy of Baden' - }, - 1943: {'Germany', 'Grand Duchy of Baden' - }, - 1944: {'Germany', 'Grand Duchy of Baden' - }, - 1945: {'Germany', 'Grand Duchy of Baden' - }, - 1946: {'Germany', 'Grand Duchy of Baden' - }, - 1947: {'Germany', 'Grand Duchy of Baden' - }, - 1948: {'Germany', 'Grand Duchy of Baden' - }, - 1949: {'Germany', 'Grand Duchy of Baden' - }, - 1950: {'Germany', 'Grand Duchy of Baden' - }, - 1951: {'Germany', 'Grand Duchy of Baden' - }, - 1952: {'Germany', 'Grand Duchy of Baden' - }, - 1953: {'Germany', 'Grand Duchy of Baden' - }, - 1954: {'Germany', 'Grand Duchy of Baden' - }, - 1955: {'Germany', 'Grand Duchy of Baden' - }, - 1956: {'Germany', 'Grand Duchy of Baden' - }, - 1957: {'Germany', 'Grand Duchy of Baden' - }, - 1958: {'Germany', 'Grand Duchy of Baden' - }, - 1959: {'Germany', 'Grand Duchy of Baden' - }, - 1960: {'Germany', 'Grand Duchy of Baden' - }, - 1961: {'Germany', 'Grand Duchy of Baden' - }, - 1962: {'Germany', 'Grand Duchy of Baden' - }, - 1963: {'Germany', 'Grand Duchy of Baden' - }, - 1964: {'Germany', 'Grand Duchy of Baden' - }, - 1965: {'Germany', 'Grand Duchy of Baden' - }, - 1966: {'Germany', 'Grand Duchy of Baden' - }, - 1967: {'Germany', 'Grand Duchy of Baden' - }, - 1968: {'Germany', 'Grand Duchy of Baden' - }, - 1969: {'Germany', 'Grand Duchy of Baden' - }, - 1970: {'Germany', 'Grand Duchy of Baden' - }, - 1971: {'Germany', 'Grand Duchy of Baden' - }, - 1972: {'Germany', 'Grand Duchy of Baden' - }, - 1973: {'Germany', 'Grand Duchy of Baden' - }, - 1974: {'Germany', 'Grand Duchy of Baden' - }, - 1975: {'Germany', 'Grand Duchy of Baden' - }, - 1976: {'Germany', 'Grand Duchy of Baden' - }, - 1977: {'Germany', 'Grand Duchy of Baden' - }, - 1978: {'Germany', 'Grand Duchy of Baden' - }, - 1979: {'Germany', 'Grand Duchy of Baden' - }, - 1980: {'Germany', 'Grand Duchy of Baden' - }, - 1981: {'Germany', 'Grand Duchy of Baden' - }, - 1982: {'Germany', 'Grand Duchy of Baden' - }, - 1983: {'Germany', 'Grand Duchy of Baden' - }, - 1984: {'Germany', 'Grand Duchy of Baden' - }, - 1985: {'Germany', 'Grand Duchy of Baden' - }, - 1986: {'Germany', 'Grand Duchy of Baden' - }, - 1987: {'Germany', 'Grand Duchy of Baden' - }, - 1988: {'Germany', 'Grand Duchy of Baden' - }, - 1989: {'Germany', 'Grand Duchy of Baden' - }, - 1990: {'Germany', 'Grand Duchy of Baden' - }, - 1991: {'Germany', 'Grand Duchy of Baden' - }, - 1992: {'Germany', 'Grand Duchy of Baden' - }, - 1993: {'Germany', 'Grand Duchy of Baden' - }, - 1994: {'Germany', 'Grand Duchy of Baden' - }, - 1995: {'Germany', 'Grand Duchy of Baden' - }, - 1996: {'Germany', 'Grand Duchy of Baden' - }, - 1997: {'Germany', 'Grand Duchy of Baden' - }, - 1998: {'Germany', 'Grand Duchy of Baden' - }, - 1999: {'Germany', 'Grand Duchy of Baden' - }, - 2000: {'Germany', 'Grand Duchy of Baden' - }, - 2001: {'Germany', 'Grand Duchy of Baden' - }, - 2002: {'Germany', 'Grand Duchy of Baden' - }, - 2003: {'Germany', 'Grand Duchy of Baden' - }, - 2004: {'Germany', 'Grand Duchy of Baden' - }, - 2005: {'Germany', 'Grand Duchy of Baden' - }, - 2006: {'Germany', 'Grand Duchy of Baden' - }, - 2007: {'Germany', 'Grand Duchy of Baden' - }, - 2008: {'Germany', 'Grand Duchy of Baden' - }, - 2009: {'Germany', 'Grand Duchy of Baden' - }, - 2010: {'Germany', 'Grand Duchy of Baden' - }, - 2011: {'Germany', 'Grand Duchy of Baden' - }, - 2012: {'Germany', 'Grand Duchy of Baden' - }, - 2013: {'Germany', 'Grand Duchy of Baden' - }, - 2014: {'Germany', 'Grand Duchy of Baden' - }, - 2015: {'Germany', 'Grand Duchy of Baden' - }, - 2016: {'Germany', 'Grand Duchy of Baden' - }, - 2017: {'Germany', 'Grand Duchy of Baden' - }, - 2018: {'Germany', 'Grand Duchy of Baden' - }, - 2019: {'Germany', 'Grand Duchy of Baden' - }, - 2020: {'Germany', 'Grand Duchy of Baden' - }, - 2021: {'Germany', 'Grand Duchy of Baden' - }, - 2022: {'Germany', 'Grand Duchy of Baden' - }, - 2023: {'Germany', 'Grand Duchy of Baden' - } - }, - { - 1789: {'Germany', 'Kingdom of Bavaria' - }, - 1790: {'Germany', 'Kingdom of Bavaria' - }, - 1791: {'Germany', 'Kingdom of Bavaria' - }, - 1792: {'Germany', 'Kingdom of Bavaria' - }, - 1793: {'Germany', 'Kingdom of Bavaria' - }, - 1794: {'Germany', 'Kingdom of Bavaria' - }, - 1795: {'Germany', 'Kingdom of Bavaria' - }, - 1796: {'Germany', 'Kingdom of Bavaria' - }, - 1797: {'Germany', 'Kingdom of Bavaria' - }, - 1798: {'Germany', 'Kingdom of Bavaria' - }, - 1799: {'Germany', 'Kingdom of Bavaria' - }, - 1800: {'Germany', 'Kingdom of Bavaria' - }, - 1801: {'Germany', 'Kingdom of Bavaria' - }, - 1802: {'Germany', 'Kingdom of Bavaria' - }, - 1803: {'Germany', 'Kingdom of Bavaria' - }, - 1804: {'Germany', 'Kingdom of Bavaria' - }, - 1805: {'Germany', 'Kingdom of Bavaria' - }, - 1806: {'Germany', 'Kingdom of Bavaria' - }, - 1807: {'Germany', 'Kingdom of Bavaria' - }, - 1808: {'Germany', 'Kingdom of Bavaria' - }, - 1809: {'Germany', 'Kingdom of Bavaria' - }, - 1810: {'Germany', 'Kingdom of Bavaria' - }, - 1811: {'Germany', 'Kingdom of Bavaria' - }, - 1812: {'Germany', 'Kingdom of Bavaria' - }, - 1813: {'Germany', 'Kingdom of Bavaria' - }, - 1814: {'Germany', 'Kingdom of Bavaria' - }, - 1815: {'Germany', 'Kingdom of Bavaria' - }, - 1816: {'Germany', 'Kingdom of Bavaria' - }, - 1817: {'Germany', 'Kingdom of Bavaria' - }, - 1818: {'Germany', 'Kingdom of Bavaria' - }, - 1819: {'Germany', 'Kingdom of Bavaria' - }, - 1820: {'Germany', 'Kingdom of Bavaria' - }, - 1821: {'Germany', 'Kingdom of Bavaria' - }, - 1822: {'Germany', 'Kingdom of Bavaria' - }, - 1823: {'Germany', 'Kingdom of Bavaria' - }, - 1824: {'Germany', 'Kingdom of Bavaria' - }, - 1825: {'Germany', 'Kingdom of Bavaria' - }, - 1826: {'Germany', 'Kingdom of Bavaria' - }, - 1827: {'Germany', 'Kingdom of Bavaria' - }, - 1828: {'Germany', 'Kingdom of Bavaria' - }, - 1829: {'Germany', 'Kingdom of Bavaria' - }, - 1830: {'Germany', 'Kingdom of Bavaria' - }, - 1831: {'Germany', 'Kingdom of Bavaria' - }, - 1832: {'Germany', 'Kingdom of Bavaria' - }, - 1833: {'Germany', 'Kingdom of Bavaria' - }, - 1834: {'Germany', 'Kingdom of Bavaria' - }, - 1835: {'Germany', 'Kingdom of Bavaria' - }, - 1836: {'Germany', 'Kingdom of Bavaria' - }, - 1837: {'Germany', 'Kingdom of Bavaria' - }, - 1838: {'Germany', 'Kingdom of Bavaria' - }, - 1839: {'Germany', 'Kingdom of Bavaria' - }, - 1840: {'Germany', 'Kingdom of Bavaria' - }, - 1841: {'Germany', 'Kingdom of Bavaria' - }, - 1842: {'Germany', 'Kingdom of Bavaria' - }, - 1843: {'Germany', 'Kingdom of Bavaria' - }, - 1844: {'Germany', 'Kingdom of Bavaria' - }, - 1845: {'Germany', 'Kingdom of Bavaria' - }, - 1846: {'Germany', 'Kingdom of Bavaria' - }, - 1847: {'Germany', 'Kingdom of Bavaria' - }, - 1848: {'Germany', 'Kingdom of Bavaria' - }, - 1849: {'Germany', 'Kingdom of Bavaria' - }, - 1850: {'Germany', 'Kingdom of Bavaria' - }, - 1851: {'Germany', 'Kingdom of Bavaria' - }, - 1852: {'Germany', 'Kingdom of Bavaria' - }, - 1853: {'Germany', 'Kingdom of Bavaria' - }, - 1854: {'Germany', 'Kingdom of Bavaria' - }, - 1855: {'Germany', 'Kingdom of Bavaria' - }, - 1856: {'Germany', 'Kingdom of Bavaria' - }, - 1857: {'Germany', 'Kingdom of Bavaria' - }, - 1858: {'Germany', 'Kingdom of Bavaria' - }, - 1859: {'Germany', 'Kingdom of Bavaria' - }, - 1860: {'Germany', 'Kingdom of Bavaria' - }, - 1861: {'Germany', 'Kingdom of Bavaria' - }, - 1862: {'Germany', 'Kingdom of Bavaria' - }, - 1863: {'Germany', 'Kingdom of Bavaria' - }, - 1864: {'Germany', 'Kingdom of Bavaria' - }, - 1865: {'Germany', 'Kingdom of Bavaria' - }, - 1866: {'Germany', 'Kingdom of Bavaria' - }, - 1867: {'Germany', 'Kingdom of Bavaria' - }, - 1868: {'Germany', 'Kingdom of Bavaria' - }, - 1869: {'Germany', 'Kingdom of Bavaria' - }, - 1870: {'Germany', 'Kingdom of Bavaria' - }, - 1871: {'Germany', 'Kingdom of Bavaria' - }, - 1872: {'Germany', 'Kingdom of Bavaria' - }, - 1873: {'Germany', 'Kingdom of Bavaria' - }, - 1874: {'Germany', 'Kingdom of Bavaria' - }, - 1875: {'Germany', 'Kingdom of Bavaria' - }, - 1876: {'Germany', 'Kingdom of Bavaria' - }, - 1877: {'Germany', 'Kingdom of Bavaria' - }, - 1878: {'Germany', 'Kingdom of Bavaria' - }, - 1879: {'Germany', 'Kingdom of Bavaria' - }, - 1880: {'Germany', 'Kingdom of Bavaria' - }, - 1881: {'Germany', 'Kingdom of Bavaria' - }, - 1882: {'Germany', 'Kingdom of Bavaria' - }, - 1883: {'Germany', 'Kingdom of Bavaria' - }, - 1884: {'Germany', 'Kingdom of Bavaria' - }, - 1885: {'Germany', 'Kingdom of Bavaria' - }, - 1886: {'Germany', 'Kingdom of Bavaria' - }, - 1887: {'Germany', 'Kingdom of Bavaria' - }, - 1888: {'Germany', 'Kingdom of Bavaria' - }, - 1889: {'Germany', 'Kingdom of Bavaria' - }, - 1890: {'Germany', 'Kingdom of Bavaria' - }, - 1891: {'Germany', 'Kingdom of Bavaria' - }, - 1892: {'Germany', 'Kingdom of Bavaria' - }, - 1893: {'Germany', 'Kingdom of Bavaria' - }, - 1894: {'Germany', 'Kingdom of Bavaria' - }, - 1895: {'Germany', 'Kingdom of Bavaria' - }, - 1896: {'Germany', 'Kingdom of Bavaria' - }, - 1897: {'Germany', 'Kingdom of Bavaria' - }, - 1898: {'Germany', 'Kingdom of Bavaria' - }, - 1899: {'Germany', 'Kingdom of Bavaria' - }, - 1900: {'Germany', 'Kingdom of Bavaria' - }, - 1901: {'Germany', 'Kingdom of Bavaria' - }, - 1902: {'Germany', 'Kingdom of Bavaria' - }, - 1903: {'Germany', 'Kingdom of Bavaria' - }, - 1904: {'Germany', 'Kingdom of Bavaria' - }, - 1905: {'Germany', 'Kingdom of Bavaria' - }, - 1906: {'Germany', 'Kingdom of Bavaria' - }, - 1907: {'Germany', 'Kingdom of Bavaria' - }, - 1908: {'Germany', 'Kingdom of Bavaria' - }, - 1909: {'Germany', 'Kingdom of Bavaria' - }, - 1910: {'Germany', 'Kingdom of Bavaria' - }, - 1911: {'Germany', 'Kingdom of Bavaria' - }, - 1912: {'Germany', 'Kingdom of Bavaria' - }, - 1913: {'Germany', 'Kingdom of Bavaria' - }, - 1914: {'Germany', 'Kingdom of Bavaria' - }, - 1915: {'Germany', 'Kingdom of Bavaria' - }, - 1916: {'Germany', 'Kingdom of Bavaria' - }, - 1917: {'Germany', 'Kingdom of Bavaria' - }, - 1918: {'Germany', 'Kingdom of Bavaria' - }, - 1919: {'Germany', 'Kingdom of Bavaria' - }, - 1920: {'Germany', 'Kingdom of Bavaria' - }, - 1921: {'Germany', 'Kingdom of Bavaria' - }, - 1922: {'Germany', 'Kingdom of Bavaria' - }, - 1923: {'Germany', 'Kingdom of Bavaria' - }, - 1924: {'Germany', 'Kingdom of Bavaria' - }, - 1925: {'Germany', 'Kingdom of Bavaria' - }, - 1926: {'Germany', 'Kingdom of Bavaria' - }, - 1927: {'Germany', 'Kingdom of Bavaria' - }, - 1928: {'Germany', 'Kingdom of Bavaria' - }, - 1929: {'Germany', 'Kingdom of Bavaria' - }, - 1930: {'Germany', 'Kingdom of Bavaria' - }, - 1931: {'Germany', 'Kingdom of Bavaria' - }, - 1932: {'Germany', 'Kingdom of Bavaria' - }, - 1933: {'Germany', 'Kingdom of Bavaria' - }, - 1934: {'Germany', 'Kingdom of Bavaria' - }, - 1935: {'Germany', 'Kingdom of Bavaria' - }, - 1936: {'Germany', 'Kingdom of Bavaria' - }, - 1937: {'Germany', 'Kingdom of Bavaria' - }, - 1938: {'Germany', 'Kingdom of Bavaria' - }, - 1939: {'Germany', 'Kingdom of Bavaria' - }, - 1940: {'Germany', 'Kingdom of Bavaria' - }, - 1941: {'Germany', 'Kingdom of Bavaria' - }, - 1942: {'Germany', 'Kingdom of Bavaria' - }, - 1943: {'Germany', 'Kingdom of Bavaria' - }, - 1944: {'Germany', 'Kingdom of Bavaria' - }, - 1945: {'Germany', 'Kingdom of Bavaria' - }, - 1946: {'Germany', 'Kingdom of Bavaria' - }, - 1947: {'Germany', 'Kingdom of Bavaria' - }, - 1948: {'Germany', 'Kingdom of Bavaria' - }, - 1949: {'Germany', 'Kingdom of Bavaria' - }, - 1950: {'Germany', 'Kingdom of Bavaria' - }, - 1951: {'Germany', 'Kingdom of Bavaria' - }, - 1952: {'Germany', 'Kingdom of Bavaria' - }, - 1953: {'Germany', 'Kingdom of Bavaria' - }, - 1954: {'Germany', 'Kingdom of Bavaria' - }, - 1955: {'Germany', 'Kingdom of Bavaria' - }, - 1956: {'Germany', 'Kingdom of Bavaria' - }, - 1957: {'Germany', 'Kingdom of Bavaria' - }, - 1958: {'Germany', 'Kingdom of Bavaria' - }, - 1959: {'Germany', 'Kingdom of Bavaria' - }, - 1960: {'Germany', 'Kingdom of Bavaria' - }, - 1961: {'Germany', 'Kingdom of Bavaria' - }, - 1962: {'Germany', 'Kingdom of Bavaria' - }, - 1963: {'Germany', 'Kingdom of Bavaria' - }, - 1964: {'Germany', 'Kingdom of Bavaria' - }, - 1965: {'Germany', 'Kingdom of Bavaria' - }, - 1966: {'Germany', 'Kingdom of Bavaria' - }, - 1967: {'Germany', 'Kingdom of Bavaria' - }, - 1968: {'Germany', 'Kingdom of Bavaria' - }, - 1969: {'Germany', 'Kingdom of Bavaria' - }, - 1970: {'Germany', 'Kingdom of Bavaria' - }, - 1971: {'Germany', 'Kingdom of Bavaria' - }, - 1972: {'Germany', 'Kingdom of Bavaria' - }, - 1973: {'Germany', 'Kingdom of Bavaria' - }, - 1974: {'Germany', 'Kingdom of Bavaria' - }, - 1975: {'Germany', 'Kingdom of Bavaria' - }, - 1976: {'Germany', 'Kingdom of Bavaria' - }, - 1977: {'Germany', 'Kingdom of Bavaria' - }, - 1978: {'Germany', 'Kingdom of Bavaria' - }, - 1979: {'Germany', 'Kingdom of Bavaria' - }, - 1980: {'Germany', 'Kingdom of Bavaria' - }, - 1981: {'Germany', 'Kingdom of Bavaria' - }, - 1982: {'Germany', 'Kingdom of Bavaria' - }, - 1983: {'Germany', 'Kingdom of Bavaria' - }, - 1984: {'Germany', 'Kingdom of Bavaria' - }, - 1985: {'Germany', 'Kingdom of Bavaria' - }, - 1986: {'Germany', 'Kingdom of Bavaria' - }, - 1987: {'Germany', 'Kingdom of Bavaria' - }, - 1988: {'Germany', 'Kingdom of Bavaria' - }, - 1989: {'Germany', 'Kingdom of Bavaria' - }, - 1990: {'Germany', 'Kingdom of Bavaria' - }, - 1991: {'Germany', 'Kingdom of Bavaria' - }, - 1992: {'Germany', 'Kingdom of Bavaria' - }, - 1993: {'Germany', 'Kingdom of Bavaria' - }, - 1994: {'Germany', 'Kingdom of Bavaria' - }, - 1995: {'Germany', 'Kingdom of Bavaria' - }, - 1996: {'Germany', 'Kingdom of Bavaria' - }, - 1997: {'Germany', 'Kingdom of Bavaria' - }, - 1998: {'Germany', 'Kingdom of Bavaria' - }, - 1999: {'Germany', 'Kingdom of Bavaria' - }, - 2000: {'Germany', 'Kingdom of Bavaria' - }, - 2001: {'Germany', 'Kingdom of Bavaria' - }, - 2002: {'Germany', 'Kingdom of Bavaria' - }, - 2003: {'Germany', 'Kingdom of Bavaria' - }, - 2004: {'Germany', 'Kingdom of Bavaria' - }, - 2005: {'Germany', 'Kingdom of Bavaria' - }, - 2006: {'Germany', 'Kingdom of Bavaria' - }, - 2007: {'Germany', 'Kingdom of Bavaria' - }, - 2008: {'Germany', 'Kingdom of Bavaria' - }, - 2009: {'Germany', 'Kingdom of Bavaria' - }, - 2010: {'Germany', 'Kingdom of Bavaria' - }, - 2011: {'Germany', 'Kingdom of Bavaria' - }, - 2012: {'Germany', 'Kingdom of Bavaria' - }, - 2013: {'Germany', 'Kingdom of Bavaria' - }, - 2014: {'Germany', 'Kingdom of Bavaria' - }, - 2015: {'Germany', 'Kingdom of Bavaria' - }, - 2016: {'Germany', 'Kingdom of Bavaria' - }, - 2017: {'Germany', 'Kingdom of Bavaria' - }, - 2018: {'Germany', 'Kingdom of Bavaria' - }, - 2019: {'Germany', 'Kingdom of Bavaria' - }, - 2020: {'Germany', 'Kingdom of Bavaria' - }, - 2021: {'Germany', 'Kingdom of Bavaria' - }, - 2022: {'Germany', 'Kingdom of Bavaria' - }, - 2023: {'Germany', 'Kingdom of Bavaria' - } - }, - { - 1789: {'Republic of Vietnam', 'Vietnam' - }, - 1790: {'Republic of Vietnam', 'Vietnam' - }, - 1791: {'Republic of Vietnam', 'Vietnam' - }, - 1792: {'Republic of Vietnam', 'Vietnam' - }, - 1793: {'Republic of Vietnam', 'Vietnam' - }, - 1794: {'Republic of Vietnam', 'Vietnam' - }, - 1795: {'Republic of Vietnam', 'Vietnam' - }, - 1796: {'Republic of Vietnam', 'Vietnam' - }, - 1797: {'Republic of Vietnam', 'Vietnam' - }, - 1798: {'Republic of Vietnam', 'Vietnam' - }, - 1799: {'Republic of Vietnam', 'Vietnam' - }, - 1800: {'Republic of Vietnam', 'Vietnam' - }, - 1801: {'Republic of Vietnam', 'Vietnam' - }, - 1802: {'Republic of Vietnam', 'Vietnam' - }, - 1803: {'Republic of Vietnam', 'Vietnam' - }, - 1804: {'Republic of Vietnam', 'Vietnam' - }, - 1805: {'Republic of Vietnam', 'Vietnam' - }, - 1806: {'Republic of Vietnam', 'Vietnam' - }, - 1807: {'Republic of Vietnam', 'Vietnam' - }, - 1808: {'Republic of Vietnam', 'Vietnam' - }, - 1809: {'Republic of Vietnam', 'Vietnam' - }, - 1810: {'Republic of Vietnam', 'Vietnam' - }, - 1811: {'Republic of Vietnam', 'Vietnam' - }, - 1812: {'Republic of Vietnam', 'Vietnam' - }, - 1813: {'Republic of Vietnam', 'Vietnam' - }, - 1814: {'Republic of Vietnam', 'Vietnam' - }, - 1815: {'Republic of Vietnam', 'Vietnam' - }, - 1816: {'Republic of Vietnam', 'Vietnam' - }, - 1817: {'Republic of Vietnam', 'Vietnam' - }, - 1818: {'Republic of Vietnam', 'Vietnam' - }, - 1819: {'Republic of Vietnam', 'Vietnam' - }, - 1820: {'Republic of Vietnam', 'Vietnam' - }, - 1821: {'Republic of Vietnam', 'Vietnam' - }, - 1822: {'Republic of Vietnam', 'Vietnam' - }, - 1823: {'Republic of Vietnam', 'Vietnam' - }, - 1824: {'Republic of Vietnam', 'Vietnam' - }, - 1825: {'Republic of Vietnam', 'Vietnam' - }, - 1826: {'Republic of Vietnam', 'Vietnam' - }, - 1827: {'Republic of Vietnam', 'Vietnam' - }, - 1828: {'Republic of Vietnam', 'Vietnam' - }, - 1829: {'Republic of Vietnam', 'Vietnam' - }, - 1830: {'Republic of Vietnam', 'Vietnam' - }, - 1831: {'Republic of Vietnam', 'Vietnam' - }, - 1832: {'Republic of Vietnam', 'Vietnam' - }, - 1833: {'Republic of Vietnam', 'Vietnam' - }, - 1834: {'Republic of Vietnam', 'Vietnam' - }, - 1835: {'Republic of Vietnam', 'Vietnam' - }, - 1836: {'Republic of Vietnam', 'Vietnam' - }, - 1837: {'Republic of Vietnam', 'Vietnam' - }, - 1838: {'Republic of Vietnam', 'Vietnam' - }, - 1839: {'Republic of Vietnam', 'Vietnam' - }, - 1840: {'Republic of Vietnam', 'Vietnam' - }, - 1841: {'Republic of Vietnam', 'Vietnam' - }, - 1842: {'Republic of Vietnam', 'Vietnam' - }, - 1843: {'Republic of Vietnam', 'Vietnam' - }, - 1844: {'Republic of Vietnam', 'Vietnam' - }, - 1845: {'Republic of Vietnam', 'Vietnam' - }, - 1846: {'Republic of Vietnam', 'Vietnam' - }, - 1847: {'Republic of Vietnam', 'Vietnam' - }, - 1848: {'Republic of Vietnam', 'Vietnam' - }, - 1849: {'Republic of Vietnam', 'Vietnam' - }, - 1850: {'Republic of Vietnam', 'Vietnam' - }, - 1851: {'Republic of Vietnam', 'Vietnam' - }, - 1852: {'Republic of Vietnam', 'Vietnam' - }, - 1853: {'Republic of Vietnam', 'Vietnam' - }, - 1854: {'Republic of Vietnam', 'Vietnam' - }, - 1855: {'Republic of Vietnam', 'Vietnam' - }, - 1856: {'Republic of Vietnam', 'Vietnam' - }, - 1857: {'Republic of Vietnam', 'Vietnam' - }, - 1858: {'Republic of Vietnam', 'Vietnam' - }, - 1859: {'Republic of Vietnam', 'Vietnam' - }, - 1860: {'Republic of Vietnam', 'Vietnam' - }, - 1861: {'Republic of Vietnam', 'Vietnam' - }, - 1862: {'Republic of Vietnam', 'Vietnam' - }, - 1863: {'Republic of Vietnam', 'Vietnam' - }, - 1864: {'Republic of Vietnam', 'Vietnam' - }, - 1865: {'Republic of Vietnam', 'Vietnam' - }, - 1866: {'Republic of Vietnam', 'Vietnam' - }, - 1867: {'Republic of Vietnam', 'Vietnam' - }, - 1868: {'Republic of Vietnam', 'Vietnam' - }, - 1869: {'Republic of Vietnam', 'Vietnam' - }, - 1870: {'Republic of Vietnam', 'Vietnam' - }, - 1871: {'Republic of Vietnam', 'Vietnam' - }, - 1872: {'Republic of Vietnam', 'Vietnam' - }, - 1873: {'Republic of Vietnam', 'Vietnam' - }, - 1874: {'Republic of Vietnam', 'Vietnam' - }, - 1875: {'Republic of Vietnam', 'Vietnam' - }, - 1876: {'Republic of Vietnam', 'Vietnam' - }, - 1877: {'Republic of Vietnam', 'Vietnam' - }, - 1878: {'Republic of Vietnam', 'Vietnam' - }, - 1879: {'Republic of Vietnam', 'Vietnam' - }, - 1880: {'Republic of Vietnam', 'Vietnam' - }, - 1881: {'Republic of Vietnam', 'Vietnam' - }, - 1882: {'Republic of Vietnam', 'Vietnam' - }, - 1883: {'Republic of Vietnam', 'Vietnam' - }, - 1884: {'Republic of Vietnam', 'Vietnam' - }, - 1885: {'Republic of Vietnam', 'Vietnam' - }, - 1886: {'Republic of Vietnam', 'Vietnam' - }, - 1887: {'Republic of Vietnam', 'Vietnam' - }, - 1888: {'Republic of Vietnam', 'Vietnam' - }, - 1889: {'Republic of Vietnam', 'Vietnam' - }, - 1890: {'Republic of Vietnam', 'Vietnam' - }, - 1891: {'Republic of Vietnam', 'Vietnam' - }, - 1892: {'Republic of Vietnam', 'Vietnam' - }, - 1893: {'Republic of Vietnam', 'Vietnam' - }, - 1894: {'Republic of Vietnam', 'Vietnam' - }, - 1895: {'Republic of Vietnam', 'Vietnam' - }, - 1896: {'Republic of Vietnam', 'Vietnam' - }, - 1897: {'Republic of Vietnam', 'Vietnam' - }, - 1898: {'Republic of Vietnam', 'Vietnam' - }, - 1899: {'Republic of Vietnam', 'Vietnam' - }, - 1900: {'Republic of Vietnam', 'Vietnam' - }, - 1901: {'Republic of Vietnam', 'Vietnam' - }, - 1902: {'Republic of Vietnam', 'Vietnam' - }, - 1903: {'Republic of Vietnam', 'Vietnam' - }, - 1904: {'Republic of Vietnam', 'Vietnam' - }, - 1905: {'Republic of Vietnam', 'Vietnam' - }, - 1906: {'Republic of Vietnam', 'Vietnam' - }, - 1907: {'Republic of Vietnam', 'Vietnam' - }, - 1908: {'Republic of Vietnam', 'Vietnam' - }, - 1909: {'Republic of Vietnam', 'Vietnam' - }, - 1910: {'Republic of Vietnam', 'Vietnam' - }, - 1911: {'Republic of Vietnam', 'Vietnam' - }, - 1912: {'Republic of Vietnam', 'Vietnam' - }, - 1913: {'Republic of Vietnam', 'Vietnam' - }, - 1914: {'Republic of Vietnam', 'Vietnam' - }, - 1915: {'Republic of Vietnam', 'Vietnam' - }, - 1916: {'Republic of Vietnam', 'Vietnam' - }, - 1917: {'Republic of Vietnam', 'Vietnam' - }, - 1918: {'Republic of Vietnam', 'Vietnam' - }, - 1919: {'Republic of Vietnam', 'Vietnam' - }, - 1920: {'Republic of Vietnam', 'Vietnam' - }, - 1921: {'Republic of Vietnam', 'Vietnam' - }, - 1922: {'Republic of Vietnam', 'Vietnam' - }, - 1923: {'Republic of Vietnam', 'Vietnam' - }, - 1924: {'Republic of Vietnam', 'Vietnam' - }, - 1925: {'Republic of Vietnam', 'Vietnam' - }, - 1926: {'Republic of Vietnam', 'Vietnam' - }, - 1927: {'Republic of Vietnam', 'Vietnam' - }, - 1928: {'Republic of Vietnam', 'Vietnam' - }, - 1929: {'Republic of Vietnam', 'Vietnam' - }, - 1930: {'Republic of Vietnam', 'Vietnam' - }, - 1931: {'Republic of Vietnam', 'Vietnam' - }, - 1932: {'Republic of Vietnam', 'Vietnam' - }, - 1933: {'Republic of Vietnam', 'Vietnam' - }, - 1934: {'Republic of Vietnam', 'Vietnam' - }, - 1935: {'Republic of Vietnam', 'Vietnam' - }, - 1936: {'Republic of Vietnam', 'Vietnam' - }, - 1937: {'Republic of Vietnam', 'Vietnam' - }, - 1938: {'Republic of Vietnam', 'Vietnam' - }, - 1939: {'Republic of Vietnam', 'Vietnam' - }, - 1940: {'Republic of Vietnam', 'Vietnam' - }, - 1941: {'Republic of Vietnam', 'Vietnam' - }, - 1942: {'Republic of Vietnam', 'Vietnam' - }, - 1943: {'Republic of Vietnam', 'Vietnam' - }, - 1944: {'Republic of Vietnam', 'Vietnam' - }, - 1945: {'Republic of Vietnam', 'Vietnam' - }, - 1946: {'Republic of Vietnam', 'Vietnam' - }, - 1947: {'Republic of Vietnam', 'Vietnam' - }, - 1948: {'Republic of Vietnam', 'Vietnam' - }, - 1949: {'Republic of Vietnam', 'Vietnam' - }, - 1950: {'Republic of Vietnam', 'Vietnam' - }, - 1951: {'Republic of Vietnam', 'Vietnam' - }, - 1952: {'Republic of Vietnam', 'Vietnam' - }, - 1953: {'Republic of Vietnam', 'Vietnam' - }, - 1954: {'Republic of Vietnam', 'Vietnam' - }, - 1955: {'Republic of Vietnam', 'Vietnam' - }, - 1956: {'Republic of Vietnam', 'Vietnam' - }, - 1957: {'Republic of Vietnam', 'Vietnam' - }, - 1958: {'Republic of Vietnam', 'Vietnam' - }, - 1959: {'Republic of Vietnam', 'Vietnam' - }, - 1960: {'Republic of Vietnam', 'Vietnam' - }, - 1961: {'Republic of Vietnam', 'Vietnam' - }, - 1962: {'Republic of Vietnam', 'Vietnam' - }, - 1963: {'Republic of Vietnam', 'Vietnam' - }, - 1964: {'Republic of Vietnam', 'Vietnam' - }, - 1965: {'Republic of Vietnam', 'Vietnam' - }, - 1966: {'Republic of Vietnam', 'Vietnam' - }, - 1967: {'Republic of Vietnam', 'Vietnam' - }, - 1968: {'Republic of Vietnam', 'Vietnam' - }, - 1969: {'Republic of Vietnam', 'Vietnam' - }, - 1970: {'Republic of Vietnam', 'Vietnam' - }, - 1971: {'Republic of Vietnam', 'Vietnam' - }, - 1972: {'Republic of Vietnam', 'Vietnam' - }, - 1973: {'Republic of Vietnam', 'Vietnam' - }, - 1974: {'Republic of Vietnam', 'Vietnam' - }, - 1975: {'Republic of Vietnam', 'Vietnam' - }, - 1976: {'Republic of Vietnam', 'Vietnam' - }, - 1977: {'Republic of Vietnam', 'Vietnam' - }, - 1978: {'Republic of Vietnam', 'Vietnam' - }, - 1979: {'Republic of Vietnam', 'Vietnam' - }, - 1980: {'Republic of Vietnam', 'Vietnam' - }, - 1981: {'Republic of Vietnam', 'Vietnam' - }, - 1982: {'Republic of Vietnam', 'Vietnam' - }, - 1983: {'Republic of Vietnam', 'Vietnam' - }, - 1984: {'Republic of Vietnam', 'Vietnam' - }, - 1985: {'Republic of Vietnam', 'Vietnam' - }, - 1986: {'Republic of Vietnam', 'Vietnam' - }, - 1987: {'Republic of Vietnam', 'Vietnam' - }, - 1988: {'Republic of Vietnam', 'Vietnam' - }, - 1989: {'Republic of Vietnam', 'Vietnam' - }, - 1990: {'Republic of Vietnam', 'Vietnam' - }, - 1991: {'Republic of Vietnam', 'Vietnam' - }, - 1992: {'Republic of Vietnam', 'Vietnam' - }, - 1993: {'Republic of Vietnam', 'Vietnam' - }, - 1994: {'Republic of Vietnam', 'Vietnam' - }, - 1995: {'Republic of Vietnam', 'Vietnam' - }, - 1996: {'Republic of Vietnam', 'Vietnam' - }, - 1997: {'Republic of Vietnam', 'Vietnam' - }, - 1998: {'Republic of Vietnam', 'Vietnam' - }, - 1999: {'Republic of Vietnam', 'Vietnam' - }, - 2000: {'Republic of Vietnam', 'Vietnam' - }, - 2001: {'Republic of Vietnam', 'Vietnam' - }, - 2002: {'Republic of Vietnam', 'Vietnam' - }, - 2003: {'Republic of Vietnam', 'Vietnam' - }, - 2004: {'Republic of Vietnam', 'Vietnam' - }, - 2005: {'Republic of Vietnam', 'Vietnam' - }, - 2006: {'Republic of Vietnam', 'Vietnam' - }, - 2007: {'Republic of Vietnam', 'Vietnam' - }, - 2008: {'Republic of Vietnam', 'Vietnam' - }, - 2009: {'Republic of Vietnam', 'Vietnam' - }, - 2010: {'Republic of Vietnam', 'Vietnam' - }, - 2011: {'Republic of Vietnam', 'Vietnam' - }, - 2012: {'Republic of Vietnam', 'Vietnam' - }, - 2013: {'Republic of Vietnam', 'Vietnam' - }, - 2014: {'Republic of Vietnam', 'Vietnam' - }, - 2015: {'Republic of Vietnam', 'Vietnam' - }, - 2016: {'Republic of Vietnam', 'Vietnam' - }, - 2017: {'Republic of Vietnam', 'Vietnam' - }, - 2018: {'Republic of Vietnam', 'Vietnam' - }, - 2019: {'Republic of Vietnam', 'Vietnam' - }, - 2020: {'Republic of Vietnam', 'Vietnam' - }, - 2021: {'Republic of Vietnam', 'Vietnam' - }, - 2022: {'Republic of Vietnam', 'Vietnam' - }, - 2023: {'Republic of Vietnam', 'Vietnam' - } - } -] diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json deleted file mode 100644 index cb8944dbf1c..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.countries.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "Afghanistan": "Afghanistan", - "Albania": "Albania", - "Algeria": "Algeria", - "Angola": "Angola", - "Argentina": "Argentina", - "Armenia": "Armenia", - "Australia": "Australia", - "Austria": "Austria", - "Azerbaijan": "Azerbaijan", - "Baden": "Grand Duchy of Baden", - "Bahrain": "Bahrain", - "Bangladesh": "Bangladesh", - "Barbados": "Barbados", - "Bavaria": "Kingdom of Bavaria", - "Belarus": "Belarus", - "Belgium": "Belgium", - "Benin": "Benin", - "Bhutan": "Bhutan", - "Bolivia": "Bolivia", - "Bosnia and Herzegovina": "Bosnia and Herzegovina", - "Botswana": "Botswana", - "Brazil": "Brazil", - "Bulgaria": "Bulgaria", - "Burkina Faso": "Burkina Faso", - "Burundi": "Burundi", - "Cambodia": "Cambodia", - "Cameroon": "Cameroon", - "Canada": "Canada", - "Cape Verde": "Cape Verde", - "Central African Republic": "Central African Republic", - "Chad": "Chad", - "Chile": "Chile", - "China": "China", - "Colombia": "Colombia", - "Comoros": "Comoros", - "Costa Rica": "Costa Rica", - "Croatia": "Croatia", - "Cuba": "Cuba", - "Cyprus": "Cyprus", - "Czechia": "Czechia", - "Democratic Republic of the Congo": "Democratic Republic of Congo", - "Denmark": "Denmark", - "Djibouti": "Djibouti", - "Dominican Republic": "Dominican Republic", - "Ecuador": "Ecuador", - "Egypt": "Egypt", - "El Salvador": "El Salvador", - "Equatorial Guinea": "Equatorial Guinea", - "Eritrea": "Eritrea", - "Estonia": "Estonia", - "Eswatini": "Eswatini", - "Ethiopia": "Ethiopia", - "Fiji": "Fiji", - "Finland": "Finland", - "France": "France", - "Gabon": "Gabon", - "Georgia": "Georgia", - "German Democratic Republic": "East Germany", - "Germany": "Germany", - "Ghana": "Ghana", - "Greece": "Greece", - "Guatemala": "Guatemala", - "Guinea": "Guinea", - "Guinea-Bissau": "Guinea-Bissau", - "Guyana": "Guyana", - "Haiti": "Haiti", - "Honduras": "Honduras", - "Hong Kong": "Hong Kong", - "Hungary": "Hungary", - "Iceland": "Iceland", - "India": "India", - "Indonesia": "Indonesia", - "Iran": "Iran", - "Iraq": "Iraq", - "Ireland": "Ireland", - "Israel": "Israel", - "Italy": "Italy", - "Ivory Coast": "Cote d'Ivoire", - "Jamaica": "Jamaica", - "Japan": "Japan", - "Jordan": "Jordan", - "Kazakhstan": "Kazakhstan", - "Kenya": "Kenya", - "Kosovo": "Kosovo", - "Kuwait": "Kuwait", - "Kyrgyzstan": "Kyrgyzstan", - "Laos": "Laos", - "Latvia": "Latvia", - "Lebanon": "Lebanon", - "Lesotho": "Lesotho", - "Liberia": "Liberia", - "Libya": "Libya", - "Lithuania": "Lithuania", - "Luxembourg": "Luxembourg", - "Madagascar": "Madagascar", - "Malawi": "Malawi", - "Malaysia": "Malaysia", - "Maldives": "Maldives", - "Mali": "Mali", - "Malta": "Malta", - "Mauritania": "Mauritania", - "Mauritius": "Mauritius", - "Mexico": "Mexico", - "Moldova": "Moldova", - "Mongolia": "Mongolia", - "Montenegro": "Montenegro", - "Morocco": "Morocco", - "Mozambique": "Mozambique", - "Namibia": "Namibia", - "Nepal": "Nepal", - "Netherlands": "Netherlands", - "New Zealand": "New Zealand", - "Nicaragua": "Nicaragua", - "Niger": "Niger", - "Nigeria": "Nigeria", - "North Korea": "North Korea", - "North Macedonia": "North Macedonia", - "Norway": "Norway", - "Oman": "Oman", - "Pakistan": "Pakistan", - "Panama": "Panama", - "Papua New Guinea": "Papua New Guinea", - "Paraguay": "Paraguay", - "Parma": "Duchy of Parma and Piacenza", - "Peru": "Peru", - "Philippines": "Philippines", - "Poland": "Poland", - "Portugal": "Portugal", - "Qatar": "Qatar", - "Republic of Vietnam": "Republic of Vietnam", - "Romania": "Romania", - "Russia": "Russia", - "Rwanda": "Rwanda", - "Sao Tome and Principe": "Sao Tome and Principe", - "Saudi Arabia": "Saudi Arabia", - "Senegal": "Senegal", - "Serbia": "Serbia", - "Seychelles": "Seychelles", - "Sierra Leone": "Sierra Leone", - "Singapore": "Singapore", - "Slovakia": "Slovakia", - "Slovenia": "Slovenia", - "Solomon Islands": "Solomon Islands", - "Somalia": "Somalia", - "Somaliland": "Somaliland", - "South Africa": "South Africa", - "South Korea": "South Korea", - "South Sudan": "South Sudan", - "South Yemen": "Yemen People's Republic", - "Spain": "Spain", - "Sri Lanka": "Sri Lanka", - "Sudan": "Sudan", - "Suriname": "Suriname", - "Sweden": "Sweden", - "Switzerland": "Switzerland", - "Syria": "Syria", - "Taiwan": "Taiwan", - "Tajikistan": "Tajikistan", - "Tanzania": "Tanzania", - "Thailand": "Thailand", - "Timor-Leste": "East Timor", - "Togo": "Togo", - "Trinidad and Tobago": "Trinidad and Tobago", - "Tunisia": "Tunisia", - "Turkmenistan": "Turkmenistan", - "Tuscany": "Tuscany", - "Two Sicilies": "Two Sicilies", - "Uganda": "Uganda", - "Ukraine": "Ukraine", - "United Arab Emirates": "United Arab Emirates", - "United Kingdom": "United Kingdom", - "United States of America": "United States", - "Uruguay": "Uruguay", - "Uzbekistan": "Uzbekistan", - "Vanuatu": "Vanuatu", - "Venezuela": "Venezuela", - "Vietnam": "Vietnam", - "Yemen": "Yemen", - "Zambia": "Zambia", - "Zanzibar": "Zanzibar", - "Zimbabwe": "Zimbabwe", - "Brunswick": "Brunswick", - "Burma/Myanmar": "Myanmar", - "Hamburg": "Hamburg", - "Hanover": "Hanover", - "Hesse-Darmstadt": "Hesse Grand Ducal", - "Hesse-Kassel": "Hesse Electoral", - "Mecklenburg Schwerin": "Mecklenburg Schwerin", - "Nassau": "Duchy of Nassau", - "Oldenburg": "Oldenburg", - "Palestine/British Mandate": "Palestine", - "Papal States": "Vatican", - "Republic of the Congo": "Congo", - "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", - "The Gambia": "Gambia", - "T\u00fcrkiye": "Turkey", - "W\u00fcrtemberg": "Wurttemberg", - "Piedmont-Sardinia": "Piedmont-Sardinia", - "Saxony": "Saxony", - "Modena": "Modena" -} diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json deleted file mode 100644 index 0d4f101c7a3..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.excluded_countries.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml deleted file mode 100644 index fe1b0461e1c..00000000000 --- a/etl/steps/data/garden/democracy/2024-03-08/vdem/vdem.meta.yml +++ /dev/null @@ -1,2200 +0,0 @@ -definitions: - common: - presentation: - topic_tags: - - Democracy - description_processing: |- - We expand the years covered by V-Dem further: To expand the time coverage of today's countries and include more of the period when they were still non-sovereign territories, we identified the historical entity they were a part of and used that regime's data whenever available - - For example, V-Dem only provides regime data since Bangladesh's independence in 1971. There is, however, regime data for Pakistan and the colony of India, both of which the current territory of Bangladesh was a part. We, therefore, use the regime data of Pakistan for Bangladesh from 1947 to 1970, and the regime data of India from 1789 to 1946. We did so for all countries with a past or current population of more than one million. - auxiliary: - description_processing_row: |- - While RoW covers the years since 1900, we use V-Dem's historical data from 1789 to 1899 to expand the classification's coverage back in time. - - {definitions.common.description_processing} - -dataset: - title: V-Dem Country-Year (Full + Others) - update_period_days: 365 - -tables: - vdem: - title: V-Dem Country-Year (Full + Others) - description: |- - The Varieties of Democracy (V-Dem) project publishes data and research on democracy and human rights. - - It acknowledges that democracy can be characterized differently and measures electoral, liberal, participatory, deliberative, and egalitarian characterizations of democracy. - - The project relies on evaluations by around 3,500 country experts and supplementary work by its researchers to assess political institutions and the protection of rights. - - The project is managed by the V-Dem Institute, based at the University of Gothenburg in Sweden. - - This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. - variables: - regime_imputed_country: - title: 'Country name (imputed country)' - unit: '' - - histname: - title: 'Historical country name' - unit: '' - - # 2.1 V-Dem High-Level Democracy Indices - - ## 2.1.1 Electoral democracy index - electdem_vdem: - title: Electoral democracy index - description_short: |- - Best estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: &description_prod_electdem_vdem |- - Question: To what extent is the ideal of electoral democracy in its fullest sense achieved? - Clarification: The electoral principle of democracy seeks to embody the core value of making rulers responsive to citizens, achieved through electoral competition for the electorate's approval under circumstances when suffrage is extensive; political and civil society organizations can operate freely; elections are clean and not marred by fraud or systematic irregularities; and elections affect the composition of the chief executive of the country. In between elections, there is freedom of expression and an independent media capable of presenting alternative views on matters of political relevance. In the V-Dem conceptual scheme, electoral democracy is understood as an essential element of any other conception of representative democracy — liberal, participatory, deliberative, egalitarian, or some other. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_polyarchy` - unit: '' - display: - numDecimalPlaces: 3 - - electdem_vdem_low: - title: "{tables.vdem.variables.electdem_vdem.title} (lower bound)" - description_short: |- - Lower-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - electdem_vdem_high: - title: "{tables.vdem.variables.electdem_vdem.title} (upper bound)" - description_short: |- - Upper-bound estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.1.2 Liberal democracy index - libdem_vdem: - title: Liberal democracy index - description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: &description_prod_libdem_vdem |- - Question: To what extent is the ideal of liberal democracy achieved? - - Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. To make this a measure of liberal democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_libdem` - unit: '' - display: - numDecimalPlaces: 3 - - libdem_vdem_low: - title: "{tables.vdem.variables.libdem_vdem.title} (lower bound)" - description_short: |- - Lower-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: *description_prod_libdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - libdem_vdem_high: - title: "{tables.vdem.variables.libdem_vdem.title} (upper bound)" - description_short: |- - Upper-bound estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. - description_from_producer: *description_prod_libdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - # 2.1.3 Participatory democracy index - participdem_vdem: - title: Extent of direct popular votes - description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. - description_from_producer: &description_prod_participdem_vdem |- - Question: To what extent is the ideal of participatory democracy achieved? - - Clarification: The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. To make it a measure of participatory democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_partipdem` - unit: '' - display: - numDecimalPlaces: 3 - - participdem_vdem_low: - title: "{tables.vdem.variables.participdem_vdem.title} (lower bound)" - description_from_producer: *description_prod_participdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - participdem_vdem_high: - title: "{tables.vdem.variables.participdem_vdem.title} (upper bound)" - description_from_producer: *description_prod_participdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.1.4 Deliberative democracy index - delibdem_vdem: - title: Deliberative democracy index - description_short: - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. - description_from_producer: &description_prod_delibdem_vdem |- - Question: To what extent is the ideal of deliberative democracy achieved? - - Clarification: - The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. To make it a measure of not only the deliberative principle but also of democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_delibdem` - unit: '' - display: - numDecimalPlaces: 3 - - delibdem_vdem_low: - title: "{tables.vdem.variables.delibdem_vdem.title} (lower bound)" - description_from_producer: *description_prod_delibdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - delibdem_vdem_high: - title: "{tables.vdem.variables.delibdem_vdem.title} (upper bound)" - description_from_producer: *description_prod_delibdem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.1.5 Egalitarian democracy index - egaldem_vdem: - title: Egalitarian democracy index - description_short: |- - Best estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. - description_from_producer: &description_prod_egaldem_vdem |- - Question: To what extent is the ideal of egalitarian democracy achieved? - - Clarification: - The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_egaldem` - unit: '' - display: - numDecimalPlaces: 3 - - egaldem_vdem_low: - title: "{tables.vdem.variables.egaldem_vdem.title} (lower bound)" - description_from_producer: *description_prod_egaldem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - egaldem_vdem_high: - title: "{tables.vdem.variables.egaldem_vdem.title} (upper bound)" - description_from_producer: *description_prod_egaldem_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.3 Freedom of Expression and Alternative Sources of Information index - freeexpr_vdem: - title: Freedom of Expression and Alternative Sources of Information index - description_short: |- - Best estimate of the extent to which people can discuss political matters at home and in the public sphere, the press and media are free and can present different political perspectives, and the freedom of academic and cultural expression. - description_from_producer: &description_prod_freexpr_vdem |- - Question: To what extent does government respect press and media freedom, the freedom of ordinary people to discuss political matters at home and in the public sphere, as well as the freedom of academic and cultural expression? - - Clarification: This index includes all variables in the two indices v2x_freexp and v2xme_altinf. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_freexp_altinf` - unit: '' - display: - numDecimalPlaces: 3 - - freeexpr_vdem_low: - title: "{tables.vdem.variables.freeexpr_vdem.title} (lower bound)" - description_from_producer: *description_prod_freexpr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - freeexpr_vdem_high: - title: "{tables.vdem.variables.freeexpr_vdem.title} (upper bound)" - description_from_producer: *description_prod_freexpr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.4 Freedom of association thick index - freeassoc_vdem: - title: Freedom of association thick index - description_short: |- - Best estimate of the extent to which parties, including opposition parties, are allowed to form and participate in elections, and the extent to which civil society organizations are allowed to form and operate freely. - description_from_producer: &description_prod_freeassoc_vdem |- - Question: To what extent are parties, including opposition parties, allowed to form and to participate in elections, and to what extent are civil society organizations able to form and to operate freely? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_frassoc_thick` - unit: '' - display: - numDecimalPlaces: 3 - - freeassoc_vdem_low: - title: "{tables.vdem.variables.freeassoc_vdem.title} (lower bound)" - description_from_producer: *description_prod_freeassoc_vdem - unit: '' - display: - numDecimalPlaces: 3 - - freeassoc_vdem_high: - title: "{tables.vdem.variables.freeassoc_vdem.title} (upper bound)" - description_from_producer: *description_prod_freeassoc_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.5 Share of population with suffrage - suffr_vdem: - title: Share of population with suffrage - description_short: |- - Share of adult citizens which have the legal right to vote in national elections. - description_from_producer: |- - Question: What share of adult citizens as defined by statute has the legal right to vote in national elections? - - Clarification: - This question does not take into consideration restrictions based on age, residence, having been convicted for crime, or being legally incompetent. It covers legal de jure restrictions, not restrictions that may be operative in practice de facto. The adult population as defined by statute is defined by citizens in the case of independent countries or the people living in the territorial entity in the case of colonies. Universal suffrage is coded as 100%. Universal male suffrage only is coded as 50%. Years before electoral provisions are introduced are scored 0%. The scores do not reflect whether an electoral regime was interrupted or not. Only if new constitutions, electoral laws, or the like explicitly introduce new regulations of suffrage, the scores were adjusted accordingly if the changes suggested doing so. If qualifying criteria other than gender apply such as property, tax payments, income, literacy, region, race, ethnicity, religion, and/or 'economic independence', estimates have been calculated by combining information on the restrictions with different kinds of statistical information on population size, age distribution, wealth distribution, literacy rates, size of ethnic groups, etc., secondary country-specific sources, and — in the case of very poor information — the conditions in similar countries or colonies. The scores reflect de jure provisions of suffrage extension in percentage of the adult population. If the suffrage law is revised in a way that affects the extension, the scores reflect this change as of the calendar year the law was enacted. - - Indicator name: `v2x_suffr` - description_processing: |- - Converted ratio (0-1) into share (0-100%). - - {definitions.common.description_processing} - unit: '%' - display: - numDecimalPlaces: 3 - - ## 2.2.6 Clean elections index - electfreefair_vdem: - title: Clean elections index - description_short: |- - Best estimate of the extent to which registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence are absent, and the election management body is autonomous and has enough staff and resources. - description_from_producer: &description_prod_electfreefair_vdem |- - Question: To what extent are elections free and fair? - - Clarification: Free and fair connotes an absence of registration fraud, systematic irregularities, government intimidation of the opposition, vote buying, and election violence. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xel_frefair` - unit: '' - display: - numDecimalPlaces: 3 - - electfreefair_vdem_low: - title: "{tables.vdem.variables.electfreefair_vdem.title} (lower bound)" - description_from_producer: *description_prod_electfreefair_vdem - unit: '' - display: - numDecimalPlaces: 3 - - electfreefair_vdem_high: - title: "{tables.vdem.variables.electfreefair_vdem.title} (upper bound)" - description_from_producer: *description_prod_electfreefair_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.7 Elected officials index - electoff_vdem: - title: Elected officials index - description_short: |- - Measures the extent to which the legislature is chosen through broad elections, and the chief executive is elected directly or indirectly (appointed by a popularly elected legislature). - description_from_producer: |- - Question: Is the chief executive and legislature appointed through popular elections? - - Clarification: This index attempts to measure (a) whether the chief executive is elected, either directly elected through popular elections or indirectly through a popularly elected legislature that then appoints the chief executive; and (b) whether the legislature, in presidential systems with a directly elected president that is also chief executive, is directly or indirectly elected. Note that a popular election is minimally defined and also includes sham elections with limited suffrage and no competition. Similarly, "appointment" by legislature only implies selection and/or approval, not the power to dismiss. This index is useful primarily for aggregating higher-order indices and should not necessarily be interpreted as an important element of democracy in its own right. - - Indicator name: `v2x_elecoff` - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.8 Liberal component index - lib_vdem: - title: Liberal component index - description_short: |- - Best estimate of the extent of individual and minority rights, equality before the law, and executive constraints. - description_from_producer: &description_prod_lib_vdem |- - Question: To what extent is the liberal principle of democracy achieved? - - Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_liberal` - unit: '' - display: - numDecimalPlaces: 3 - - lib_vdem_low: - title: "{tables.vdem.variables.lib_vdem.title} (lower bound)" - description_from_producer: *description_prod_lib_vdem - unit: '' - display: - numDecimalPlaces: 3 - - lib_vdem_high: - title: "{tables.vdem.variables.lib_vdem.title} (upper bound)" - description_from_producer: *description_prod_lib_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.9 Equality before the law and individual liberty index - indiv_libs_vdem: - title: Equality before the law and individual liberty index - description_short: |- - Best estimate of the extent to which extent to which citizens enjoy physical integrity rights, freedoms of religion, of movement, and from forced labor, as well as access to justice, laws are transparent and public administration is impartial. - description_from_producer: &description_prod_indiv_libs_vdem |- - Question: To what extent are laws transparent and rigorously enforced and public administration impartial, and to what extent do citizens enjoy access to justice, secure property rights, freedom from forced labor, freedom of movement, physical integrity rights, and freedom of religion? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xcl_rol` - unit: '' - display: - numDecimalPlaces: 3 - - indiv_libs_vdem_low: - title: "{tables.vdem.variables.indiv_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_indiv_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - indiv_libs_vdem_high: - title: "{tables.vdem.variables.indiv_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_indiv_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.10 Judicial constraints on the executive index - judicial_constr_vdem: - title: "Judicial constraints on the executive index" - description_short: |- - Best estimate of the extent to which the executive respects the constitution, complies with the judiciary and high courts, and higher and lower courts are independent. - description_from_producer: &description_prod_judicial_constr_vdem |- - Question: To what extent does the executive respect the constitution and comply with court rulings, and to what extent is the judiciary able to act in an independent fashion? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_jucon` - unit: '' - display: - numDecimalPlaces: 3 - - judicial_constr_vdem_low: - title: "{tables.vdem.variables.judicial_constr_vdem.title} (upper bound)" - description_from_producer: *description_prod_judicial_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - judicial_constr_vdem_high: - title: "{tables.vdem.variables.judicial_constr_vdem.title} (lower bound)" - description_from_producer: *description_prod_judicial_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.11 Legislative constraints on the executive index - legis_constr_vdem: - title: Legislative constraints on the executive index - description_short: |- - Best estimate of the extent to which the legislature, including opposition parties, questions executive officials and oversees and investigates the executive. - description_from_producer: &description_prod_legis_constr_vdem |- - Question: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? - - Clarification: To what extent are the legislature and government agencies e.g., comptroller general, general prosecutor, or ombudsman capable of questioning, investigating, and exercising oversight over the executive? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xlg_legcon` - unit: '' - display: - numDecimalPlaces: 3 - - legis_constr_vdem_low: - title: "{tables.vdem.variables.legis_constr_vdem.title} (lower bound)" - description_from_producer: *description_prod_legis_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - legis_constr_vdem_high: - title: "{tables.vdem.variables.legis_constr_vdem.title} (upper bound)" - description_from_producer: *description_prod_legis_constr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.12 Participatory component index - particip_vdem: - title: Participatory political institutions - description_short: |- - Best estimate of the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. - description_from_producer: &description_prod_particip_vdem |- - Question: To what extent is the participatory principle achieved? - - Clarification: - The participatory principle of democracy emphasizes active participation by citizens in all political processes, electoral and non-electoral. It is motivated by uneasiness about a bedrock practice of electoral democracy: delegating authority to representatives. Thus, direct rule by citizens is preferred, wherever practicable. This model of democracy thus takes suffrage for granted, emphasizing engagement in civil society organizations, direct democracy, and subnational elected bodies. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_partip` - unit: '' - display: - numDecimalPlaces: 3 - - particip_vdem_low: - title: "{tables.vdem.variables.particip_vdem.title} (lower bound)" - description_from_producer: *description_prod_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 - - particip_vdem_high: - title: "{tables.vdem.variables.particip_vdem.title} (upper bound)" - description_from_producer: *description_prod_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.13 Civil society participation index - civsoc_particip_vdem: - title: Civil society participation index - description_short: |- - Best estimate of the extent to which major civil society organization are routinely consulted by policymakers, how many people are involved in them, women can participate, and candidate nomination for the legislature within parties is decentralized or made through primaries. - description_from_producer: &description_prod_civsoc_particip_vdem |- - Question: Are major CSOs routinely consulted by policymakers; how large is the involvement of people in CSOs; are women prevented from participating; and is legislative candidate nomination within party organization highly decentralized or made through party primaries? - - Clarification: - The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. - - The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. - - Scale: - Interval, from low to high (0-1). - - Indicator name: `v2x_cspart` - unit: '' - display: - numDecimalPlaces: 3 - - civsoc_particip_vdem_low: - title: "{tables.vdem.variables.civsoc_particip_vdem.title} (lower bound)" - description_from_producer: *description_prod_civsoc_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 - - civsoc_particip_vdem_high: - title: "{tables.vdem.variables.civsoc_particip_vdem.title} (upper bound)" - description_from_producer: *description_prod_civsoc_particip_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.14 Direct popular vote index - dirpop_vote_vdem: - title: Direct popular vote index - description_short: |- - Measures the extent of how easy it is for citizens to vote on specific issues themselves in popular initiatives, referendums, and plebiscites. - description_from_producer: |- - Question: To what extent is the direct popular vote utilized? - - Clarification: Direct popular voting refers here to an institutionalized process by which citizens of a region or country register their choice or opinion on specific issues through a ballot. It is intended to embrace initiatives, referendums, and plebiscites, as those terms are usually understood. It captures some aspects of the more general concept of direct democracy at the national level. The term does not encompass recall elections, deliberative assemblies, or settings in which the vote is not secret or the purview is restricted. Likewise, it does not apply to elections for representatives. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xdd_dd` - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.15 Local government index - locelect_vdem: - title: "Elected local governments" - description_short: |- - Best estimate of the extent to which elected local governments exist and they operate without interference from local unelected bodies. - description_from_producer: &description_prod_locelect_vdem |- - Question: Are there elected local governments, and — if so — to what extent can they operate without interference from unelected bodies at the local level? - - Clarification: The lowest score would be reserved for a country that has no elected local governments. A medium score would be accorded a country that has elected local governments but where those governments are subordinate to unelected officials at the local level perhaps appointed by a higher-level body. A high score would be accorded to a country in which local governments are elected and able to operate without restrictions from unelected actors at the local level with the exception of judicial bodies. Naturally, local governments remain subordinate to the regional and national governments. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xel_locelec` - unit: '' - display: - numDecimalPlaces: 3 - - locelect_vdem_low: - title: "{tables.vdem.variables.locelect_vdem.title} (lower bound)" - description_from_producer: *description_prod_locelect_vdem - unit: '' - display: - numDecimalPlaces: 3 - - locelect_vdem_high: - title: "{tables.vdem.variables.locelect_vdem.title} (upper bound)" - description_from_producer: *description_prod_locelect_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.16 Regional government index - regelect_vdem: - title: Elected regional governments - description_short: |- - Best estimate of the extent to which elected regional governments exist and they operate without interference from regional unelected bodies. - description_from_producer: &description_prod_regelect_vdem |- - Question: Are there elected regional governments, and — if so — to what extent can they operate without interference from unelected bodies at the regional level? - - Clarification: The lowest score would be reserved for a country that has no elected regional governments. A medium score would be accorded a country that has elected regional governments but where those governments are subordinate to unelected officials at the regional level perhaps appointed by a higher-level body. A high score would be accorded to a country in which regional governments are elected and able to operate without restrictions from unelected actors at the regional level with the exception of judicial bodies. Naturally, regional governments remain subordinate to the national government. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xel_regelec` - unit: '' - display: - numDecimalPlaces: 3 - - regelect_vdem_low: - title: "{tables.vdem.variables.regelect_vdem.title} (lower bound)" - description_from_producer: *description_prod_regelect_vdem - unit: '' - display: - numDecimalPlaces: 3 - - regelect_vdem_high: - title: "{tables.vdem.variables.regelect_vdem.title} (upper bound)" - description_from_producer: *description_prod_regelect_vdem - unit: '' - display: - numDecimalPlaces: 3 - - # 2.2.17 Deliberative component index - delib_vdem: - title: Deliberative political institutions index - description_short: |- - Best estimate of the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. - description_from_producer: &description_prod_delib_vdem |- - Question: To what extent is the deliberative principle of democracy achieved? - - Clarification: - The deliberative principle of democracy focuses on the process by which decisions are reached in a polity. A deliberative process is one in which public reasoning focused on the common good motivates political decisions—as contrasted with emotional appeals, solidary attachments, parochial interests, or coercion. According to this principle, democracy requires more than an aggregation of existing preferences. There should also be respectful dialogue at all levels—from preference formation to final decision—among informed and competent participants who are open to persuasion. - - To measure these features of a polity we try to determine the extent to which political elites give public justifications for their positions on matters of public policy, justify their positions in terms of the public good, acknowledge and respect counter-arguments; and how wide the range of consultation is at elite levels. - - Scale: - Interval, from low to high (0-1). - - Indicator name: `v2xdl_delib` - unit: '' - display: - numDecimalPlaces: 3 - - delib_vdem_low: - title: "{tables.vdem.variables.delib_vdem.title} (lower bound)" - description_from_producer: *description_prod_delib_vdem - unit: '' - display: - numDecimalPlaces: 3 - - delib_vdem_high: - title: "{tables.vdem.variables.delib_vdem.title} (upper bound)" - description_from_producer: *description_prod_delib_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.18 Egalitarian component index - egal_vdem: - title: Egalitarian political institutions index - description_short: |- - Best estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. - description_from_producer: &description_prod_egal_vdem |- - Question: To what extent is the egalitarian principle achieved? - - Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_egal` - unit: '' - display: - numDecimalPlaces: 3 - - egal_vdem_low: - title: "{tables.vdem.variables.egal_vdem.title} (lower bound)" - description_from_producer: *description_prod_egal_vdem - unit: '' - display: - numDecimalPlaces: 3 - - egal_vdem_high: - title: "{tables.vdem.variables.egal_vdem.title} (upper bound)" - description_from_producer: *description_prod_egal_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.19 Equal protection index - equal_rights_vdem: - title: Equal rights protection index - description_short: |- - Best estimate of the extent to which the state protects the rights and freedoms across social groups equally. - description_from_producer: &description_prod_equal_rights_vdem |- - Question: How equal is the protection of rights and freedoms across social groups by the state? - - Clarification: Equal protection means that the state grants and protects rights and freedoms evenly across social groups. To achieve equal protection of rights and freedoms, the state itself must not interfere in the ability of groups to participate and it must also take action to ensure that rights and freedoms of one social group are not threatened by the actions of another group or individual. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xeg_eqprotec` - unit: '' - display: - numDecimalPlaces: 3 - - equal_rights_vdem_low: - title: "{tables.vdem.variables.equal_rights_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_rights_vdem - unit: '' - display: - numDecimalPlaces: 3 - - equal_rights_vdem_high: - title: "{tables.vdem.variables.equal_rights_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_rights_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.20 Equal access index - equal_access_vdem: - title: Equal access to power index - description_short: |- - Best estimate of the extent to which access to power is equal across socioeconomic position, social group, and gender. - description_from_producer: &description_prod_equal_access_vdem |- - Question: How equal is access to power? - - Clarification: The Equal Access subcomponent is based on the idea that neither the protections of rights and freedoms nor the equal distribution of resources is sufficient to ensure adequate representation. Ideally, all groups should enjoy equal de facto capabilities to participate, to serve in positions of political power, to put issues on the agenda, and to influence policymaking. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xeg_eqaccess` - unit: '' - display: - numDecimalPlaces: 3 - - equal_access_vdem_low: - title: "{tables.vdem.variables.equal_access_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_access_vdem - unit: '' - display: - numDecimalPlaces: 3 - - equal_access_vdem_high: - title: "{tables.vdem.variables.equal_access_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_access_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 2.2.21 Equal distribution of resources index - equal_res_vdem: - title: Equal resource distribution index - description_short: |- - Best estimate of the extent to which all social groups benefit from public spending, and have equal access to education, healthcare, and the welfare state. - description_from_producer: &description_prod_equal_res_vdem |- - Question: How equal is the distribution of resources? - - Clarification: This component measures the extent to which resources — both tangible and intangible — are distributed in society. An equal distribution of resources supports egalitarian democracy in two ways. First, lower poverty rates and the distribution of goods and services such as food, water, housing, education and healthcare ensure that all individuals are capable of participating in politics and government. In short, basic needs must be met in order for individuals to effectively exercise their rights and freedoms see, for example, Sen 1999, Maslow 1943. Second, high levels of resource inequality undermine the ability of poorer populations to participate meaningfully Aristotle, Dahl 2006. Thus, it is necessary to include not only measures of poverty and the distribution of goods and services, but also the levels of inequality in these distributions, and the proportion of the population who are not eligible for social services i.e. means-tests, particularistic distribution, etc.. This principle also implies that social or economic inequalities can translate into political inequalities, an issue addressed most notably by Walzer 1983, who argues that overlapping "spheres" of inequality are particularly harmful to society. To address these overlapping "spheres", this component also includes measures of the distribution of power in society amongst different socio-economic groups, genders, etc. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xeg_eqdr` - unit: '' - display: - numDecimalPlaces: 3 - - equal_res_vdem_low: - title: "{tables.vdem.variables.equal_res_vdem.title} (lower bound)" - description_from_producer: *description_prod_equal_res_vdem - unit: '' - display: - numDecimalPlaces: 3 - - equal_res_vdem_high: - title: "{tables.vdem.variables.equal_res_vdem.title} (upper bound)" - description_from_producer: *description_prod_equal_res_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.1.3.3 Election turnout - turnout_vdem: - title: Voter turnout - description_short: |- - Denotes the voter turnout as a share of all registered voters in the national election according to official results. - - description_from_producer: |- - Question: In this national election, what percentage (%) of all registered voters cast a vote according to official results? - - Indicator name: `v2eltrnout` - unit: '%' - display: - numDecimalPlaces: 2 - - # 3.4.2.18 HOS female - wom_hos_vdem: # wom_hos_vdem_owid - title: Woman head of state - description_short: |- - Denotes whether the head of state in office on December 31 is a woman. - description_from_producer: |- - If the head of state is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. - - Indicator name: `v2exfemhos` - unit: '' - display: - numDecimalPlaces: 0 - - ## 3.4.3.16 HOG female - wom_hog_vdem: # wom_hog_vdem_owid - title: Woman head of government - description_short: |- - Denotes whether the head of government in office on December 31 is a woman. - description_from_producer: |- - Question: What is the gender of the head of government? - - Clarification: If the head of government is a collective body, provide the gender of the person executing the most effective power over this body, or, if no such person exists, answer if any persons in the body are female. - - Responses: - 0: Male - 1: Female - - Indicator name: `v2exfemhog` - unit: '' - display: - numDecimalPlaces: 0 - - ## 3.5.1.6 Legislature corrupt activities - corr_leg_vdem: - title: Legislative corruption - description_from_producer: &description_prod_corr_leg_vdem |- - Question: Do members of the legislature abuse their position for financial gain? - - Clarification: - This includes any of the following: (a) accepting bribes, (b) helping to obtain government contracts for firms that the legislator (or his/her family/friends/political supporters) own, (c) doing favors for firms in exchange for the opportunity of employment after leaving the legislature, (d) stealing money from the state or from campaign donations for personal use. - - Please make your best estimate, based upon what is known or suspected to be true. - - For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. - - Responses: - 0: Commonly. Most legislators probably engage in these activities. - 1: Often. Many legislators probably engage in these activities. - 2: Sometimes. Some legislators probably engage in these activities. - 3: Very occasionally. There may be a few legislators who engage in these activities but the vast majority do not. - 4: Never, or hardly ever. - - Indicator name: `v2lgcrrpt` - unit: '' - display: - numDecimalPlaces: 3 - - corr_leg_vdem_low: - title: "{tables.vdem.variables.corr_leg_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_leg_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_leg_vdem_high: - title: "{tables.vdem.variables.corr_leg_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_leg_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.5.3.7 Lower chamber female legislators - wom_parl_vdem: - title: Lower chamber female legislators - description_short: |- - Percentage of women in the lower or single chamber of the legislature. - description_from_producer: |- - Question: What percentage (%) of the lower (or unicameral) chamber of the legislature is female? - - Indicator name: `v2lgfemleg` - unit: '%' - display: - numDecimalPlaces: 3 - - ## 3.6.0.1 Reasoned justification - justified_polch_vdem: - title: Justified political positions - description_short: |- - Best estimate of the extent to which political elites provide complex, nuanced, and complete justifications for their views when considering important policy changes. - description_from_producer: &description_prod_justified_polch_vdem |- - Question: When important policy changes are being considered, i.e. before a decision has been made, to what extent do political elites give public and reasoned justifications for their positions? - - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. - - Responses: - - 0: No justification. Elites almost always only dictate that something should or should not be done, but no reasoning about justification is given. For example, "We must cut spending." - 1: Inferior justification. Elites tend to give reasons why someone should or should not be for doing or not doing something, but the reasons tend to be illogical or false, although they may appeal to many voters. For example, "We must cut spending. The state is inefficient." [The inference is incomplete because addressing inefficiencies would not necessarily reduce spending and it might undermine essential services.] - 2: Qualified justification. Elites tend to offer a single simple reason justifying why the proposed policies contribute to or detract from an outcome. For example, "We must cut spending because taxpayers cannot afford to pay for current programs." - 3: Sophisticated justification. Elites tend to offer more than one or more complex, nuanced and complete justification. For example, "We must cut spending because taxpayers cannot afford to pay for current government programs. Raising taxes would hurt economic growth, and deficit spending would lead to inflation." - - Indicator name: `v2dlreason` - unit: '' - display: - numDecimalPlaces: 3 - - justified_polch_vdem_low: - title: "{tables.vdem.variables.justified_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_justified_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - justified_polch_vdem_high: - title: "{tables.vdem.variables.justified_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_justified_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.6.0.2 Common good - justcomgd_polch_vdem: - title: Common good justifications - description_short: |- - Best estimate of the extent to which political elites justify their views with the common good for society, either the greatest good for the greatest number of people, or as helping the least advantaged people in society when considering important policy changes. - description_from_producer: &description_prod_justcomgd_polch_vdem |- - Question: Question: When important policy changes are being considered, to what extent do political elites justify their positions in terms of the common good? - - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. - - Responses: - 0: Little or no justification in terms of the common good is usually offered. - 1: Specific business, geographic, group, party, or constituency interests are for the most part offered as justifications. - 2: Justifications are for the most part a mix of specific interests and the common good and it is impossible to say which justification is more common than the other. - 3: Justifications are based on a mixture of references to constituency/party/group interests and on appeals to the common good. - 4: Justifications are for the most part almost always based on explicit statements of the common good for society, understood either as the greatest good for the greatest number or as helping the least advantaged in a society. - - Indicator name: `v2dlcommon` - unit: '' - display: - numDecimalPlaces: 3 - - justcomgd_polch_vdem_low: - title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_justcomgd_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - justcomgd_polch_vdem_high: - title: "{tables.vdem.variables.justcomgd_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_justcomgd_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.6.0.3 Respect counterarguments - counterarg_polch_vdem: - title: Respect for counterarguments - description_short: |- - Best estimate of the extent to which political elites acknowledge and respect counterarguments when considering important policy changes. - description_from_producer: &description_prod_counterarg_polch_vdem |- - Question: When important policy changes are being considered, to what extent do political elites acknowledge and respect counterarguments? - - Clarification: Because discourse varies greatly from person to person, base your answer on the style that is most typical of prominent national political leaders. - - Responses: - 0: Counterarguments are not allowed or if articulated, punished. - 1: Counterarguments are allowed at least from some parties, but almost always are ignored. 2: Elites tend to acknowledge counterarguments but then explicitly degrade them by making a negative statement about them or the individuals and groups that propose them. - 3: Elites tend to acknowledge counterarguments without making explicit negative or positive statements about them. - 4: Elites almost always acknowledge counterarguments and explicitly value them, even if they ultimately reject them for the most part. - 5: Elites almost always acknowledge counterarguments and explicitly value them, and frequently also even accept them and change their position. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2dlcountr` - unit: '' - display: - numDecimalPlaces: 3 - - counterarg_polch_vdem_low: - title: "{tables.vdem.variables.counterarg_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_counterarg_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - counterarg_polch_vdem_high: - title: "{tables.vdem.variables.counterarg_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_counterarg_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ### 3.6.0.4 Range of consultation - elitecons_polch_vdem: - title: Elite consultation - description_short: |- - Best estimate of the extent to which political elites consult other elites across the political spectrum and from relevant sectors of society and business when considering important policy changes. - description_from_producer: &description_prod_elitecons_polch_vdem |- - Question: When important policy changes are being considered, how wide is the range of consultation at elite levels? - - Clarification: Because practices vary greatly from policy to policy, base your answer on the style that is most typical of policymaking. - - Responses: - 0: No consultation. The leader or a very small group (e.g. military council) makes authoritative decisions on their own. - 1: Very little and narrow. Consultation with only a narrow circle of loyal party/ruling elites. 2: Consultation includes the former plus a larger group that is loyal to the government, such as the ruling party's or parties' local executives and/or women, youth and other branches. - 3: Consultation includes the former plus leaders of other parties. - 4: Consultation includes the former plus a select range of society/labor/business representatives. - 5: Consultation engages elites from essentially all parts of the political spectrum and all politically relevant sectors of society and business. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2dlconslt` - unit: '' - display: - numDecimalPlaces: 3 - - elitecons_polch_vdem_low: - title: "{tables.vdem.variables.elitecons_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_elitecons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - elitecons_polch_vdem_high: - title: "{tables.vdem.variables.elitecons_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_elitecons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.6.0.5 Engaged society - soccons_polch_vdem: - title: Engaged society - description_short: |- - Best estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. - description_from_producer: &description_prod_soccons_polch_vdem |- - Question: When important policy changes are being considered, how wide and how independent are public deliberations? - - Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. - - Responses: - 0: Public deliberation is never, or almost never allowed. - 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. - 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. - 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. - 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. - 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2dlengage` - unit: '' - display: - numDecimalPlaces: 3 - - soccons_polch_vdem_low: - title: "{tables.vdem.variables.soccons_polch_vdem.title} (lower bound)" - description_from_producer: *description_prod_soccons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - soccons_polch_vdem_high: - title: "{tables.vdem.variables.soccons_polch_vdem.title} (upper bound)" - description_from_producer: *description_prod_soccons_polch_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.7.0.6 Judicial corruption decision - corr_jud_vdem: - title: Judicial corruption - description_from_producer: &description_prod_corr_jud_vdem |- - Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? - - Responses: - 0: Always. - 1: Usually. - 2: About half of the time. 3: Not usually. - 4: Never. - - Scale: Ordinal, converted to interval by the measurement model. - - Notes: For reasons of consistency, as of December, 2014, responses to this question are reversed so that the least democratic response is ”0” and the most democratic is ”4”. - - Indicator name: `v2jucorrdc` - unit: '' - display: - numDecimalPlaces: 3 - - corr_jud_vdem_low: - title: "{tables.vdem.variables.corr_jud_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_jud_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_jud_vdem_high: - title: "{tables.vdem.variables.corr_jud_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_jud_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.8.2.2 Rigorous and impartial public administration - public_admin_vdem: - title: Rigorous and impartial public administration - description_short: |- - Best estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. - description_from_producer: &description_prod_public_admin_vdem |- - Question: Are public officials rigorous and impartial in the performance of their duties? - - Clarification: - This question focuses on the extent to which public officials generally abide by the law and treat like cases alike, or conversely, the extent to which public administration is characterized by arbitrariness and biases (i.e., nepotism, cronyism, or discrimination). - - The question covers the public officials that handle the cases of ordinary people. If no functioning public administration exists, the lowest score (0) applies. - - Responses: - 0: The law is not respected by public officials. Arbitrary or biased administration of the law is rampant. - 1: The law is weakly respected by public officials. Arbitrary or biased administration of the law is widespread. - 2: The law is modestly respected by public officials. Arbitrary or biased administration of the law is moderate. - 3: The law is mostly respected by public officials. Arbitrary or biased administration of the law is limited. - 4: The law is generally fully respected by the public officials. Arbitrary or biased administration of the law is very limited. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2clrspct` - unit: '' - display: - numDecimalPlaces: 3 - - public_admin_vdem_low: - title: "{tables.vdem.variables.public_admin_vdem.title} (lower bound)" - description_from_producer: *description_prod_public_admin_vdem - unit: '' - display: - numDecimalPlaces: 3 - - public_admin_vdem_high: - title: "{tables.vdem.variables.public_admin_vdem.title} (upper bound)" - description_from_producer: *description_prod_public_admin_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.8.2.6 Social group equality in respect for civil liberties - socgr_civ_libs_vdem: - title: Equality of civil liberties across social groups - description_short: |- - Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. - description_from_producer: &description_prod_socgr_civ_libs_vdem |- - Question: Do all social groups, as distinguished by language, ethnicity, religion, race, region, or caste, enjoy the same level of civil liberties, or are some groups generally in a more favorable position? - - Clarification: Here, civil liberties are understood to include access to justice, private property rights, freedom of movement, and freedom from forced labor. - - Responses: - 0: Members of some social groups enjoy much fewer civil liberties than the general population. 1: Members of some social groups enjoy substantially fewer civil liberties than the general population. - 2: Members of some social groups enjoy moderately fewer civil liberties than the general population. - 3: Members of some social groups enjoy slightly fewer civil liberties than the general population. 4: Members of all salient social groups enjoy the same level of civil liberties. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2clsocgrp` - unit: '' - display: - numDecimalPlaces: 3 - - socgr_civ_libs_vdem_low: - title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_socgr_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - socgr_civ_libs_vdem_high: - title: "{tables.vdem.variables.socgr_civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_socgr_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.9.0.1 Domestic autonomy - dom_auton_vdem: - title: Domestic policymaking free from foreign influence - description_short: |- - Best estimate of the extent to which domestic policy is free from the interference of other states. - description_from_producer: &description_prod_dom_auton_vdem |- - Question: Is the state autonomous from the control of other states with respect to the conduct of domestic policy? - - Clarification: The question of domestic autonomy does not include restrictions emanating from treaties (e.g., NATO), international organizations (e.g., the WTO), or confederations (e.g., the European Union) if these agreements are freely negotiated by the state and if the state is free to exit from that treaty, organization, or confederation. Nor does it include restrictions on policymaking emanating from international market forces and trans-national corporations. - - Responses: - 0: Non-autonomous. National level authority is exercised by an external power, either by law or in practice. The most common examples of this are direct colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). It also includes situations in which domestic actors provide de jure cover for de facto control by a foreign power (e.g. Vichy France). However, control of some part of the territory of a state by an enemy during war is not considered control by external actors if the sovereign government remains on scene and continues to wage conventional war (e.g., the USSR during WW II). - 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to rule, decides who can or cannot rule through formal rules or informal understandings, or precludes certain policies through explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples include Soviet "satellite" states in Eastern Europe, and situations where colonial powers grant limited powers of national self- government to their possessions (e.g., protectorates and limited home government). - 2: Autonomous. Domestic political actors exercise political authority free of the direct control of external political actors. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2svdomaut` - unit: '' - display: - numDecimalPlaces: 3 - - dom_auton_vdem_low: - title: "{tables.vdem.variables.dom_auton_vdem.title} (lower bound)" - description_from_producer: *description_prod_dom_auton_vdem - unit: '' - display: - numDecimalPlaces: 3 - - dom_auton_vdem_high: - title: "{tables.vdem.variables.dom_auton_vdem.title} (upper bound)" - description_from_producer: *description_prod_dom_auton_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.9.0.2 International autonomy - int_auton_vdem: - title: Foreign policymaking free from foreign influence - description_short: |- - Best estimate of the extent to which foreign policy is free from the interference of other states. - description_from_producer: &description_prod_int_auton_vdem |- - Question: Is the state autonomous from the control of other states with respect to the conduct of its foreign policy? - - Responses: - 0: Non-autonomous. Foreign policy is controlled by an external power, either de facto or de jure. The most common examples of this are colonial rule and military occupation (e.g. quadripartite occupation of Germany in 1945). Situations in which domestic actors provide de jure cover for de facto control by a foreign power should not be construed as semi-autonomy (e.g. Vichy France). Governments in exile that control underground forces waging unconventional warfare are not considered as mitigating an occupation regime (e.g. countries under German occupation during WWII). - 1: Semi-autonomous. An external political actor directly constrains the ability of domestic actors to pursue an independent foreign policy course in some important areas. This may be the product of explicit treaty provisions or well-understood rules of the game from which the subject state cannot withdraw. Examples would include Soviet strictures over rule in so-called "satellite" states in Eastern Europe, and explicitly negotiated postwar settlements (e.g. Austria following WWII). - 2: Autonomous. Domestic political actors exercise foreign policy free of the direct control of external political actors. Direct control is meant to exclude the exercise of constraint or the impact of interdependence in the international system. Treaties in which states concede some part of that control to a supra- or international organization voluntarily, and from which there is a possibility of exit should not be interpreted as a violation of autonomy. - - Indicator name: `v2svinlaut` - unit: '' - display: - numDecimalPlaces: 3 - - int_auton_vdem_low: - title: "{tables.vdem.variables.int_auton_vdem.title} (lower bound)" - description_from_producer: *description_prod_int_auton_vdem - unit: '' - display: - numDecimalPlaces: 3 - - int_auton_vdem_high: - title: "{tables.vdem.variables.int_auton_vdem.title} (upper bound)" - description_from_producer: *description_prod_int_auton_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.9.0.3 State authority over territory - terr_contr_vdem: - title: Territory under state control - description_short: |- - Best estimate of the percentage of territory controlled by the government. - description_from_producer: &description_prod_terr_contr_vdem |- - Question: Over what percentage (%) of the territory does the state have effective control? - - Clarification: - With this question we seek to judge the extent of recognition of the preeminent authority of the state over its territory. We are not interested here in perfect control by the state, or whether it is relatively effective in comparison to other states, but an assessment of the areas over which it is hegemonic, e.g. where it is recognized as the preeminent authority and in a contest of wills it can assert its control over political forces that reject its authority. Several illustrative examples may help in this coding. During civil wars the claim of the state to rule is effectively neutralized by insurgent groups (e.g., the Tamil Tigers in Sri Lanka). There are also situations in which criminals or warlords exert control in contravention of state authority (e.g. opium growers in parts of Indochina). There are also cases of failed states where the central government cannot assert control over a share of its territory (e.g., contemporary Somalia). Here, we ask you to estimate the size of the territory that the state has effective control over, as a percentage (%) of the total territory that is officially part of the country. - - By "officially part of the country" we refer to international law. In cases where international law is not entirely clear, we refer you to general understandings. For example, China claims sovereignty over Taiwan, but it remains under the control of its own government. For purposes of this question, Taiwan should not be considered a failure to control its territory by the government of the PRC. - - Indicator name: `v2svstterr` - unit: '%' - display: - numDecimalPlaces: 3 - - terr_contr_vdem_low: - title: "{tables.vdem.variables.terr_contr_vdem.title} (lower bound)" - description_from_producer: *description_prod_terr_contr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - terr_contr_vdem_high: - title: "{tables.vdem.variables.terr_contr_vdem.title} (upper bound)" - description_from_producer: *description_prod_terr_contr_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 3.12.0.2 Power distributed by social group - socgr_pow_vdem: - title: Equality of political power across social groups - description_short: |- - Best estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. - description_from_producer: &description_prod_socgr_pow_vdem |- - Question: Is political power distributed according to social groups? - - Clarification: A social group is differentiated within a country by caste, ethnicity, language, race, region, religion, or some combination thereof. (It does not include identities grounded in sexual orientation or socioeconomic status.) Social group identity is contextually defined and is likely to vary across countries and through time. Social group identities are also likely to cross-cut, so that a given person could be defined in multiple ways, i.e., as part of multiple groups. Nonetheless, at any given point in time there are social groups within a society that are understood — by those residing within that society — to be different, in ways that may be politically relevant. - - Responses: - 0: Political power is monopolized by one social group comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 1: Political power is monopolized by several social groups comprising a minority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 2: Political power is monopolized by several social groups comprising a majority of the population. This monopoly is institutionalized, i.e., not subject to frequent change. - 3: Either all social groups possess some political power, with some groups having more power than others; or different social groups alternate in power, with one group controlling much of the political power for a period of time, followed by another — but all significant groups have a turn at the seat of power. - 4: All social groups have roughly equal political power or there are no strong ethnic, caste, linguistic, racial, religious, or regional differences to speak of. Social group characteristics are not relevant to politics. - - Indicator name: `v2pepwrsoc` - unit: '' - display: - numDecimalPlaces: 3 - - socgr_pow_vdem_low: - title: "{tables.vdem.variables.socgr_pow_vdem.title} (lower bound)" - description_from_producer: *description_prod_socgr_pow_vdem - unit: '' - display: - numDecimalPlaces: 3 - - socgr_pow_vdem_high: - title: "{tables.vdem.variables.socgr_pow_vdem.title} (upper bound)" - description_from_producer: *description_prod_socgr_pow_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.4.3 Presidentialism Index - personalism_vdem: - title: Presidentialism Index - description_short: |- - Best estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. - description_from_producer: &description_prod_personalism_vdem |- - Question: To what extent is the regime characterized by presidentialism? - - Clarification: - Presidentialism means the "systemic concentration of political power in the hands of one individual who resists delegating all but the most trivial decision making tasks" (Bratton and Van de Walle, 1997: 63). It relates closely to V-Dem's index of Horizontal Accountability (v2x_horacc) but focuses more specifically on the extent to which the President is free from constraints by other institutions or actors. The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xnp_pres` - unit: '' - display: - numDecimalPlaces: 3 - - personalism_vdem_low: - title: "{tables.vdem.variables.personalism_vdem.title} (lower bound)" - description_from_producer: *description_prod_personalism_vdem - unit: '' - display: - numDecimalPlaces: 3 - - personalism_vdem_high: - title: "{tables.vdem.variables.personalism_vdem.title} (upper bound)" - description_from_producer: *description_prod_personalism_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.5.1 Civil liberties index - civ_libs_vdem: - title: Civil liberties index - description_short: |- - Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. - description_from_producer: &description_prod_civ_libs_dem |- - Question: To what extent is civil liberty respected? - - Clarification: Civil liberty is understood as liberal freedom, where freedom is a property of individuals. Civil liberty is constituted by the absence of physical violence committed by government agents and the absence of constraints of private liberties and political liberties by the government. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_civlib` - unit: '' - display: - numDecimalPlaces: 3 - - civ_libs_vdem_low: - title: "{tables.vdem.variables.civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_civ_libs_dem - unit: '' - display: - numDecimalPlaces: 3 - - civ_libs_vdem_high: - title: "{tables.vdem.variables.civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_civ_libs_dem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.5.4 Private civil liberties index - priv_libs_vdem: - title: Private civil liberties index - description_short: |- - Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. - description_from_producer: &description_prod_priv_libs_vdem |- - Question: To what extent are private liberties respected? - - Clarification: Private liberties are understood as freedom of movement, freedom of religion, freedom from forced labor, and property rights. The index is based on indicators that reflect government repression and that are not directly referring to elections. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_clpriv` - unit: '' - display: - numDecimalPlaces: 3 - - priv_libs_vdem_low: - title: "{tables.vdem.variables.priv_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_priv_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - priv_libs_vdem_high: - title: "{tables.vdem.variables.priv_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_priv_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.5.3 Political civil liberties index - pol_libs_vdem: - title: Political civil liberties index - description_short: |- - Central estimate of the extent to which people enjoy the freedoms of expression and association. - description_from_producer: &description_prod_pol_libs_vdem |- - Question: To what extent are political liberties respected? - - Clarification: Political liberties are understood as freedom of association and freedom of expression. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect government repression and that are not directly referring to elections. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_clpol` - unit: '' - display: - numDecimalPlaces: 3 - - pol_libs_vdem_low: - title: "{tables.vdem.variables.pol_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_pol_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - pol_libs_vdem_high: - title: "{tables.vdem.variables.pol_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_pol_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.5.2 Physical violence index - phys_integr_libs_vdem: - title: Physical integrity liberties - description_short: |- - Central estimate of the extent to which people are free from government torture and political killings. - description_from_producer: &description_prod_phys_integr_libs_vdem |- - Question: To what extent is physical integrity respected? - - Clarification: Physical integrity is understood as freedom from political killings and torture by the government. Among the set of civil liberties, these liberal rights are the most relevant for political competition and accountability. The index is based on indicators that reflect violence committed by government agents and that are not directly referring to elections. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_clphy` - unit: '' - display: - numDecimalPlaces: 3 - - phys_integr_libs_vdem_low: - title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_phys_integr_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - phys_integr_libs_vdem_high: - title: "{tables.vdem.variables.phys_integr_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_phys_integr_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.7.1 Political corruption index - corruption_vdem: - title: Political corruption index - description_short: |- - Best estimate of the extent to which a country is affected by political corruption. - description_from_producer: &description_prod_corruption_vdem |- - Question: How pervasive is political corruption? - - Clarification: The directionality of the V-Dem corruption index runs from less corrupt to more corrupt unlike the other V-Dem variables that generally run from less democratic to more democratic situation. The corruption index includes measures of six distinct types of corruption that cover both different areas and levels of the polity realm, distinguishing between executive, legislative and judicial corruption. Within the executive realm, the measures also distinguish between corruption mostly pertaining to bribery and corruption due to embezzlement. Finally, they differentiate between corruption in the highest echelons of the executive at the level of the rulers/cabinet on the one hand, and in the public sector at large on the other. The measures thus tap into several distinguished types of corruption: both 'petty' and 'grand'; both bribery and theft; both corruption aimed and influencing law making and that affecting implementation. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_corr` - unit: '' - display: - numDecimalPlaces: 3 - - corruption_vdem_low: - title: "{tables.vdem.variables.corruption_vdem.title} (lower bound)" - description_from_producer: *description_prod_corruption_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corruption_vdem_high: - title: "{tables.vdem.variables.corruption_vdem.title} (upper bound)" - description_from_producer: *description_prod_corruption_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.7.3 Public sector corruption index [Not in use] - corr_publsec_vdem: - title: Public sector corruption index - description_from_producer: &description_prod_corr_publsec_vdem |- - Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? - - Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_pubcorr` - unit: '' - display: - numDecimalPlaces: 3 - - corr_publsec_vdem_low: - title: "{tables.vdem.variables.corr_publsec_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_publsec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_publsec_vdem_high: - title: "{tables.vdem.variables.corr_publsec_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_publsec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.7.2 Executive corruption index [Not in use] - corr_exec_vdem: - title: Executive corruption index - description_from_producer: &description_prod_corr_exec_vdem |- - Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? - - Clarification: The point estimates for this index have been reversed such that the directionality is opposite to the input variables. That is, lower scores indicate a normatively better situation (e.g. more democratic) and higher scores a normatively worse situation (e.g. less democratic). Note that this directionality is opposite of that of other V-Dem indices, which generally run from normatively worse to better. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_execorr` - unit: '' - display: - numDecimalPlaces: 3 - - corr_exec_vdem_low: - title: "{tables.vdem.variables.corr_exec_vdem.title} (lower bound)" - description_from_producer: *description_prod_corr_exec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - corr_exec_vdem_high: - title: "{tables.vdem.variables.corr_exec_vdem.title} (upper bound)" - description_from_producer: *description_prod_corr_exec_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.8.1 Women political empowerment index - wom_emp_vdem: - title: Women's political empowerment index - description_short: |- - Best estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. - description_from_producer: &description_prod_wom_emp_vdem |- - Question: How politically empowered are women? - - Clarification: Women's political empowerment is defined as a process of increasing capacity for women, leading to greater choice, agency, and participation in societal decision-making. It is understood to incorporate three equally-weighted dimensions: fundamental civil liberties, women's open discussion of political issues and participation in civil society organizations, and the descriptive representation of women in formal political positions. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_gender` - unit: '' - display: - numDecimalPlaces: 3 - - wom_emp_vdem_low: - title: "{tables.vdem.variables.wom_emp_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_emp_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_emp_vdem_high: - title: "{tables.vdem.variables.wom_emp_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_emp_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.8.2 Women civil liberties index - wom_civ_libs_vdem: - title: Women's civil rights index - description_short: |- - Best estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. - description_from_producer: &description_prod_wom_civ_libs_vdem |- - Question: Do women have the ability to make meaningful decisions in key areas of their lives? - - Clarification: Women's civil liberties are understood to include freedom of domestic movement, the right to private property, freedom from forced labor, and access to justice. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_gencl` - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_libs_vdem_low: - title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_libs_vdem_high: - title: "{tables.vdem.variables.wom_civ_libs_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_civ_libs_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.8.3 Women civil society participation index - wom_civ_soc_vdem: - title: Women's civil society participation index - description_short: |- - Best estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. - description_from_producer: &description_prod_wom_civ_soc_vdem |- - Question: Do women have the ability to express themselves and to form and participate in groups? - - Clarification: Women's civil society participation is understood to include open discussion of political issues, participation in civil society organizations, and representation in the ranks of journalists. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_gencs` - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_soc_vdem_low: - title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_civ_soc_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_civ_soc_vdem_high: - title: "{tables.vdem.variables.wom_civ_soc_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_civ_soc_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.8.4 Women political participation index - wom_pol_par_vdem: - title: Women's political participation index - description_short: |- - Best estimate of the extent to which women are represented in the legislature and have an equal share of political power. - description_from_producer: &description_prod_wom_pol_par_vdem |- - Question: Are women descriptively represented in formal political positions? - - Clarification: Women's political participation is understood to include women's descriptive representation in the legislature and an equal share in the overall distribution of power. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_genpp` - unit: '' - display: - numDecimalPlaces: 3 - - wom_pol_par_vdem_low: - title: "{tables.vdem.variables.wom_pol_par_vdem.title} (lower bound)" - description_from_producer: *description_prod_wom_pol_par_vdem - unit: '' - display: - numDecimalPlaces: 3 - - wom_pol_par_vdem_high: - title: "{tables.vdem.variables.wom_pol_par_vdem.title} (upper bound)" - description_from_producer: *description_prod_wom_pol_par_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.9.1 Rule of law index - rule_of_law_vdem: - title: Rule of Law index - description_short: |- - Best estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. - description_from_producer: &description_prod_rule_of_law_vdem |- - Question: To what extent are laws transparently, independently, predictably, impartially, and equally enforced, and to what extent do the actions of government officials comply with the law? - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2x_rule` - unit: '' - display: - numDecimalPlaces: 3 - - rule_of_law_vdem_low: - title: "{tables.vdem.variables.rule_of_law_vdem.title} (lower bound)" - description_from_producer: *description_prod_rule_of_law_vdem - unit: '' - display: - numDecimalPlaces: 3 - - rule_of_law_vdem_high: - title: "{tables.vdem.variables.rule_of_law_vdem.title} (upper bound)" - description_from_producer: *description_prod_rule_of_law_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 5.11.1 Core civil society index [not in use] - civ_soc_str_vdem: - title: Core civil society index - description_from_producer: &description_prod_civ_soc_str_vdem |- - Question: How robust is civil society? - - Clarification: The sphere of civil society lies in the public space between the private sphere and the state. Here, citizens organize in groups to pursue their collective interests and ideals. We call these groups civil society organizations CSOs. CSOs include, but are by no means limited to, interest groups, labor unions, spiritual organizations if they are engaged in civic or political activities, social movements, professional associations, charities, and other non-governmental organizations. - - The core civil society index CCSI is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. - - Scale: Interval, from low to high (0-1). - - Indicator name: `v2xcs_ccsi` - unit: '' - display: - numDecimalPlaces: 3 - - civ_soc_str_vdem_low: - title: "{tables.vdem.variables.civ_soc_str_vdem.title} (lower bound)" - description_from_producer: *description_prod_civ_soc_str_vdem - unit: '' - display: - numDecimalPlaces: 3 - - civ_soc_str_vdem_high: - title: "{tables.vdem.variables.civ_soc_str_vdem.title} (upper bound)" - description_from_producer: *description_prod_civ_soc_str_vdem - unit: '' - display: - numDecimalPlaces: 3 - - ## 9.4.2 Government effectiveness - goveffective_vdem_wbgi: - title: Government effectiveness - description_short: |- - Denotes perceptions of the quality of public services, the civil service, and policy formulation and implementation (positive values mean higher effectiveness) based on the data from the World Governance Indicators. - - description_from_producer: |- - "Government Effectiveness" combines into a single grouping responses on the quality of public service provision, the quality of the bureaucracy, the competence of civil servants, the independence of the civil service from political pressures, and the credibility of the government's commitment to policies. The main focus of this index is on "inputs" required for the government to be able to produce and implement good policies and deliver public goods. - - Indicator name: `e_wbgi_gee` - unit: '' - display: - numDecimalPlaces: 3 - - ## 9.9.3 Corruption perception index [not in use] - corruption_cpi: - title: Corruption perceptions index - description_from_producer: |- - The CPI focuses on corruption in the public sector and defines corruption as the abuse of public office for private gain. The surveys used in compiling the CPI tend to ask questions in line with the misuse of public power for private benefit, with a focus, for example, on bribe-taking by public officials in public procurement. The sources do not distinguish between administrative and political corruption. The CPI Score relates to perceptions of the degree of corruption as seen by business people, risk analysts and the general public and ranges between 100 (highly clean) and 0 (highly corrupt). - - Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE] 3.1.2.5 Elections multiparty - electmulpar_row: - title: Multiparty elections (re-estimate) - description_short: |- - Best estimate of whether national multi-party elections were held or not. - description_from_producer: &description_prod_electmulpar_vdem |- - Question: Question: Was this national election multiparty? - - Responses: - 0: No. No-party or single-party and there is no meaningful competition (includes situations where a few parties are legal but they are all de facto controlled by the dominant party). - 1: Not really. No-party or single-party (defined as above) but multiple candidates from the same party and/or independents contest legislative seats or the presidency. - 2: Constrained. At least one real opposition party is allowed to contest but competition is highly constrained — legally or informally. - 3: Almost. Elections are multiparty in principle but either one main opposition party is prevented (de jure or de facto) from contesting, or conditions such as civil unrest (excluding natural disasters) prevent competition in a portion of the territory. - 4: Yes. Elections are multiparty, even though a few marginal parties may not be permitted to contest (e.g. far-right/left extremist parties, anti-democratic religious or ethnic parties). - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_electmulpar_row |- - We use a threshold of 2 on `v2elmulpar_osp` to classify the original indicator into 0 ("No") and 1 ("Yes") categories. - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_high_row: - title: "{tables.vdem.variables.electmulpar_row.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether national multi-party elections were held or not. - description_from_producer: *description_prod_electmulpar_vdem - description_processing: *description_processing_electmulpar_row - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_low_row: - title: "{tables.vdem.variables.electmulpar_row.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether national multi-party elections were held or not. - description_from_producer: *description_prod_electmulpar_vdem - description_processing: *description_processing_electmulpar_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [CUSTOM] - electmulpar_hoe_row_owid: - title: Multi-party elections for government's chief executive - description_short: |- - - unit: '' - description_processing: &description_processing_electmulpar_hoe_row_owid |- - {definitions.auxiliary.description_processing_row} - - Finally, we make some additional minor changes to the coding rules. - - The two most consequential changes we make relate to RoW's identification of whether a country's chief executive is elected. First, one way RoW considers a chief executive to have been elected — even if they are not directly elected or appointed by the legislature — is if they are the head of state, they depend on the approval of the legislature, and there were multi-party elections for the executive. This last part is likely a coding error because to be consistent with RoW's other definitions, this should depend on multi-party legislative, not executive, elections. Only if the legislature has been chosen in multi-party elections does it make an otherwise unelected chief executive—who must be approved by that legislature—dependent on multi-party elections. We correct this error. - - Second, RoW considers a chief executive to have been elected if the country had chosen both its legislature and executive in multi-party elections. But this considers some chief executives as elected even if they came to power through force after elections were previously held. Examples include the coup d'états led by Fulgencio Batista in Cuba in 1952 and by Muhammadu Buhari in Nigeria in 1983. We instead consider such chief executives as unelected. - display: - numDecimalPlaces: 0 - - electmulpar_hoe_high_row_owid: - title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (upper bound)" - unit: '' - description_processing: *description_processing_electmulpar_hoe_row_owid - display: - numDecimalPlaces: 0 - - electmulpar_hoe_low_row_owid: - title: "{tables.vdem.variables.electmulpar_hoe_row_owid.title} (lower bound)" - unit: '' - description_processing: *description_processing_electmulpar_hoe_row_owid - display: - numDecimalPlaces: 0 - - ## [CUSTOM, based on `v2elmulpar_osp`] - electmulpar_leg_row: - title: Multiparty elections for legislature - description_short: |- - Best estimate of whether multi-party elections for the national legislature were held or not. - description_processing: &description_proc_electmulpar_leg_row |- - Use the value from `v2elmulpar_osp` whenever `v2eltype` is 0, 1, 4 or 5. Otherwise the value is missing. - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_leg_high_row: - title: "{tables.vdem.variables.electmulpar_leg_row.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether multi-party elections for the national legislature were held or not. - description_processing: *description_proc_electmulpar_leg_row - unit: '' - display: - numDecimalPlaces: 0 - - electmulpar_leg_low_row: - title: "{tables.vdem.variables.electmulpar_leg_row.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether multi-party elections for the national legislature were held or not. - description_processing: *description_proc_electmulpar_leg_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index - electdem_dich_row_owid: - title: Electoral democracy (re-estimate) - description_short: |- - Best estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - description_processing: |- - We employ Lührmann et al.'s criteria and use a threshold of 0.5 to classify the original indicator (`v2x_polyarchy_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - electdem_dich_high_row_owid: - title: "{tables.vdem.variables.electdem_dich_row_owid.title} (upper bound)" - description_short: |- - Upper-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 0 - - electdem_dich_low_row_owid: - title: "{tables.vdem.variables.electdem_dich_row_owid.title} (lower bound)" - description_short: |- - Lower-bound estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. - description_from_producer: *description_prod_electdem_vdem - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.1.2.15 Election free and fair - electfreefair_row: - title: Free and fair elections (re-estimate) - description_short: Best estimate of whether national elections were free and fair or not. - description_from_producer: &description_prod_electfreefair_row |- - Question: Taking all aspects of the pre-election period, election day, and the post-election process into account, would you consider this national election to be free and fair? - - Clarification: The only thing that should not be considered in coding this is the extent of suffrage (by law). Thus, a free and fair election may occur even if the law excludes significant groups (an issue measured separately). - - Responses: - 0: No, not at all. The elections were fundamentally flawed and the official results had little if anything to do with the 'will of the people' (i.e., who became president; or who won the legislative majority). - 1: Not really. While the elections allowed for some competition, the irregularities in the end affected the outcome of the election (i.e., who became president; or who won the legislative majority). - 2: Ambiguous. There was substantial competition and freedom of participation but there were also significant irregularities. It is hard to determine whether the irregularities affected the outcome or not (as defined above). - 3: Yes, somewhat. There were deficiencies and some degree of fraud and irregularities but these did not in the end affect the outcome (as defined above). - 4: Yes. There was some amount of human error and logistical restrictions but these were largely unintentional and without significant consequences. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_electfreefair_row |- - We employ Lührmann et al.'s criteria and use a threshold of 2 to classify the original indicator (`v2elfrfair_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - electfreefair_high_row: - title: "{tables.vdem.variables.electfreefair_row.title} (upper bound)" - description_short: Upper-bound estimate of whether national elections were free and fair or not. - description_from_producer: *description_prod_electfreefair_row - description_processing: *description_processing_electfreefair_row - unit: '' - display: - numDecimalPlaces: 0 - - electfreefair_low_row: - title: "{tables.vdem.variables.electfreefair_row.title} (lower bound)" - description_short: Lower-bound estimate of whether national elections were free and fair or not. - description_from_producer: *description_prod_electfreefair_row - description_processing: *description_processing_electfreefair_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index - lib_dich_row: - title: Liberal political institutions (re-estimate) - description_short: Best estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: &description_processing_lib_dich_row |- - We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - lib_dich_high_row: - title: "{tables.vdem.variables.lib_dich_row.title} (upper bound)" - description_short: Upper-bound estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: *description_processing_lib_dich_row - unit: '' - display: - numDecimalPlaces: 0 - - lib_dich_low_row: - title: "{tables.vdem.variables.lib_dich_row.title} (lower bound)" - description_short: Lower-bound estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: *description_processing_lib_dich_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men - accessjust_m_row: - title: Access to justice for men (re-estimate) - description_short: Best estimate of whether men have access to justice or not. - description_from_producer: &description_prod_accessjust_m_row |- - Question: Do men enjoy secure and effective access to justice? - - Clarification: This question specifies the extent to which men can bring cases before the courts without risk to their personal safety, trials are fair, and men have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - - This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. - - Responses: - 0: Secure and effective access to justice for men is non-existent. - 1: Secure and effective access to justice for men is usually not established or widely respected. 2: Secure and effective access to justice for men is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. - 3: Secure and effective access to justice for men is usually observed. - 4: Secure and effective access to justice for men is almost always observed. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_accessjust_m_row |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstm_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_m_high_row: - title: "{tables.vdem.variables.accessjust_m_row.title} (upper bound)" - description_short: Upper-bound estimate of whether men have access to justice or not. - description_from_producer: *description_prod_accessjust_m_row - description_processing: *description_processing_accessjust_m_row - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_m_low_row: - title: "{tables.vdem.variables.accessjust_m_row.title} (lower bound)" - description_short: Lower-bound estimate of whether men have access to justice or not. - description_from_producer: *description_prod_accessjust_m_row - description_processing: *description_processing_accessjust_m_row - unit: '' - display: - numDecimalPlaces: 0 - - # [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.4 Access to justice for women - accessjust_w_row: - title: Access to justice for women (re-estimate) - description_short: Best estimate of whether women have access to justice or not. - description_from_producer: &description_prod_accessjust_w_row |- - Question: Do women enjoy equal, secure, and effective access to justice? - - Clarification: This question specifies the extent to which women can bring cases before the courts without risk to their personal safety, trials are fair, and women have effective ability to seek redress if public authorities violate their rights, including the rights to counsel, defense, and appeal. - - This question does not ask you to assess the relative access to justice men and women. Thus, it is possible to assign the lowest possible score to a country even if men and women enjoy equal — and extremely limited — access to justice. - - Responses: - 0: Secure and effective access to justice for women is non-existent. - 1: Secure and effective access to justice for women is usually not established or widely respected. 2: Secure and effective access to justice for women is inconsistently observed. Minor problems characterize most cases or occur rather unevenly across different parts of the country. - 3: Secure and effective access to justice for women is usually observed. - 4: Secure and effective access to justice for women is almost always observed. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_accessjust_w_row |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2clacjstw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_w_high_row: - title: "{tables.vdem.variables.accessjust_w_row.title} (upper bound)" - description_short: Upper-bound estimate of whether women have access to justice or not. - description_from_producer: *description_prod_accessjust_w_row - description_processing: *description_processing_accessjust_w_row - unit: '' - display: - numDecimalPlaces: 0 - - accessjust_w_low_row: - title: "{tables.vdem.variables.accessjust_w_row.title} (lower bound)" - description_short: Lower-bound estimate of whether women have access to justice or not. - description_from_producer: *description_prod_accessjust_w_row - description_processing: *description_processing_accessjust_w_row - unit: '' - display: - numDecimalPlaces: 0 - - ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement - transplaws_row: - title: Transparent laws with predictable enforcement (re-estimate) - description_short: |- - Best estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: &description_prod_transplaws |- - Question: Are the laws of the land clear, well publicized, coherent (consistent with each other), relatively stable from year to year, and enforced in a predictable manner? - - Clarification: This question focuses on the transparency and predictability of the laws of the land. - - Responses: - 0: Transparency and predictability are almost non-existent. The laws of the land are created and/or enforced in completely arbitrary fashion. - 1: Transparency and predictability are severely limited. The laws of the land are more often than not created and/or enforced in arbitrary fashion. - 2: Transparency and predictability are somewhat limited. The laws of the land are mostly created in a non-arbitrary fashion but enforcement is rather arbitrary in some parts of the country. - 3: Transparency and predictability are fairly strong. The laws of the land are usually created and enforced in a non-arbitrary fashion. - 4: Transparency and predictability are very strong. The laws of the land are created and enforced in a non-arbitrary fashion. - - Scale: Ordinal, converted to interval by the measurement model. - description_processing: &description_processing_transplaws |- - We employ Lührmann et al.'s criteria and use a threshold of 3 to classify the original indicator (`v2cltrnslw_osp*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - - transplaws_high_row: - title: "{tables.vdem.variables.transplaws_row.title} (upper bound)" - description_short: |- - Upper estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: *description_prod_transplaws - description_processing: *description_processing_transplaws - unit: '' - display: - numDecimalPlaces: 0 - - transplaws_low_row: - title: "{tables.vdem.variables.transplaws_row.title} (lower bound)" - description_short: |- - Lower estimate of whether laws are transparent, coherent, and relatively stable, and their enforcement predictable. - description_from_producer: *description_prod_transplaws - description_processing: *description_processing_transplaws - unit: '' - display: - numDecimalPlaces: 0 - - ## HOE female (custom) - # NOTE: Add adjustment in citation_full - wom_hoe_vdem: # wom_hoe_vdem_owid - title: Woman head of executive - description_short: |- - The variable denotes whether the chief executive of government in office on December 31 is a woman. - description_processing: |- - Assigns the value based on the gender of the most powerful chief: either Head of state or Head of government. - - Uses gender from HOS: - - If head of state is more powerful than head of government, and head of state is the head of the executive. - - If head of state is also head of government. - - If head of government is less powerful than head of state. - - Uses HOG if: - - If head of state is less powerful than head of government - - We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. - unit: '' - display: - numDecimalPlaces: 0 - - ## Other regime indicators - regime_amb_row_owid: - title: Political regime (inc. ambiguous categories) - unit: '' - description_short: |- - Political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg, including ambiguous categories. - description_key: - - It distinguishes between closed autocracies (score 0), electoral autocracies (score 3), electoral democracies (score 6), and liberal democracies (score 9) as the main types. - - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. - - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). - description_processing: "{definitions.auxiliary.description_processing_row}" - display: - numDecimalPlaces: 0 - - regime_redux_row_owid: - title: Political regime - description_short: |- - Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. - description_key: - - It distinguishes between closed autocracies (score 0), electoral autocracies (score 1), and electoral democracies (score 2, including liberal democracies). - - In closed autocracies, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. - - In electoral autocracies, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - description_processing: "{definitions.auxiliary.description_processing_row}" - unit: '' - display: - numDecimalPlaces: 0 - - # NEW - num_years_in_electdem_consecutive: # electdem_age_row_owid - title: Age of electoral democracy - description_short: Number of consecutive years in electoral democracy. - description_key: &description_key_num_electdem - - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - unit: years - - num_years_in_electdem: # electdem_exp_row_owid - title: Experience with electoral democracy - description_short: Number of total years in electoral democracy. It sums all periods of electoral democracy. - description_key: *description_key_num_electdem - unit: years - - num_years_in_electdem_cat: # electdem_age_group_row_owid - title: Electoral democracy age group - description_short: Category of electoral democracies based on the country's age of electoral democracy. - description_key: *description_key_num_electdem - unit: '' - - num_years_in_libdem_consecutive: # libdem_age_row_owid - title: Age of liberal democracy - description_short: Number of consecutive years in electoral democracy. - description_key: &description_key_num_libdem - - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - unit: years - - num_years_in_libdem: # libdem_exp_row_owid - title: Experience with liberal democracy - description_processing: Number of total years in liberal democracy. It sums all periods of liberal democracy. - description_key: *description_key_num_libdem - unit : years - - num_years_in_libdem_cat: # libdem_age_group_row_owid - title: Liberal democracy age group - description_short: Category of liberal democracies based on the country's age of liberal democracy. - description_processing: Number of consecutive years in liberal democracy. - description_key: *description_key_num_libdem - unit : '' - - wom_parl_vdem_cat: # wom_parl_gr_vdem_owid - title: Women in parliament (category) - description_short: Categorisation of women's political representation in parliament - unit: '' - - # Not used - regime_imputed: - title: Data imputed from another country - description_short: Denotes whether we imputed regime information from another country this one was historically a part of. - unit: '' - display: - numDecimalPlaces: 0 - - regime_row_owid: - title: regime_row_owid - unit: '' - display: - numDecimalPlaces: 0 diff --git a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py index 3d7ef032707..9eb9c77d855 100644 --- a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py @@ -12,9 +12,12 @@ def run(dest_dir: str) -> None: # # Load garden dataset. ds_garden = paths.load_dataset("vdem") + ds_garden2 = paths.load_dataset("vdem_2") # Read table from garden dataset. tb = ds_garden["vdem"] + # tb_num_countries = ds_garden2["vdem_num_countries"] + # tb_population = ds_garden2["vdem_population"] # # Process data. @@ -34,8 +37,13 @@ def run(dest_dir: str) -> None: # Save outputs. # # Create a new grapher dataset with the same metadata as the garden dataset. + tables = [ + tb, + # tb_num_countries, + # tb_population, + ] ds_grapher = create_dataset( - dest_dir, tables=[tb], check_variables_metadata=True, default_metadata=ds_garden.metadata + dest_dir, tables=tables, check_variables_metadata=True, default_metadata=ds_garden.metadata ) # Save changes in the new grapher dataset. From 2b24aa624a65a047fa064b65b7f3e0fc5bd9ba89 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 02:18:20 +0200 Subject: [PATCH 33/62] hotfix --- etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py index 8bd5b6e2479..ea0b24c6141 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py @@ -19,7 +19,7 @@ def run(tb: Table) -> Table: ) tb_ = cast(Table, tb_) - return tb + return tb_ def add_years_in_democracy(tb: Table) -> Table: From 06f59ea89afd6bc2d3acc885b159233027f4a3ba Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 02:19:36 +0200 Subject: [PATCH 34/62] ci/cd --- .../data/garden/democracy/2024-03-07/vdem_aggregate.py | 6 +++--- etl/steps/data/grapher/democracy/2024-03-07/vdem.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py index a08bad03475..f8f5674cbd1 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py @@ -8,7 +8,7 @@ from shared import add_population_in_dummies, expand_observations, from_wide_to_long from etl.data_helpers import geo -from etl.helpers import PathFinder, create_dataset +from etl.helpers import PathFinder # Get paths and naming conventions for current step. paths = PathFinder(__file__) @@ -167,7 +167,7 @@ def make_table_countries_avg(tb: Table, ds_regions: Dataset) -> Table: tb_ = add_regions_and_global_aggregates( tb=tb_, ds_regions=ds_regions, - aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, + aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, # type: ignore ) # Sanity check on output shape @@ -317,7 +317,7 @@ def make_table_population_avg(tb: Table, ds_regions: Dataset, ds_population: Dat tb_ = add_regions_and_global_aggregates( tb=tb_, ds_regions=ds_regions, - aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, + aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, # type: ignore ) # Rename columns diff --git a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py index 9eb9c77d855..0099c78beaf 100644 --- a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py @@ -12,7 +12,7 @@ def run(dest_dir: str) -> None: # # Load garden dataset. ds_garden = paths.load_dataset("vdem") - ds_garden2 = paths.load_dataset("vdem_2") + # ds_garden2 = paths.load_dataset("vdem_2") # Read table from garden dataset. tb = ds_garden["vdem"] From bcf931825aac241fd423ac8a44a87ee552ba9a9a Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 02:21:24 +0200 Subject: [PATCH 35/62] hotfix --- .../garden/democracy/2024-03-07/vdem.meta.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml index 8b10470e5c3..59e2372e64a 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml @@ -1270,25 +1270,12 @@ tables: display: numDecimalPlaces: 3 - ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index - lib_dich_row: - title: Liberal political institutions (<< estimate >> estimate) (re-estimate) - description_short: << estimate.title() >> estimate of whether the country has meaningfully liberal political institutions - description_from_producer: *description_prod_lib_vdem - description_processing: |- - We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). - - {definitions.auxiliary.description_processing_row} - unit: '' - display: - numDecimalPlaces: 0 - ## 2.2.8 Liberal component index lib_vdem: title: Liberal component index (<< estimate >> estimate) description_short: |- << estimate.title() >> estimate of the extent of individual and minority rights, equality before the law, and executive constraints. - description_from_producer: |- + description_from_producer: &description_prod_lib_vdem |- Question: To what extent is the liberal principle of democracy achieved? Clarification: The liberal principle of democracy emphasizes the importance of protecting individual and minority rights against the tyranny of the state and the tyranny of the majority. The liberal model takes a "negative" view of political power insofar as it judges the quality of democracy by the limits placed on government. This is achieved by constitutionally protected civil liberties, strong rule of law, an independent judiciary, and effective checks and balances that, together, limit the exercise of executive power. @@ -1300,6 +1287,19 @@ tables: display: numDecimalPlaces: 3 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index + lib_dich_row: + title: Liberal political institutions (<< estimate >> estimate) (re-estimate) + description_short: << estimate.title() >> estimate of whether the country has meaningfully liberal political institutions + description_from_producer: *description_prod_lib_vdem + description_processing: |- + We employ Lührmann et al.'s criteria and use a threshold of 0.8 to classify the original indicator (`v2x_liberal*`) into two categories: 0 ("No") and 1 ("Yes"). + + {definitions.auxiliary.description_processing_row} + unit: '' + display: + numDecimalPlaces: 0 + ## 2.2.15 Local government index locelect_vdem: title: Elected local governments (<< estimate >> estimate) From 31a7adae081aaee505a11bfa76023d8d9ba5fd82 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 14:57:07 +0200 Subject: [PATCH 36/62] hotfix: population-weight --- etl/steps/data/garden/democracy/2024-03-07/shared.py | 8 ++++++-- .../data/garden/democracy/2024-03-07/vdem_aggregate.py | 9 ++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/shared.py b/etl/steps/data/garden/democracy/2024-03-07/shared.py index a031393d587..8c484ec8d40 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/shared.py +++ b/etl/steps/data/garden/democracy/2024-03-07/shared.py @@ -89,7 +89,10 @@ def expand_observations(tb: Table) -> Table: def add_population_in_dummies( - tb: Table, ds_population: Dataset, expected_countries_without_population: Optional[List[str]] = None + tb: Table, + ds_population: Dataset, + expected_countries_without_population: Optional[List[str]] = None, + drop_population: bool = True, ): # Add population column tb = geo.add_population_to_table( @@ -104,7 +107,8 @@ def add_population_in_dummies( meta = {col: tb[col].metadata for col in cols} | {"population": tb["population"].metadata} ## Encode population in indicators: Population if 1, 0 otherwise tb[cols] = tb[cols].multiply(tb["population"], axis=0) - tb = tb.drop(columns="population") + if drop_population: + tb = tb.drop(columns="population") ## Add metadata back (combine origins from population) for col in cols: metadata = meta[col] diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py index f8f5674cbd1..ff9b4bc4375 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py @@ -311,15 +311,22 @@ def make_table_population_avg(tb: Table, ds_regions: Dataset, ds_population: Dat "Democratic Republic of Vietnam", "Republic of Vietnam", ], + drop_population=False, ) # Get region aggregates tb_ = add_regions_and_global_aggregates( tb=tb_, ds_regions=ds_regions, - aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, # type: ignore + aggregations={k: "sum" for k in INDICATORS_REGION_AVERAGES} | {"population": "sum"}, # type: ignore ) + # Normalize by region's populatino + columns_index = ["year", "country"] + columns_indicators = [col for col in tb_.columns if col not in columns_index + ["population"]] + tb_[columns_indicators] = tb_[columns_indicators].div(tb_["population"], axis=0) + tb_ = tb_.drop(columns="population") + # Rename columns # tb_ = tb_.rename(columns={col: f"popw_{col}" for col in INDICATORS_REGION_AVERAGES}) # Sanity check on output shape From 702b4366098ce951ed0a57cc8bfd6ae6e6c781f7 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 17:54:54 +0200 Subject: [PATCH 37/62] wip --- .../2024-03-07/{vdem.py => vdem/__init__.py} | 152 ++++++++++-------- .../democracy/2024-03-07/vdem/shared.py | 118 ++++++++++++++ .../2024-03-07/{ => vdem}/vdem.countries.json | 0 .../{ => vdem}/vdem.countries_impute.yml | 0 .../{ => vdem}/vdem.excluded_countries.json | 0 .../2024-03-07/{ => vdem}/vdem.meta.yml | 150 ++++++++++------- .../2024-03-07/{ => vdem}/vdem_aggregate.py | 4 +- .../2024-03-07/{ => vdem}/vdem_clean.py | 0 .../2024-03-07/{ => vdem}/vdem_impute.py | 0 .../2024-03-07/{ => vdem}/vdem_refine.py | 0 .../data/grapher/democracy/2024-03-07/vdem.py | 45 ++++-- 11 files changed, 323 insertions(+), 146 deletions(-) rename etl/steps/data/garden/democracy/2024-03-07/{vdem.py => vdem/__init__.py} (61%) create mode 100644 etl/steps/data/garden/democracy/2024-03-07/vdem/shared.py rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.countries.json (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.countries_impute.yml (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.excluded_countries.json (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem.meta.yml (95%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem_aggregate.py (99%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem_clean.py (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem_impute.py (100%) rename etl/steps/data/garden/democracy/2024-03-07/{ => vdem}/vdem_refine.py (100%) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py similarity index 61% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 3e2fb219c9b..6b02ec7da86 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -51,6 +51,20 @@ }, "Oceania": {}, } +# INDICATORS THAT FOR SOME UNKNOWN REASON HAVE LOST THEIR ORIGINS DURING THE PROCESSING +INDICATORS_NO_ORIGINS = [ + "regime_row_owid", + "regime_amb_row_owid", + "regime_redux_row_owid", + "wom_hoe_vdem", + "regime_imputed", + "num_years_in_electdem_consecutive", + "num_years_in_libdem_consecutive", + "num_years_in_electdem", + "num_years_in_libdem", + "num_years_in_electdem_cat", + "num_years_in_libdem_cat", +] def run(dest_dir: str) -> None: @@ -114,7 +128,7 @@ def run(dest_dir: str) -> None: tables = [ # Main indicators (uni-dimensional) - tb_uni, + tb_uni, # some have 0 origins # Main indicators (multi-dimensional) without regions tb_multi_without_regions, # Main indicators (multi-dimensional) with regions @@ -125,18 +139,23 @@ def run(dest_dir: str) -> None: tb_population_counts, ] - # Add origins in case any was lost, adjust citation full + # %% Add origins in case any was lost, adjust citation full for tb in tables: - columns = [col for col in tb.columns if col not in ["country", "year"]] - for col in columns: - tb[col].metadata.origins = deepcopy(origins) + for col in tb.columns: + if col in INDICATORS_NO_ORIGINS: + assert ( + len(tb[col].metadata.origins) == 0 + ), f"No origins expected for indicator {col} in table {tb.m.short_name}" + tb[col].metadata.origins = origins + if len(tb[col].metadata.origins) == 0: + raise ValueError(f"No source for indicator {col} in table {tb.m.short_name}") # %% Save # # Save outputs. # # Tweak citation full for some indicators - # tb = adjust_citation_full(tb.copy()) + tb = adjust_citation_full(tb.copy()) # %% Set index # tb = tb.format() @@ -179,55 +198,55 @@ def append_citation_full(tb: Table) -> Table: CITATION_SUNDSTROM = "Sundström et al. (2017, V-Dem Working Paper Series 2017:19)" CITATION_TEORELL = "Teorell et al. (2019)" CITATION_LUHRMANN = "Lührmann, Anna, Marcus Tannnberg, and Staffan Lindberg. 2018. Regimes of the World (RoW): Opening New Avenues for the Comparative Study of Political Regimes. Politics and Governance 6(1): 60-77." - DIMENSIONS = ["", "_low", "_high"] + citation_coppedge = [ - *[f"libdem_vdem{dim}" for dim in DIMENSIONS], - *[f"participdem_vdem{dim}" for dim in DIMENSIONS], - *[f"delibdem_vdem{dim}" for dim in DIMENSIONS], - *[f"lib_vdem{dim}" for dim in DIMENSIONS], - *[f"particip_vdem{dim}" for dim in DIMENSIONS], - *[f"delib_vdem{dim}" for dim in DIMENSIONS], + "libdem_vdem", + "participdem_vdem", + "delibdem_vdem", + "lib_vdem", + "particip_vdem", + "delib_vdem", # row indicators - *[f"lib_dich{dim}_row" for dim in DIMENSIONS], + "lib_dich_row", ] citation_pemstein = [ - *[f"freeexpr_vdem{dim}" for dim in DIMENSIONS], - *[f"freeassoc_vdem{dim}" for dim in DIMENSIONS], - *[f"electfreefair_vdem{dim}" for dim in DIMENSIONS], - *[f"indiv_libs_vdem{dim}" for dim in DIMENSIONS], - *[f"judicial_constr_vdem{dim}" for dim in DIMENSIONS], - *[f"legis_constr_vdem{dim}" for dim in DIMENSIONS], - *[f"civsoc_particip_vdem{dim}" for dim in DIMENSIONS], - *[f"corr_leg_vdem{dim}" for dim in DIMENSIONS], - *[f"justified_polch_vdem{dim}" for dim in DIMENSIONS], - *[f"justcomgd_polch_vdem{dim}" for dim in DIMENSIONS], - *[f"counterarg_polch_vdem{dim}" for dim in DIMENSIONS], - *[f"elitecons_polch_vdem{dim}" for dim in DIMENSIONS], - *[f"soccons_polch_vdem{dim}" for dim in DIMENSIONS], - *[f"corr_jud_vdem{dim}" for dim in DIMENSIONS], - *[f"public_admin_vdem{dim}" for dim in DIMENSIONS], - *[f"socgr_civ_libs_vdem{dim}" for dim in DIMENSIONS], - *[f"dom_auton_vdem{dim}" for dim in DIMENSIONS], - *[f"int_auton_vdem{dim}" for dim in DIMENSIONS], - *[f"socgr_pow_vdem{dim}" for dim in DIMENSIONS], - *[f"priv_libs_vdem{dim}" for dim in DIMENSIONS], - *[f"pol_libs_vdem{dim}" for dim in DIMENSIONS], + "freeexpr_vdem", + "freeassoc_vdem", + "electfreefair_vdem", + "indiv_libs_vdem", + "judicial_constr_vdem", + "legis_constr_vdem", + "civsoc_particip_vdem", + "corr_leg_vdem", + "justified_polch_vdem", + "justcomgd_polch_vdem", + "counterarg_polch_vdem", + "elitecons_polch_vdem", + "soccons_polch_vdem", + "corr_jud_vdem", + "public_admin_vdem", + "socgr_civ_libs_vdem", + "dom_auton_vdem", + "int_auton_vdem", + "socgr_pow_vdem", + "priv_libs_vdem", + "pol_libs_vdem", # row indicators - *[f"transplaws{dim}_row" for dim in DIMENSIONS], - *[f"accessjust_w{dim}_row" for dim in DIMENSIONS], - *[f"accessjust_m{dim}_row" for dim in DIMENSIONS], - *[f"electfreefair{dim}_row" for dim in DIMENSIONS], - *[f"electmulpar{dim}_row" for dim in DIMENSIONS], + "transplaws_row", + "accessjust_w_row", + "accessjust_m_row", + "electfreefair_row", + "electmulpar_row", ] citation_mcmann = [ - *[f"corruption_vdem{dim}" for dim in DIMENSIONS], - *[f"corr_publsec_vdem{dim}" for dim in DIMENSIONS], - *[f"corr_exec_vdem{dim}" for dim in DIMENSIONS], + "corruption_vdem", + "corr_publsec_vdem", + "corr_exec_vdem", ] citation_teorell = [ - *[f"electdem_vdem{dim}" for dim in DIMENSIONS], + "electdem_vdem", # row indicators - *[f"electdem_dich{dim}_row_owid" for dim in DIMENSIONS], + "electdem_dich_row_owid", ] citation_full = { @@ -237,37 +256,36 @@ def append_citation_full(tb: Table) -> Table: **{i: CITATION_MCMANN for i in citation_mcmann}, **{i: CITATION_TEORELL for i in citation_teorell}, ## - **{f"egaldem_vdem{dim}": CITATION_SIGMAN for dim in DIMENSIONS}, - **{f"wom_emp_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, - **{f"wom_pol_par_vdem{dim}": CITATION_SUNDSTROM for dim in DIMENSIONS}, + "egaldem_vdem": CITATION_SIGMAN, + "wom_emp_vdem": CITATION_SUNDSTROM, + "wom_pol_par_vdem": CITATION_SUNDSTROM, # Combined citations - **{f"egal_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_COPPEDGE}" for dim in DIMENSIONS}, - **{f"equal_rights_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, - **{f"equal_access_vdem{dim}": f"Sigman and Lindberg (2017);\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + "egal_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_COPPEDGE}", + "equal_rights_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}", + "equal_access_vdem{dim}": f"Sigman and Lindberg (2017);\n\n {CITATION_PEMSTEIN}", ## - **{f"equal_res_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, - **{ - f"personalism_vdem{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}" - for dim in DIMENSIONS - }, - **{f"wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, - **{f"wom_civ_soc_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}" for dim in DIMENSIONS}, + "equal_res_vdem{dim}": f"{CITATION_SIGMAN};\n\n {CITATION_PEMSTEIN}", + "personalism_vdem{dim}": "Sigman and Lindberg (2017, V-Dem Working Paper Series 2017:56); Sigman and Lindberg (2018); {CITATION_PEMSTEIN}", + "wom_civ_libs_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}", + "wom_civ_soc_vdem{dim}": f"{CITATION_SUNDSTROM};\n\n {CITATION_PEMSTEIN}", } + citation_full = {col: citation for col, citation in citation_full.items() if col in tb.columns} for indicator_name, citation_additional in citation_full.items(): tb[indicator_name].metadata.origins[0].citation_full += f";\n\n{citation_additional}" # Add citation for Luhrmann (at the beginning of the citation full) citation_luhrmann = [ - *[f"transplaws{dim}_row" for dim in DIMENSIONS], - *[f"accessjust_w{dim}_row" for dim in DIMENSIONS], - *[f"accessjust_m{dim}_row" for dim in DIMENSIONS], - *[f"lib_dich{dim}_row" for dim in DIMENSIONS], - *[f"electfreefair{dim}_row" for dim in DIMENSIONS], - *[f"electdem_dich{dim}_row_owid" for dim in DIMENSIONS], - *[f"electmulpar{dim}_row" for dim in DIMENSIONS], - *[f"electmulpar_hoe{dim}_row_owid" for dim in DIMENSIONS], - *[f"electmulpar_leg{dim}_row" for dim in DIMENSIONS], + "transplaws_row", + "accessjust_w_row", + "accessjust_m_row", + "lib_dich_row", + "electfreefair_row", + "electdem_dich_row_owid", + "electmulpar_row", + "electmulpar_hoe_row_owid", + "electmulpar_leg_row", ] + citation_luhrmann = [col for col in citation_luhrmann if col in tb.columns] for indicator_name in citation_luhrmann: tb[indicator_name].metadata.origins[0].citation_full = ( f"{CITATION_LUHRMANN};\n\n" + tb[indicator_name].metadata.origins[0].citation_full diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/shared.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/shared.py new file mode 100644 index 00000000000..8c484ec8d40 --- /dev/null +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/shared.py @@ -0,0 +1,118 @@ +from typing import Callable, List, Optional, cast + +import numpy as np +import pandas as pd +from owid.catalog import Dataset, Table + +from etl.data_helpers import geo + + +def from_wide_to_long( + tb: Table, + indicator_name_callback: Optional[Callable] = None, + indicator_category_callback: Optional[Callable] = None, + column_dimension_name: str = "category", +) -> Table: + """Format a particular shape of table from wide to long format. + + tb: Table with wide format. + indicator_name_callback: Function to extract the indicator name from the column name. + indicator_category_callback: Function to extract the indicator category from the column name. + + If no `indicator_name_callback` and `indicator_category_callback` are provided, it proceed expects the following input: + + | year | country | indicator_a_1 | indicator_a_2 | indicator_b_1 | indicator_b_2 | + |------|---------|---------------|---------------|---------------|---------------| + | 2000 | USA | 1 | 2 | 3 | 4 | + | 2000 | CAN | 5 | 6 | 7 | 8 | + + and then generates the output: + + | year | country | category | indicator_a | indicator_b | + |------|---------|------------|-------------|-------------| + | 2000 | USA | category_1 | 1 | 3 | + | 2000 | USA | category_2 | 2 | 4 | + """ + # Melt the DataFrame to long format + tb = tb.melt(id_vars=["year", "country"], var_name="indicator_type", value_name="value") + + # Get callables + if indicator_name_callback is None: + + def default_indicator_name(x): + return "_".join(x.split("_")[:-1]) + + indicator_name_callback = default_indicator_name + + if indicator_category_callback is None: + + def default_indicator_category(x): + return x.split("_")[-1] + + indicator_category_callback = default_indicator_category + + # Extract indicator names and types + tb["indicator"] = tb["indicator_type"].apply(indicator_name_callback) + tb[column_dimension_name] = tb["indicator_type"].apply(indicator_category_callback) + + # Drop the original 'indicator_type' column as it's no longer needed + tb.drop("indicator_type", axis=1, inplace=True) + + # Pivot the table to get 'indicator_a' and 'indicator_b' as separate columns + tb = tb.pivot(index=["year", "country", column_dimension_name], columns="indicator", values="value").reset_index() + + # Rename the columns to match your requirements + tb.columns.name = None # Remove the hierarchy + + return tb + + +def expand_observations(tb: Table) -> Table: + """Expand to have a row per (year, country).""" + # Add missing years for each triplet ("warcode", "campcode", "ccode") + + # List of countries + regions = set(tb["country"]) + + # List of possible years + years = np.arange(tb["year"].min(), tb["year"].max() + 1) + + # New index + new_idx = pd.MultiIndex.from_product([years, regions], names=["year", "country"]) + + # Reset index + tb = tb.set_index(["year", "country"]).reindex(new_idx).reset_index() + + # Type of `year` + tb["year"] = tb["year"].astype("int") + return tb + + +def add_population_in_dummies( + tb: Table, + ds_population: Dataset, + expected_countries_without_population: Optional[List[str]] = None, + drop_population: bool = True, +): + # Add population column + tb = geo.add_population_to_table( + tb, + ds_population, + interpolate_missing_population=True, + expected_countries_without_population=expected_countries_without_population, + ) + tb = cast(Table, tb.dropna(subset="population")) + # Add metadata (origins combined indicator+population) + cols = [col for col in tb.columns if col not in ["year", "country", "population"]] + meta = {col: tb[col].metadata for col in cols} | {"population": tb["population"].metadata} + ## Encode population in indicators: Population if 1, 0 otherwise + tb[cols] = tb[cols].multiply(tb["population"], axis=0) + if drop_population: + tb = tb.drop(columns="population") + ## Add metadata back (combine origins from population) + for col in cols: + metadata = meta[col] + metadata.origins += meta["population"].origins + tb[col].metadata = meta[col] + + return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.countries.json rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.countries_impute.yml rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.excluded_countries.json rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.excluded_countries.json diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml similarity index 95% rename from etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 59e2372e64a..0648d3bcb00 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -283,37 +283,19 @@ tables: ################################################################################################## # TABLE: MULTI-DIMENSIONAL TABLES, WITH REGIONS vdem_multi_with_regions: + common: + description_processing: |- + <% if aggregate_method == 'average' %> + The regional aggregates (including values for World) have been estimated by averaging the country values. + <% elif aggregate_method < 'population-weighted average' %> + The regional aggregates (including values for World) have been estimated by averaging the country values weighed by popupalation. $\alpha$. The population values are from the UN WPP 2022 revision dataset. + <% endif %> variables: - ## 3.6.0.5 Engaged society - soccons_polch_vdem: - title: Engaged society (<< estimate >> estimate) - description_short: |- - << estimate.title() >> estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. - description_from_producer: |- - Question: When important policy changes are being considered, how wide and how independent are public deliberations? - - Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. - - Responses: - 0: Public deliberation is never, or almost never allowed. - 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. - 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. - 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. - 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. - 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. - - Scale: Ordinal, converted to interval by the measurement model. - - Indicator name: `v2dlengage` - unit: '' - display: - numDecimalPlaces: 3 - # 2.1 V-Dem High-Level Democracy Indices ## 2.1.1 Electoral democracy index electdem_vdem: title: |- - Electoral democracy index (<< estimate >> estimate) + Electoral democracy index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: &description_prod_electdem_vdem |- @@ -330,7 +312,7 @@ tables: ## 2.1.2 Liberal democracy index libdem_vdem: title: |- - Liberal democracy index (<< estimate >> estimate) + Liberal democracy index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, individual and minority rights, equality before the law, and executive constraints. description_from_producer: |- @@ -347,7 +329,8 @@ tables: # 2.1.3 Participatory democracy index participdem_vdem: - title: Extent of direct popular votes (<< estimate >> estimate) + title: |- + Extent of direct popular votes (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which citizens can engage in regional and local government, civil society organizations, and direct democracy. description_from_producer: |- @@ -364,7 +347,8 @@ tables: ## 2.1.4 Deliberative democracy index delibdem_vdem: - title: Deliberative democracy index (<< estimate >> estimate) + title: |- + Deliberative democracy index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which political elites justify their positions, justify them with the common good, acknowledge counterarguments, consult elites in policy changes, and society deliberates policy changes. description_from_producer: |- @@ -382,7 +366,8 @@ tables: ## 2.2.18 Egalitarian component index egal_vdem: - title: Egalitarian political institutions index (<< estimate >> estimate) + title: |- + Egalitarian political institutions index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: |- @@ -399,7 +384,8 @@ tables: ## 3.5.1.6 Legislature corrupt activities corr_leg_vdem: - title: Legislative corruption (<< estimate >> estimate) + title: |- + Legislative corruption (<< estimate >> estimate, aggregate: << aggregate_method >>) description_from_producer: |- Question: Do members of the legislature abuse their position for financial gain? @@ -424,7 +410,8 @@ tables: ## 3.5.3.7 Lower chamber female legislators wom_parl_vdem: - title: Lower chamber female legislators + title: |- + Lower chamber female legislators (aggregate: << aggregate_method >>) description_short: |- Percentage of women in the lower or single chamber of the legislature. description_from_producer: |- @@ -435,12 +422,10 @@ tables: display: numDecimalPlaces: 3 - - - ## 3.7.0.6 Judicial corruption decision corr_jud_vdem: - title: Judicial corruption (<< estimate >> estimate) + title: |- + Judicial corruption (<< estimate >> estimate, aggregate: << aggregate_method >>) description_from_producer: |- Question: How often do individuals or businesses make undocumented extra payments or bribes in order to speed up or delay the process or to obtain a favorable judicial decision? @@ -461,7 +446,8 @@ tables: ## 3.8.2.2 Rigorous and impartial public administration public_admin_vdem: - title: Rigorous and impartial public administration (<< estimate >> estimate) + title: |- + Rigorous and impartial public administration (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which public officials respect the law, and administer it without arbitrariness and bias. description_from_producer: |- @@ -488,7 +474,8 @@ tables: ## 3.8.2.6 Social group equality in respect for civil liberties socgr_civ_libs_vdem: - title: Equality of civil liberties across social groups (<< estimate >> estimate) + title: |- + Equality of civil liberties across social groups (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are free from forced labor, have property rights and access to the justice system, and enjoy freedoms of movement. description_from_producer: |- @@ -510,7 +497,8 @@ tables: ## 3.9.0.1 Domestic autonomy dom_auton_vdem: - title: Domestic policymaking free from foreign influence (<< estimate >> estimate) + title: |- + Domestic policymaking free from foreign influence (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which domestic policy is free from the interference of other states. description_from_producer: |- @@ -532,7 +520,8 @@ tables: ## 3.9.0.2 International autonomy int_auton_vdem: - title: Foreign policymaking free from foreign influence (<< estimate >> estimate) + title: |- + Foreign policymaking free from foreign influence (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which foreign policy is free from the interference of other states. description_from_producer: |- @@ -550,7 +539,8 @@ tables: ## 3.9.0.3 State authority over territory terr_contr_vdem: - title: Territory under state control (<< estimate >> estimate) + title: |- + Territory under state control (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the percentage of territory controlled by the government. description_from_producer: |- @@ -568,7 +558,8 @@ tables: ## 3.12.0.2 Power distributed by social group socgr_pow_vdem: - title: Equality of political power across social groups (<< estimate >> estimate) + title: |- + Equality of political power across social groups (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which social groups — defined by language, ethnicity, religion, race, region, and/or caste — are irrelevant to politics, or have similar political power. description_from_producer: |- @@ -590,7 +581,8 @@ tables: ## 5.4.3 Presidentialism Index personalism_vdem: - title: Presidentialism Index (<< estimate >> estimate) + title: |- + Presidentialism index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which the executive is unconstrained by the legislature, judiciary, electoral managementbody, and other oversight. description_from_producer: |- @@ -608,9 +600,10 @@ tables: ## 5.5.1 Civil liberties index civ_libs_vdem: - title: Civil liberties index (<< estimate >> estimate) + title: |- + Civil liberties index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- - Central estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. + << estimate.title() >> estimate of the extent to which people are free from government torture, political killings, and forced labor, they have property rights, and enjoy the freedoms of movement, religion, expression, and association. description_from_producer: |- Question: To what extent is civil liberty respected? @@ -625,9 +618,10 @@ tables: ## 5.5.4 Private civil liberties index priv_libs_vdem: - title: Private civil liberties index (<< estimate >> estimate) + title: |- + Private civil liberties index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- - Central estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. + << estimate.title() >> estimate of the extent to which people are free from forced labor, have property rights, and enjoy the freedoms of movement and religion. description_from_producer: |- Question: To what extent are private liberties respected? @@ -642,9 +636,10 @@ tables: ## 5.5.3 Political civil liberties index pol_libs_vdem: - title: Political civil liberties index (<< estimate >> estimate) + title: |- + Political civil liberties index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- - Central estimate of the extent to which people enjoy the freedoms of expression and association. + << estimate.title() >> estimate of the extent to which people enjoy the freedoms of expression and association. description_from_producer: |- Question: To what extent are political liberties respected? @@ -659,9 +654,10 @@ tables: ## 5.5.2 Physical violence index phys_integr_libs_vdem: - title: Physical integrity liberties (<< estimate >> estimate) + title: |- + Physical violence index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- - Central estimate of the extent to which people are free from government torture and political killings. + << estimate.title() >> estimate of the extent to which people are free from government torture and political killings. description_from_producer: |- Question: To what extent is physical integrity respected? @@ -676,7 +672,8 @@ tables: ## 5.7.1 Political corruption index corruption_vdem: - title: Political corruption index (<< estimate >> estimate) + title: |- + Political corruption index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which a country is affected by political corruption. description_from_producer: |- @@ -693,7 +690,8 @@ tables: ## 5.7.3 Public sector corruption index [Not in use] corr_publsec_vdem: - title: Public sector corruption index (<< estimate >> estimate) + title: |- + Public sector corruption index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_from_producer: |- Question: To what extent do public sector employees grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? @@ -708,7 +706,8 @@ tables: ## 5.7.2 Executive corruption index [Not in use] corr_exec_vdem: - title: Executive corruption index (<< estimate >> estimate) + title: |- + Executive corruption index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_from_producer: |- Question: How routinely do members of the executive, or their agents grant favors in exchange for bribes, kickbacks, or other material inducements, and how often do they steal, embezzle, or misappropriate public funds or other state resources for personal or family use? @@ -723,7 +722,8 @@ tables: ## 5.8.1 Women political empowerment index wom_emp_vdem: - title: Women's political empowerment index (<< estimate >> estimate) + title: |- + Women's political empowerment index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which women enjoy civil liberties, can participate in civil society, and are represented in politics. description_from_producer: |- @@ -740,7 +740,8 @@ tables: ## 5.8.2 Women civil liberties index wom_civ_libs_vdem: - title: Women's civil rights index (<< estimate >> estimate) + title: |- + Women's civil rights index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which women are free from forced labor, have property rights and access to the justice system, and enjoy freedom of movement. description_from_producer: |- @@ -757,7 +758,8 @@ tables: ## 5.8.3 Women civil society participation index wom_civ_soc_vdem: - title: Women's civil society participation index (<< estimate >> estimate) + title: |- + Women's civil society participation index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which women can discuss political issues, participate in civil society organizations, and are represented among journalists. description_from_producer: |- @@ -774,7 +776,8 @@ tables: ## 5.8.4 Women political participation index wom_pol_par_vdem: - title: Women's political participation index (<< estimate >> estimate) + title: |- + Women's political participation index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which women are represented in the legislature and have an equal share of political power. description_from_producer: |- @@ -791,7 +794,8 @@ tables: ## 5.9.1 Rule of law index rule_of_law_vdem: - title: Rule of Law index (<< estimate >> estimate) + title: |- + Rule of Law index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- << estimate.title() >> estimate of the extent to which the government complies with the law, courts are independent, laws transparent, justice accessible, corruption absent, and the bureaucracy is impartial. description_from_producer: |- @@ -806,7 +810,8 @@ tables: ## 5.11.1 Core civil society index [not in use] civ_soc_str_vdem: - title: Core civil society index (<< estimate >> estimate) + title: |- + Core civil society index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_from_producer: |- Question: How robust is civil society? @@ -1352,6 +1357,31 @@ tables: display: numDecimalPlaces: 3 + ## 3.6.0.5 Engaged society + soccons_polch_vdem: + title: "Engaged society (<< estimate >> estimate)" + description_short: |- + << estimate.title() >> estimate of the extent to which ordinary people independently discuss considered important policy changes among themselves, in the media, in associations or neighborhoods, or in the streets. + description_from_producer: |- + Question: When important policy changes are being considered, how wide and how independent are public deliberations? + + Clarification: This question refers to deliberation as manifested in discussion, debate, and other public forums such as popular media. + + Responses: + 0: Public deliberation is never, or almost never allowed. + 1: Some limited public deliberations are allowed but the public below the elite levels is almost always either unaware of major policy debates or unable to take part in them. + 2: Public deliberation is not repressed but nevertheless infrequent and non-elite actors are typically controlled and/or constrained by the elites. + 3: Public deliberation is actively encouraged and some autonomous non-elite groups participate, but it is confined to a small slice of specialized groups that tends to be the same across issue-areas. + 4: Public deliberation is actively encouraged and a relatively broad segment of non-elite groups often participate and vary with different issue-areas. + 5: Large numbers of non-elite groups as well as ordinary people tend to discuss major policies among themselves, in the media, in associations or neighborhoods, or in the streets. Grass-roots deliberation is common and unconstrained. + + Scale: Ordinal, converted to interval by the measurement model. + + Indicator name: `v2dlengage` + unit: '' + display: + numDecimalPlaces: 3 + ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement transplaws_row: title: Transparent laws with predictable enforcement (<< estimate >> estimate) (re-estimate) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py similarity index 99% rename from etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index ff9b4bc4375..6557afc0775 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -92,7 +92,7 @@ def run(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Tuple[Table, tb_countries_counts, tb_countries_avg = make_table_countries(tb, ds_regions) # Create table with population-weighted averages - tb_population_counts, tb_population_avg = make_table_population(tb, ds_regions, ds_population) + tb_population_counts, tb_population_avg = make_table_population(tb, ds_regions, ds_population=ds_population) # Consolidate main table with additional regional aggregates tb_uni, tb_multi_without_regions, tb_multi_with_regions = make_main_tables(tb, tb_countries_avg, tb_population_avg) @@ -433,7 +433,7 @@ def make_main_tables(tb: Table, tb_countries_avg: Table, tb_population_avg: Tabl # Merge multi-dimensional table with region aggregates. # Since there are two ways of estimating the regional aggregates, we create two versions of the indicators tb_multi_with_regions["aggregate_method"] = "average" - tb_multi_with_regions_popw = tb_multi.copy() + tb_multi_with_regions_popw = tb_multi_with_regions.copy() tb_multi_with_regions_popw["aggregate_method"] = "population-weighted average" tb_countries_avg["aggregate_method"] = "average" tb_population_avg["aggregate_method"] = "population-weighted average" diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem_clean.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem_impute.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py similarity index 100% rename from etl/steps/data/garden/democracy/2024-03-07/vdem_refine.py rename to etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py diff --git a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py index 0099c78beaf..36d51219d12 100644 --- a/etl/steps/data/grapher/democracy/2024-03-07/vdem.py +++ b/etl/steps/data/grapher/democracy/2024-03-07/vdem.py @@ -1,5 +1,7 @@ """Load a garden dataset and create a grapher dataset.""" +from owid.catalog import Table + from etl.helpers import PathFinder, create_dataset # Get paths and naming conventions for current step. @@ -14,8 +16,11 @@ def run(dest_dir: str) -> None: ds_garden = paths.load_dataset("vdem") # ds_garden2 = paths.load_dataset("vdem_2") - # Read table from garden dataset. - tb = ds_garden["vdem"] + # Read tables + tables = {} + for tname in ds_garden.table_names: + tables[tname] = ds_garden[tname] + # tb_num_countries = ds_garden2["vdem_num_countries"] # tb_population = ds_garden2["vdem_population"] @@ -24,27 +29,33 @@ def run(dest_dir: str) -> None: # ## Special indicator values renamings ## We add labels for these indicators. Otherwise they'd have the value zero (which is correct). Labelling makes them more informative. - tb["num_years_in_electdem_consecutive"] = tb["num_years_in_electdem_consecutive"].astype("string") - tb.loc[tb["regime_row_owid"] == 0, "num_years_in_electdem_consecutive"] = "closed autocracy" - tb.loc[tb["regime_row_owid"] == 1, "num_years_in_electdem_consecutive"] = "electoral autocracy" - - tb["num_years_in_libdem_consecutive"] = tb["num_years_in_libdem_consecutive"].astype("string") - tb.loc[tb["regime_row_owid"] == 0, "num_years_in_libdem_consecutive"] = "closed autocracy" - tb.loc[tb["regime_row_owid"] == 1, "num_years_in_libdem_consecutive"] = "electoral autocracy" - tb.loc[tb["regime_row_owid"] == 2, "num_years_in_libdem_consecutive"] = "electoral democracy" - + tables["vdem"] = add_categories_to_counters(tables["vdem"]) # # Save outputs. # # Create a new grapher dataset with the same metadata as the garden dataset. - tables = [ - tb, - # tb_num_countries, - # tb_population, - ] + tables = list(tables.values()) + # tables = tables[:2] + tables[-2:] + + # Create grapher dataset ds_grapher = create_dataset( - dest_dir, tables=tables, check_variables_metadata=True, default_metadata=ds_garden.metadata + dest_dir, + tables=tables, + check_variables_metadata=True, + default_metadata=ds_garden.metadata, ) # Save changes in the new grapher dataset. ds_grapher.save() + + +def add_categories_to_counters(tb: Table) -> Table: + tb["num_years_in_electdem_consecutive"] = tb["num_years_in_electdem_consecutive"].astype("string") + tb.loc[tb["regime_row_owid"] == 0, "num_years_in_electdem_consecutive"] = "closed autocracy" + tb.loc[tb["regime_row_owid"] == 1, "num_years_in_electdem_consecutive"] = "electoral autocracy" + + tb["num_years_in_libdem_consecutive"] = tb["num_years_in_libdem_consecutive"].astype("string") + tb.loc[tb["regime_row_owid"] == 0, "num_years_in_libdem_consecutive"] = "closed autocracy" + tb.loc[tb["regime_row_owid"] == 1, "num_years_in_libdem_consecutive"] = "electoral autocracy" + tb.loc[tb["regime_row_owid"] == 2, "num_years_in_libdem_consecutive"] = "electoral democracy" + return tb From d27ef5eb68c592f9917c643d1b3431da042232f6 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 17:57:17 +0200 Subject: [PATCH 38/62] ci/cd --- etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 6b02ec7da86..3864e97cb4e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -1,6 +1,5 @@ """Load a meadow dataset and create a garden dataset.""" -from copy import deepcopy from typing import cast import vdem_aggregate as aggregate # VDEM's aggregating library From 77b35df3fa30badce152831f8b36880543549835 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 2 Apr 2024 18:14:48 +0200 Subject: [PATCH 39/62] hotfix bmr --- etl/steps/data/garden/democracy/2024-03-07/bmr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/bmr.py b/etl/steps/data/garden/democracy/2024-03-07/bmr.py index d5fa2440247..3b6ae183017 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/bmr.py +++ b/etl/steps/data/garden/democracy/2024-03-07/bmr.py @@ -445,7 +445,7 @@ def make_tables_population_counters(tb: Table, ds_regions: Dataset, ds_populatio # Add population in dummies (population value replaces 1, 0 otherwise) tb_ = add_population_in_dummies( - tb, + tb_, ds_population, expected_countries_without_population=[ "Pakistan (former)", From 0711d12a505fa3bb545b51e8c250e8763cb47300 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 3 Apr 2024 12:38:47 +0200 Subject: [PATCH 40/62] fix: widget key was duplicate --- apps/wizard/pages/charts/variable_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index e47b7a8d0fc..2577e37494b 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -274,7 +274,7 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": if search_form.enable_explore_mode: ## Explore mode checkbox element_check = grid_variables_manual.toggle( - "Explore", key=f"auto-explore-{i}", label_visibility="collapsed" + "Explore", key=f"manual-explore-{i}", label_visibility="collapsed" ) ## Explore mode plot with grid_variables_manual.container(): From dc63eee0df2c1aa3937e7f71f56471bd52bbf58e Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 3 Apr 2024 13:54:11 +0200 Subject: [PATCH 41/62] enhance regime indicator's metadata --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 0648d3bcb00..28189329bc5 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -230,6 +230,21 @@ tables: unit: '' ## Other regime indicators + regime_row_owid: + title: Political regime + description_short: |- + Identifies the political regime of a country by distinguishing between closed autocracies, electoral autocracies, electoral democracies, and liberal democracies. + unit: '' + description_key: + - The indicator uses the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. + - The classification distinguishes between closed autocracies (score 0), electoral autocracies (score 1), electoral democracies (score 2), and liberal democracies (score 3). + - In _closed autocracies_, citizens do not have the right to either choose the chief executive of the government or the legislature through multi-party elections. + - In _electoral autocracies_, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. + - In _electoral democracies_, citizens have the right to participate in meaningful, free and fair, and multi-party elections. + - In _liberal demoracies_, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. + display: + numDecimalPlaces: 0 + regime_amb_row_owid: title: Political regime (inc. ambiguous categories) unit: '' @@ -247,7 +262,7 @@ tables: numDecimalPlaces: 0 regime_redux_row_owid: - title: Political regime + title: Political regime (reduced) description_short: |- Identifies the political regime of a country using the Regimes of the World classification by political scientists Anna Lührmann, Marcus Tannenberg and Staffan Lindberg. description_key: @@ -260,13 +275,6 @@ tables: display: numDecimalPlaces: 0 - # Not used - regime_row_owid: - title: regime_row_owid - unit: '' - display: - numDecimalPlaces: 0 - # Not used regime_imputed: title: Data imputed from another country From 8a2f461de22736f8091139412ba2021d87ef5ca2 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Wed, 3 Apr 2024 15:36:06 +0200 Subject: [PATCH 42/62] fix imputes --- .../2024-03-07/vdem/vdem.countries.json | 2 +- .../2024-03-07/vdem/vdem.countries_impute.yml | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json index c023f48e791..3d7b2111284 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -194,7 +194,7 @@ "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", "The Gambia": "Gambia", "T\u00fcrkiye": "Turkey", - "W\u00fcrtemberg": "Wurttemberg", + "W\u00fcrtemberg": "Wuerttemberg", "Parma": "Parma", "Piedmont-Sardinia": "Piedmont-Sardinia", "Saxony": "Saxony", diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml index 2c0f3a82b34..dc4f7d85670 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries_impute.yml @@ -93,6 +93,20 @@ annotation: |- 1789-1824: Imperial power Spain 16th century - 1823 (Wimmer and Min 2006), independence in 1825 (Butcher and Griffiths 2020); I favor no imputation. +# BOSNIA +- country: Bosnia and Herzegovina + country_impute: Turkey + year_min: 1789 + year_max: 1878 + annotation: |- + Imperial power Turkey 15th century-1878. +- country: Bosnia and Herzegovina + country_impute: Serbia + year_min: 1919 + year_max: 1991 + annotation: |- + Austria-Hungary 1879-1917, Yugoslavia 1918-1990 (Wimmer and Min 2006); occupied by Austria-Hungary since at least 1886-1908, part of Austria-Hungary 1909-1918, part of Yugoslavia 1919-1992 (Cshapes 2.0); Austrian-Hungary occupation while formally still part of Ottoman Empire, not more associated with either Austria or Hungary (Encyclopedia Britannica); I therefore favor no imputation for 1909-1918. + # BULGARIA (1789-1877) - country: Bulgaria country_impute: Turkey @@ -395,10 +409,11 @@ # PAKISTAN (1789-1946) - country: Pakistan country_impute: India - year_min: 1947 - year_max: 1970 + year_min: 1839 + year_max: 1946 annotation: |- - 1947-1970 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016) + 1839-1946 imperial power United Kingdom (Wimmer and Min 2006), 1886-1947 part of colony India (Cshapes 2.0), colonized in 1849 (Ertan et al. 2016). + # PAPUA NEW GUINEA (1789-1899) - country: Papua New Guinea From b8d8d2f84bbba0c17c0b3724e2d7399ca556c754 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 4 Apr 2024 01:57:38 +0200 Subject: [PATCH 43/62] fix unstandardised name --- .../data/garden/democracy/2024-03-07/vdem/vdem.countries.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json index 3d7b2111284..c023f48e791 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.countries.json @@ -194,7 +194,7 @@ "Saxe-Weimar-Eisenach": "Saxe-Weimar-Eisenach", "The Gambia": "Gambia", "T\u00fcrkiye": "Turkey", - "W\u00fcrtemberg": "Wuerttemberg", + "W\u00fcrtemberg": "Wurttemberg", "Parma": "Parma", "Piedmont-Sardinia": "Piedmont-Sardinia", "Saxony": "Saxony", From 76e4b854edde88f3593199644c844bd0fb770fcf Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 4 Apr 2024 02:05:39 +0200 Subject: [PATCH 44/62] fix world aggregate --- .../2024-03-07/vdem/vdem_aggregate.py | 16 ++++++++++--- .../democracy/2024-03-07/vdem/vdem_clean.py | 24 ++++++++----------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index 6557afc0775..91c0426789a 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -2,6 +2,7 @@ from itertools import chain from typing import Dict, Optional, Tuple, cast +import numpy as np import pandas as pd from owid.catalog import Dataset, Table from owid.catalog.processing import concat @@ -115,7 +116,9 @@ def make_table_countries(tb: Table, ds_regions: Dataset) -> Tuple[Table, Table]: members_tracked |= set( geo.list_members_of_region(region, ds_regions, additional_members=region_props.get("additional_members")) ) - assert tb_["country"].isin(members_tracked).all(), "Some countries are not in the regions!" + countries_found = set(tb_["country"]) + countries_nottracked = countries_found - members_tracked + assert not countries_nottracked, f"Some countries are not in the regions: {countries_nottracked}!" # Generate counts of countries in X category tb_sum = make_table_countries_counts(tb_, ds_regions) @@ -168,6 +171,7 @@ def make_table_countries_avg(tb: Table, ds_regions: Dataset) -> Table: tb=tb_, ds_regions=ds_regions, aggregations={k: "mean" for k in INDICATORS_REGION_AVERAGES}, # type: ignore + aggregations_world={k: np.mean for k in INDICATORS_REGION_AVERAGES}, # type: ignore ) # Sanity check on output shape @@ -504,7 +508,10 @@ def _add_note_on_region_averages(tb: Table) -> Table: # %% OTHERS def add_regions_and_global_aggregates( - tb: Table, ds_regions: Dataset, aggregations: Optional[Dict[str, str]] = None + tb: Table, + ds_regions: Dataset, + aggregations: Optional[Dict[str, str]] = None, + aggregations_world: Optional[Dict[str, str]] = None, ) -> Table: """Add regions, and world aggregates.""" tb = geo.add_regions_to_table( @@ -516,7 +523,10 @@ def add_regions_and_global_aggregates( tb = tb.loc[tb["country"].isin(REGIONS.keys())] # Add world - tb_w = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") + if aggregations_world is None: + tb_w = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") + else: + tb_w = tb.groupby("year", as_index=False).agg(aggregations_world).assign(country="World") tb = concat([tb, tb_w], ignore_index=True, short_name="region_counts") return tb diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py index 6d3422f4b38..f9f48d6999e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_clean.py @@ -412,20 +412,18 @@ def estimate_row_indicators(tb: Table) -> Table: # Replace regime_row_owid based on conditions tb.loc[ - (tb["v2elfrfair_osp_dich"] == 1) - & (tb["v2elmulpar_osp_dich"] == 1) - & (tb["v2x_polyarchy_dich"] == 1) - & (tb["v2x_liberal_dich"] == 1) - & (tb["v2clacjstm_osp_dich"] == 1) - & (tb["v2clacjstw_osp_dich"] == 1) - & (tb["v2cltrnslw_osp_dich"] == 1), + ((tb["v2elfrfair_osp_dich"] == 1) & (tb["v2elmulpar_osp_dich"] == 1) & (tb["v2x_polyarchy_dich"] == 1)) + & ( + (tb["v2x_liberal_dich"] == 1) + & (tb["v2clacjstm_osp_dich"] == 1) + & (tb["v2clacjstw_osp_dich"] == 1) + & (tb["v2cltrnslw_osp_dich"] == 1) + ), column_new, ] = 3 tb.loc[ - (tb["v2elfrfair_osp_dich"] == 1) - & (tb["v2elmulpar_osp_dich"] == 1) - & (tb["v2x_polyarchy_dich"] == 1) + ((tb["v2elfrfair_osp_dich"] == 1) & (tb["v2elmulpar_osp_dich"] == 1) & (tb["v2x_polyarchy_dich"] == 1)) & ( (tb["v2x_liberal_dich"] == 0) | (tb["v2clacjstm_osp_dich"] == 0) @@ -437,8 +435,7 @@ def estimate_row_indicators(tb: Table) -> Table: tb.loc[ ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) - & (tb["v2elmulpar_osp_hoe"] == 1) - & (tb["v2elmulpar_osp_leg_dich"] == 1), + & ((tb["v2elmulpar_osp_hoe"] == 1) & (tb["v2elmulpar_osp_leg_dich"] == 1)), column_new, ] = 1 @@ -461,8 +458,7 @@ def estimate_row_indicators(tb: Table) -> Table: # This also means that if one criteria for electoral democracy is not met, yet both criteria for an electoral autocracy is met, it must be an electoral autocracy tb.loc[ ((tb["v2elfrfair_osp_dich"] == 0) | (tb["v2elmulpar_osp_dich"] == 0) | (tb["v2x_polyarchy_dich"] == 0)) - & (tb["v2elmulpar_osp_hoe"] == 1) - & (tb["v2elmulpar_osp_leg_dich"] == 1) + & ((tb["v2elmulpar_osp_hoe"] == 1) & (tb["v2elmulpar_osp_leg_dich"] == 1)) & (tb[column_new].isna()), column_new, ] = 1 From 97a114a5a5c23e6c94b6e68fd6eb261cfd155a98 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 5 Apr 2024 20:46:56 +0200 Subject: [PATCH 45/62] title fix --- etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 28189329bc5..211b123e632 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -979,7 +979,7 @@ tables: ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index electdem_dich_row_owid: - title: Electoral democracy (re-estimate) + title: Electoral democracy (<< estimate >> estimate) (re-estimate) description_short: |- << estimate.title() >> estimate of whether the country is meaningfully an electoral democracy. This includes the extent to which political leaders are elected under comprehensive suffrage in free and fair elections, and freedoms of association and expression are guaranteed. description_from_producer: *description_prod_electdem_vdem From 92e5dadf1d6bb1ecfd3d62674a8c74797c35dff1 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 5 Apr 2024 20:48:20 +0200 Subject: [PATCH 46/62] fix World estimates --- .../democracy/2024-03-07/vdem/vdem_aggregate.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index 91c0426789a..85130c9a4ba 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -122,7 +122,7 @@ def make_table_countries(tb: Table, ds_regions: Dataset) -> Tuple[Table, Table]: # Generate counts of countries in X category tb_sum = make_table_countries_counts(tb_, ds_regions) - # Generate averages of countries in X category + # Generate averages in regions (over countries) in X category tb_avg = make_table_countries_avg(tb_, ds_regions) # Merge tb_sum and tb_avg. Sanity-check that there is no overlap in columns (except for index) @@ -514,20 +514,20 @@ def add_regions_and_global_aggregates( aggregations_world: Optional[Dict[str, str]] = None, ) -> Table: """Add regions, and world aggregates.""" - tb = geo.add_regions_to_table( - tb, + tb_regions = geo.add_regions_to_table( + tb.copy(), ds_regions, regions=REGIONS, aggregations=aggregations, ) - tb = tb.loc[tb["country"].isin(REGIONS.keys())] + tb_regions = tb_regions.loc[tb_regions["country"].isin(REGIONS.keys())] # Add world if aggregations_world is None: - tb_w = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") + tb_world = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") else: - tb_w = tb.groupby("year", as_index=False).agg(aggregations_world).assign(country="World") - tb = concat([tb, tb_w], ignore_index=True, short_name="region_counts") + tb_world = tb.groupby("year", as_index=False).agg(aggregations_world).assign(country="World") + tb = concat([tb_regions, tb_world], ignore_index=True, short_name="region_counts") return tb From 79e2276bdcbbea09560e133277ad5054a309b991 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 5 Apr 2024 23:57:23 +0200 Subject: [PATCH 47/62] show number of suggestions if limit is exceeded --- apps/wizard/pages/charts/variable_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index 2577e37494b..df16ca98ae9 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -214,9 +214,9 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": # 2.4/ Manually mapped variables ################################# # Show only first 100 variables to map (otherwise app crashes) - if len(suggestions) > LIMIT_VARS_TO_MAP: + if (num_suggestions := len(suggestions)) > LIMIT_VARS_TO_MAP: st.warning( - f"Too many variables to map! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" + f"Too many variables ({num_suggestions}) to map! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" ) suggestions = suggestions[:LIMIT_VARS_TO_MAP] From 46ed54d6787ee07fb8693a889b5f7ad723078904 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Sat, 6 Apr 2024 17:40:50 +0200 Subject: [PATCH 48/62] fix count of countries (use age not experience) --- etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py | 4 ++-- .../data/garden/democracy/2024-03-07/vdem/vdem.meta.yml | 6 +++--- .../data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py | 4 ++-- .../data/garden/democracy/2024-03-07/vdem/vdem_refine.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py index 3864e97cb4e..53ee95c2074 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/__init__.py @@ -61,8 +61,8 @@ "num_years_in_libdem_consecutive", "num_years_in_electdem", "num_years_in_libdem", - "num_years_in_electdem_cat", - "num_years_in_libdem_cat", + "num_years_in_electdem_consecutive_cat", + "num_years_in_libdem_consecutive_cat", ] diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 211b123e632..3250a838ee3 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -90,7 +90,7 @@ tables: Indicator name: `e_wbgi_gee` unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 2 # Historical state name histname: @@ -111,7 +111,7 @@ tables: description_key: *description_key_num_electdem unit: years - num_years_in_electdem_cat: # electdem_age_group_row_owid + num_years_in_electdem_consecutive_cat: # electdem_age_group_row_owid title: Electoral democracy age group description_short: Category of electoral democracies based on the country's age of electoral democracy. description_key: *description_key_num_electdem @@ -130,7 +130,7 @@ tables: description_key: *description_key_num_libdem unit : years - num_years_in_libdem_cat: # libdem_age_group_row_owid + num_years_in_libdem_consecutive_cat: # libdem_age_group_row_owid title: Liberal democracy age group description_short: Category of liberal democracies based on the country's age of liberal democracy. description_processing: Number of consecutive years in liberal democracy. diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index 85130c9a4ba..ab894865250 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -592,7 +592,7 @@ def make_table_with_dummies(tb: Table) -> Table: "has_na": True, }, { - "name": "num_years_in_electdem_cat", + "name": "num_years_in_electdem_consecutive_cat", "name_new": "num_countries_years_in_electdem", "values_expected": { "closed autocracy", @@ -606,7 +606,7 @@ def make_table_with_dummies(tb: Table) -> Table: "has_na": True, }, { - "name": "num_years_in_libdem_cat", + "name": "num_years_in_libdem_consecutive_cat", "name_new": "num_countries_years_in_libdem", "values_expected": { "closed autocracy", diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py index ea0b24c6141..d7db8c2d1b5 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_refine.py @@ -82,7 +82,7 @@ def add_categories_years_in_democracy(tb: Table) -> Table: "91+ years", ] # 1. Create variable for age group of electoral demcoracies: - column = "num_years_in_electdem" + column = "num_years_in_electdem_consecutive" column_cat = f"{column}_cat" tb[column_cat] = pd.cut(tb[column], bins=bins, labels=labels) tb[column_cat] = Variable(tb[column_cat]).copy_metadata(tb.loc[:, column]) @@ -93,7 +93,7 @@ def add_categories_years_in_democracy(tb: Table) -> Table: tb.loc[(tb["regime_row_owid"] == 0) & tb[column_cat].isna(), column_cat] = "closed autocracy" # 2. Create variable for age group of liberal democracies - column = "num_years_in_libdem" + column = "num_years_in_libdem_consecutive" column_cat = f"{column}_cat" tb[column_cat] = pd.cut(tb[column], bins=bins, labels=labels) tb[column_cat] = Variable(tb[column_cat]).copy_metadata(tb.loc[:, column]) From 52eb86108b80ed4bc7d92d07d32f53887aa29e1a Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Sat, 6 Apr 2024 17:57:15 +0200 Subject: [PATCH 49/62] update number of decimals --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 59 +------------------ 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 3250a838ee3..3fe394a6145 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -298,6 +298,9 @@ tables: <% elif aggregate_method < 'population-weighted average' %> The regional aggregates (including values for World) have been estimated by averaging the country values weighed by popupalation. $\alpha$. The population values are from the UN WPP 2022 revision dataset. <% endif %> + display: + numDecimalPlaces: 2 + variables: # 2.1 V-Dem High-Level Democracy Indices ## 2.1.1 Electoral democracy index @@ -314,8 +317,6 @@ tables: Indicator name: `v2x_polyarchy` unit: '' - display: - numDecimalPlaces: 3 ## 2.1.2 Liberal democracy index libdem_vdem: @@ -332,8 +333,6 @@ tables: Indicator name: `v2x_libdem` unit: '' - display: - numDecimalPlaces: 3 # 2.1.3 Participatory democracy index participdem_vdem: @@ -350,8 +349,6 @@ tables: Indicator name: `v2x_partipdem` unit: '' - display: - numDecimalPlaces: 3 ## 2.1.4 Deliberative democracy index delibdem_vdem: @@ -369,8 +366,6 @@ tables: Indicator name: `v2x_delibdem` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.18 Egalitarian component index egal_vdem: @@ -387,8 +382,6 @@ tables: Indicator name: `v2x_egal` unit: '' - display: - numDecimalPlaces: 3 ## 3.5.1.6 Legislature corrupt activities corr_leg_vdem: @@ -413,8 +406,6 @@ tables: Indicator name: `v2lgcrrpt` unit: '' - display: - numDecimalPlaces: 3 ## 3.5.3.7 Lower chamber female legislators wom_parl_vdem: @@ -427,8 +418,6 @@ tables: Indicator name: `v2lgfemleg` unit: '%' - display: - numDecimalPlaces: 3 ## 3.7.0.6 Judicial corruption decision corr_jud_vdem: @@ -449,8 +438,6 @@ tables: Indicator name: `v2jucorrdc` unit: '' - display: - numDecimalPlaces: 3 ## 3.8.2.2 Rigorous and impartial public administration public_admin_vdem: @@ -477,8 +464,6 @@ tables: Indicator name: `v2clrspct` unit: '' - display: - numDecimalPlaces: 3 ## 3.8.2.6 Social group equality in respect for civil liberties socgr_civ_libs_vdem: @@ -500,8 +485,6 @@ tables: Indicator name: `v2clsocgrp` unit: '' - display: - numDecimalPlaces: 3 ## 3.9.0.1 Domestic autonomy dom_auton_vdem: @@ -523,8 +506,6 @@ tables: Indicator name: `v2svdomaut` unit: '' - display: - numDecimalPlaces: 3 ## 3.9.0.2 International autonomy int_auton_vdem: @@ -542,8 +523,6 @@ tables: Indicator name: `v2svinlaut` unit: '' - display: - numDecimalPlaces: 3 ## 3.9.0.3 State authority over territory terr_contr_vdem: @@ -561,8 +540,6 @@ tables: Indicator name: `v2svstterr` unit: '%' - display: - numDecimalPlaces: 3 ## 3.12.0.2 Power distributed by social group socgr_pow_vdem: @@ -584,8 +561,6 @@ tables: Indicator name: `v2pepwrsoc` unit: '' - display: - numDecimalPlaces: 3 ## 5.4.3 Presidentialism Index personalism_vdem: @@ -603,8 +578,6 @@ tables: Indicator name: `v2xnp_pres` unit: '' - display: - numDecimalPlaces: 3 ## 5.5.1 Civil liberties index civ_libs_vdem: @@ -621,8 +594,6 @@ tables: Indicator name: `v2x_civlib` unit: '' - display: - numDecimalPlaces: 3 ## 5.5.4 Private civil liberties index priv_libs_vdem: @@ -639,8 +610,6 @@ tables: Indicator name: `v2x_clpriv` unit: '' - display: - numDecimalPlaces: 3 ## 5.5.3 Political civil liberties index pol_libs_vdem: @@ -657,8 +626,6 @@ tables: Indicator name: `v2x_clpol` unit: '' - display: - numDecimalPlaces: 3 ## 5.5.2 Physical violence index phys_integr_libs_vdem: @@ -675,8 +642,6 @@ tables: Indicator name: `v2x_clphy` unit: '' - display: - numDecimalPlaces: 3 ## 5.7.1 Political corruption index corruption_vdem: @@ -693,8 +658,6 @@ tables: Indicator name: `v2x_corr` unit: '' - display: - numDecimalPlaces: 3 ## 5.7.3 Public sector corruption index [Not in use] corr_publsec_vdem: @@ -709,8 +672,6 @@ tables: Indicator name: `v2x_pubcorr` unit: '' - display: - numDecimalPlaces: 3 ## 5.7.2 Executive corruption index [Not in use] corr_exec_vdem: @@ -725,8 +686,6 @@ tables: Indicator name: `v2x_execorr` unit: '' - display: - numDecimalPlaces: 3 ## 5.8.1 Women political empowerment index wom_emp_vdem: @@ -743,8 +702,6 @@ tables: Indicator name: `v2x_gender` unit: '' - display: - numDecimalPlaces: 3 ## 5.8.2 Women civil liberties index wom_civ_libs_vdem: @@ -761,8 +718,6 @@ tables: Indicator name: `v2x_gencl` unit: '' - display: - numDecimalPlaces: 3 ## 5.8.3 Women civil society participation index wom_civ_soc_vdem: @@ -779,8 +734,6 @@ tables: Indicator name: `v2x_gencs` unit: '' - display: - numDecimalPlaces: 3 ## 5.8.4 Women political participation index wom_pol_par_vdem: @@ -797,8 +750,6 @@ tables: Indicator name: `v2x_genpp` unit: '' - display: - numDecimalPlaces: 3 ## 5.9.1 Rule of law index rule_of_law_vdem: @@ -813,8 +764,6 @@ tables: Indicator name: `v2x_rule` unit: '' - display: - numDecimalPlaces: 3 ## 5.11.1 Core civil society index [not in use] civ_soc_str_vdem: @@ -831,8 +780,6 @@ tables: Indicator name: `v2xcs_ccsi` unit: '' - display: - numDecimalPlaces: 3 ################################################################################################## ################################################################################################## From 45584f9444b9e191ee67c674c16c4bbaa0d2c0c0 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Sat, 6 Apr 2024 18:44:52 +0200 Subject: [PATCH 50/62] decimals: 2 --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 45 ++----------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 3fe394a6145..4df8589ad78 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -787,6 +787,9 @@ tables: vdem_multi_without_regions: title: "" description: "" + common: + display: + numDecimalPlaces: 2 variables: ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.3 Access to justice for men accessjust_m_row: @@ -858,8 +861,6 @@ tables: Indicator name: `v2x_cspart` unit: '' - display: - numDecimalPlaces: 3 ## 3.6.0.3 Respect counterarguments counterarg_polch_vdem: @@ -882,8 +883,6 @@ tables: Indicator name: `v2dlcountr` unit: '' - display: - numDecimalPlaces: 3 # 2.2.17 Deliberative component index delib_vdem: @@ -903,8 +902,6 @@ tables: Indicator name: `v2xdl_delib` unit: '' - display: - numDecimalPlaces: 3 ## 2.1.5 Egalitarian democracy index egaldem_vdem: @@ -921,8 +918,6 @@ tables: Indicator name: `v2x_egaldem` unit: '' - display: - numDecimalPlaces: 3 ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index electdem_dich_row_owid: @@ -977,8 +972,6 @@ tables: Indicator name: `v2xel_frefair` unit: '' - display: - numDecimalPlaces: 3 ## [CUSTOM] electmulpar_hoe_row_owid: @@ -1053,8 +1046,6 @@ tables: Indicator name: `v2dlconslt` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.20 Equal access index equal_access_vdem: @@ -1070,8 +1061,6 @@ tables: Indicator name: `v2xeg_eqaccess` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.19 Equal protection index equal_rights_vdem: @@ -1087,8 +1076,6 @@ tables: Indicator name: `v2xeg_eqprotec` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.21 Equal distribution of resources index equal_res_vdem: @@ -1104,8 +1091,6 @@ tables: Indicator name: `v2xeg_eqdr` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.4 Freedom of association thick index freeassoc_vdem: @@ -1119,8 +1104,6 @@ tables: Indicator name: `v2x_frassoc_thick` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.3 Freedom of Expression and Alternative Sources of Information index freeexpr_vdem: @@ -1136,8 +1119,6 @@ tables: Indicator name: `v2x_freexp_altinf` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.9 Equality before the law and individual liberty index indiv_libs_vdem: @@ -1151,8 +1132,6 @@ tables: Indicator name: `v2xcl_rol` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.10 Judicial constraints on the executive index judicial_constr_vdem: @@ -1166,8 +1145,6 @@ tables: Indicator name: `v2x_jucon` unit: '' - display: - numDecimalPlaces: 3 ## 3.6.0.2 Common good justcomgd_polch_vdem: @@ -1188,8 +1165,6 @@ tables: Indicator name: `v2dlcommon` unit: '' - display: - numDecimalPlaces: 3 ## 3.6.0.1 Reasoned justification justified_polch_vdem: @@ -1210,8 +1185,6 @@ tables: Indicator name: `v2dlreason` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.11 Legislative constraints on the executive index legis_constr_vdem: @@ -1227,8 +1200,6 @@ tables: Indicator name: `v2xlg_legcon` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.8 Liberal component index lib_vdem: @@ -1244,8 +1215,6 @@ tables: Indicator name: `v2x_liberal` unit: '' - display: - numDecimalPlaces: 3 ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.2.8 Liberal component index lib_dich_row: @@ -1274,8 +1243,6 @@ tables: Indicator name: `v2xel_locelec` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.12 Participatory component index particip_vdem: @@ -1292,8 +1259,6 @@ tables: Indicator name: `v2x_partip` unit: '' - display: - numDecimalPlaces: 3 ## 2.2.16 Regional government index regelect_vdem: @@ -1309,8 +1274,6 @@ tables: Indicator name: `v2xel_regelec` unit: '' - display: - numDecimalPlaces: 3 ## 3.6.0.5 Engaged society soccons_polch_vdem: @@ -1334,8 +1297,6 @@ tables: Indicator name: `v2dlengage` unit: '' - display: - numDecimalPlaces: 3 ## [RE-ESTIMATE, BINARY CATEGORISATION] 3.8.2.1 Transparent laws with predictable enforcement transplaws_row: From 8af42104cecef9f4ae81518a266b37353de67c4b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 9 Apr 2024 03:10:04 +0200 Subject: [PATCH 51/62] edit number of decimal places --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 4df8589ad78..9faf5fe4274 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -34,6 +34,10 @@ tables: The project is managed by the V-Dem Institute, based at the University of Gothenburg in Sweden. This snapshot contains all 500 V-Dem indicators and 245 indices + 57 other indicators from other data sources. + common: + display: + numDecimalPlaces: 0 + variables: ## 9.9.3 Corruption perception index [not in use] corruption_cpi: @@ -43,8 +47,6 @@ tables: Notes: The data spans 2012-present due to the methodological incomparability with the data prior 2012. unit: '' - display: - numDecimalPlaces: 0 ## 2.2.14 Direct popular vote index dirpop_vote_vdem: @@ -61,7 +63,7 @@ tables: Indicator name: `v2xdd_dd` unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 2 ## 2.2.7 Elected officials index electoff_vdem: @@ -76,7 +78,7 @@ tables: Indicator name: `v2x_elecoff` unit: '' display: - numDecimalPlaces: 3 + numDecimalPlaces: 2 ## 9.4.2 Government effectiveness goveffective_vdem_wbgi: @@ -155,7 +157,7 @@ tables: {definitions.common.description_processing} unit: '%' display: - numDecimalPlaces: 3 + numDecimalPlaces: 2 ## 3.1.3.3 Election turnout turnout_vdem: @@ -168,8 +170,6 @@ tables: Indicator name: `v2eltrnout` unit: '%' - display: - numDecimalPlaces: 2 # 3.4.2.18 HOS female wom_hos_vdem: # wom_hos_vdem_owid @@ -181,8 +181,6 @@ tables: Indicator name: `v2exfemhos` unit: '' - display: - numDecimalPlaces: 0 ## 3.4.3.16 HOG female wom_hog_vdem: # wom_hog_vdem_owid @@ -200,8 +198,6 @@ tables: Indicator name: `v2exfemhog` unit: '' - display: - numDecimalPlaces: 0 ## HOE female (custom) wom_hoe_vdem: # wom_hoe_vdem_owid @@ -221,8 +217,6 @@ tables: We derive this indicator from V-Dem indicators: `v2exfemhos`, `v2exfemhog`, `v2ex_hosw`, and `v2ex_hogw`. unit: '' - display: - numDecimalPlaces: 0 wom_parl_vdem_cat: # wom_parl_gr_vdem_owid title: Women in parliament (category) @@ -242,8 +236,6 @@ tables: - In _electoral autocracies_, citizens have the right to choose the chief executive and the legislature through multi-party elections; but they lack some freedoms, such as the freedoms of association or expression, that make the elections meaningful, free, and fair. - In _electoral democracies_, citizens have the right to participate in meaningful, free and fair, and multi-party elections. - In _liberal demoracies_, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - display: - numDecimalPlaces: 0 regime_amb_row_owid: title: Political regime (inc. ambiguous categories) @@ -258,8 +250,6 @@ tables: - In liberal democracies, citizens have further individual and minority rights, are equal before the law, and the actions of the executive are constrained by the legislative and the courts. - It further includes intermediate categories for closed autocracies that may be electoral autocracies (score 1), electoral autocracies that may be closed autocracies (score 2), electoral autocracies that may be electoral democracies (score 4), electoral democracies that may be electoral autocracies (score 5), electoral democracies that may be liberal democracies (score 7) and liberal democracies that may be electoral democracies (score 8). description_processing: "{definitions.auxiliary.description_processing_row}" - display: - numDecimalPlaces: 0 regime_redux_row_owid: title: Political regime (reduced) @@ -272,16 +262,12 @@ tables: - In electoral democracies, citizens have the right to participate in meaningful, free and fair, and multi-party elections. description_processing: "{definitions.auxiliary.description_processing_row}" unit: '' - display: - numDecimalPlaces: 0 # Not used regime_imputed: title: Data imputed from another country description_short: Denotes whether we imputed regime information from another country this one was historically a part of. unit: '' - display: - numDecimalPlaces: 0 regime_imputed_country: title: 'Country name (imputed country)' From 6c40d49215841d5b57f3ca482cfb018f47a79c11 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 9 Apr 2024 20:29:09 +0200 Subject: [PATCH 52/62] chart-upgrader: drop rows with old=new --- apps/wizard/pages/charts/variable_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index df16ca98ae9..c7070db4ea7 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -386,6 +386,8 @@ def plot_comparison_two_variables(df, variable_old, variable_new, var_id_to_disp # df_variables = df_variables[df_variables["entityName"].isin(countries)] ## Keep only rows with relative difference != 0 df_variables = df_variables[df_variables["Relative difference (abs, %)"] != 0] + ## Keep only rows with different values (old vs new) + df_variables = df_variables[df_variables[variable_old] != df_variables[variable_new]] # Row sanity check ## (Streamlit has a limit on the number of rows it can show) From 0703c041558145953d34f92c6fd570154f768be3 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 9 Apr 2024 22:33:10 +0200 Subject: [PATCH 53/62] wizard: chart-upgrader improve explore mode --- apps/wizard/pages/charts/variable_config.py | 57 +++++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index c7070db4ea7..71aa557fddc 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -2,6 +2,7 @@ from typing import Any, Dict, List import pandas as pd +import plotly.express as px import streamlit as st from pydantic import BaseModel from streamlit_extras.grid import grid @@ -214,9 +215,9 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": # 2.4/ Manually mapped variables ################################# # Show only first 100 variables to map (otherwise app crashes) - if (num_suggestions := len(suggestions)) > LIMIT_VARS_TO_MAP: + if len(suggestions) > LIMIT_VARS_TO_MAP: st.warning( - f"Too many variables ({num_suggestions}) to map! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" + f"Too many variables to map! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" ) suggestions = suggestions[:LIMIT_VARS_TO_MAP] @@ -311,12 +312,13 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": def show_explore_df(df_data, variable_old, variable_new, variable_id_to_display, element_check) -> None: if element_check: # type: ignore with st.container(border=True): - try: - plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore - except Exception: - st.error( - "Something went wrong! This can be due to several reasons: One (or both) of the variables are not numeric, `values` for one of the variables does not have the columns `entityName` and `year`. Please check the error message below. Report the error #002001" - ) + plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore + # try: + # plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore + # except Exception: + # st.error( + # "Something went wrong! This can be due to several reasons: One (or both) of the variables are not numeric, `values` for one of the variables does not have the columns `entityName` and `year`. Please check the error message below. Report the error #002001" + # ) else: st.empty() @@ -384,10 +386,23 @@ def plot_comparison_two_variables(df, variable_old, variable_new, var_id_to_disp # st.write(countries) # if countries: # df_variables = df_variables[df_variables["entityName"].isin(countries)] + score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 1) + if score == 100: + score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 2) + if score == 100: + score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 3) + if score == 100: + score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 4) + num_nan_score = df_variables["Relative difference (abs, %)"].isna().sum() + + nrows_0 = df_variables.shape[0] ## Keep only rows with relative difference != 0 df_variables = df_variables[df_variables["Relative difference (abs, %)"] != 0] - ## Keep only rows with different values (old vs new) - df_variables = df_variables[df_variables[variable_old] != df_variables[variable_new]] + ## Keep only rows with different values (old != new) + df_variables = df_variables[ + df_variables[var_id_to_display[variable_old]] != df_variables[var_id_to_display[variable_new]] + ] + nrows_1 = df_variables.shape[0] # Row sanity check ## (Streamlit has a limit on the number of rows it can show) @@ -406,9 +421,31 @@ def plot_comparison_two_variables(df, variable_old, variable_new, var_id_to_disp # cmap="OrRd", subset=["Relative difference (abs, %)"], vmin=0, vmax=20 # ) + # Show preliminary information + nrows_change_relative = round(100 * nrows_1 / nrows_0, 1) + col1, col2 = st.columns([1, 5]) + with col1: + st.metric( + "Data matching score (%)", + score, + help="The data matching score is based on the average of the relative difference between the two variables. A high score indicates a good match. It is estimated as `100 - average(relative scores)`.", + ) + with col2: + st.info( + f""" + - {num_nan_score} rows with unknown score + - {nrows_change_relative} % of the rows changed ({nrows_1} out of {nrows_0}) + """ + ) # Show table st.dataframe(df_variables) + # Show distribution of relative change + fig = px.histogram( + df_variables, x="Relative difference (abs, %)", nbins=100, title="Distribution of relative change" + ) + st.plotly_chart(fig, use_container_width=True) + def reset_variable_form() -> None: """ "Reset variable form.""" From d65cab173fea7ac34e0b37a3d308d3c5c6a30cef Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 9 Apr 2024 23:08:41 +0200 Subject: [PATCH 54/62] fix infinity % --- apps/wizard/pages/charts/variable_config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index 71aa557fddc..7c9b3720d66 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -386,13 +386,15 @@ def plot_comparison_two_variables(df, variable_old, variable_new, var_id_to_disp # st.write(countries) # if countries: # df_variables = df_variables[df_variables["entityName"].isin(countries)] - score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 1) + relative_diff = df_variables["Relative difference (abs, %)"] + relative_diff.loc[relative_diff == float("inf")] = float("nan") + score = round(100 - relative_diff.mean(), 1) if score == 100: - score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 2) + score = round(100 - relative_diff.mean(), 2) if score == 100: - score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 3) + score = round(100 - relative_diff.mean(), 3) if score == 100: - score = round(100 - df_variables["Relative difference (abs, %)"].mean(), 4) + score = round(100 - relative_diff.mean(), 4) num_nan_score = df_variables["Relative difference (abs, %)"].isna().sum() nrows_0 = df_variables.shape[0] From 83e93b2b9a44d0a5ec45322d1ae6382196504acb Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 9 Apr 2024 23:32:25 +0200 Subject: [PATCH 55/62] rollback to show number of variables --- apps/wizard/pages/charts/variable_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index 7c9b3720d66..aa484f085a8 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -217,7 +217,7 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": # Show only first 100 variables to map (otherwise app crashes) if len(suggestions) > LIMIT_VARS_TO_MAP: st.warning( - f"Too many variables to map! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" + f"Too many variables to map ({len(suggestions)})! Showing only the first {LIMIT_VARS_TO_MAP}. If you want to map more variables, do it in batches. That is, first map this batch and approve the generated chart revisions in admin. Once you are done, run this app again. Make sure you have approved the previously generated revisions!" ) suggestions = suggestions[:LIMIT_VARS_TO_MAP] From d233d8a3fc0a7d7ba9f8c172dd1761665eac8a70 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 18 Apr 2024 12:02:02 +0200 Subject: [PATCH 56/62] ensure variable is boolean --- etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py index 0602ee9eb30..4ea1a73787e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_impute.py @@ -107,7 +107,7 @@ def run(tb: Table) -> Table: tb = concat(tb_imputed + [tb], ignore_index=True) # Fill NaNs with False - tb["regime_imputed"] = tb["regime_imputed"].fillna(False) + tb["regime_imputed"] = tb["regime_imputed"].fillna(False).astype(bool) # Check unique values tb.format(underscore=False).reset_index() From 284c2d30afe27402925d81d337eefd6683645798 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 18 Apr 2024 14:23:05 +0200 Subject: [PATCH 57/62] improve explore mode --- apps/wizard/pages/charts/variable_config.py | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/wizard/pages/charts/variable_config.py b/apps/wizard/pages/charts/variable_config.py index aa484f085a8..aa05a999138 100644 --- a/apps/wizard/pages/charts/variable_config.py +++ b/apps/wizard/pages/charts/variable_config.py @@ -312,13 +312,13 @@ def ask_and_get_variable_mapping(search_form) -> "VariableConfig": def show_explore_df(df_data, variable_old, variable_new, variable_id_to_display, element_check) -> None: if element_check: # type: ignore with st.container(border=True): - plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore - # try: - # plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore - # except Exception: - # st.error( - # "Something went wrong! This can be due to several reasons: One (or both) of the variables are not numeric, `values` for one of the variables does not have the columns `entityName` and `year`. Please check the error message below. Report the error #002001" - # ) + # plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore + try: + plot_comparison_two_variables(df_data, variable_old, variable_new, variable_id_to_display) # type: ignore + except Exception: + st.error( + "Something went wrong! This can be due to several reasons: One (or both) of the variables are not numeric, `values` for one of the variables does not have the columns `entityName` and `year`. Please check the error message below. Report the error #002001" + ) else: st.empty() @@ -363,9 +363,15 @@ def build_df_comparison_two_variables_cached(df, variable_old, variable_new, var df_variables.loc[:, "value"] = df_variables.value.astype(float) # Reshape dataframe df_variables = df_variables.pivot(index=["entityName", "year"], columns="variableId", values="value").reset_index() - df_variables["Relative difference (abs, %)"] = ( - (100 * (df_variables[variable_old] - df_variables[variable_new]) / df_variables[variable_old]).round(2) + mask = df_variables[variable_old] == 0 + df_variables.loc[~mask, "Relative difference (abs, %)"] = ( + ( + 100 + * (df_variables.loc[~mask, variable_old] - df_variables.loc[~mask, variable_new]) + / df_variables.loc[~mask, variable_old] + ).round(2) ).abs() + df_variables.loc[mask, "Relative difference (abs, %)"] = float("inf") df_variables = df_variables.rename(columns=var_id_to_display).sort_values( "Relative difference (abs, %)", ascending=False ) From 62ba9dab46a1bc9ab3f8298ab22b439bf799b4f8 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Thu, 18 Apr 2024 19:07:13 +0200 Subject: [PATCH 58/62] fix origins for table --- .../data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index ab894865250..cd10aed1d1c 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -98,6 +98,12 @@ def run(tb: Table, ds_regions: Dataset, ds_population: Dataset) -> Tuple[Table, # Consolidate main table with additional regional aggregates tb_uni, tb_multi_without_regions, tb_multi_with_regions = make_main_tables(tb, tb_countries_avg, tb_population_avg) + # Only have one origin in tb_multi_with_regions + origin = tb_multi_with_regions["civ_libs_vdem"].m.origins[0] + assert origin.producer == "V-Dem", "Assigned origin should be V-Dem!" + for col in tb_multi_with_regions.columns: + tb_multi_with_regions[col].metadata.origins = [origin] + return tb_uni, tb_multi_without_regions, tb_multi_with_regions, tb_countries_counts, tb_population_counts From 1095d8ba313f0d34e9168bf513237cc4fd81068b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 19 Apr 2024 08:28:07 +0200 Subject: [PATCH 59/62] remove countries in population-weighted indicators --- .../data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index cd10aed1d1c..8bb5b588ecc 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -443,13 +443,13 @@ def make_main_tables(tb: Table, tb_countries_avg: Table, tb_population_avg: Tabl # Merge multi-dimensional table with region aggregates. # Since there are two ways of estimating the regional aggregates, we create two versions of the indicators tb_multi_with_regions["aggregate_method"] = "average" - tb_multi_with_regions_popw = tb_multi_with_regions.copy() - tb_multi_with_regions_popw["aggregate_method"] = "population-weighted average" + # tb_multi_with_regions_popw = tb_multi_with_regions.copy() + # tb_multi_with_regions_popw["aggregate_method"] = "population-weighted average" tb_countries_avg["aggregate_method"] = "average" tb_population_avg["aggregate_method"] = "population-weighted average" # Combine tb_multi_with_regions = concat( - [tb_multi_with_regions, tb_multi_with_regions_popw, tb_countries_avg, tb_population_avg], ignore_index=True + [tb_multi_with_regions, tb_countries_avg, tb_population_avg], ignore_index=True ) return tb_uni, tb_multi_without_regions, tb_multi_with_regions From ab1774bcae9ea88e31f8383fe029c869a776614b Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 19 Apr 2024 16:06:25 +0200 Subject: [PATCH 60/62] set aggregate to NaN in pop-weighted indicators --- .../garden/democracy/2024-03-07/vdem/vdem_aggregate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index 8bb5b588ecc..86e80af2933 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -329,6 +329,7 @@ def make_table_population_avg(tb: Table, ds_regions: Dataset, ds_population: Dat tb=tb_, ds_regions=ds_regions, aggregations={k: "sum" for k in INDICATORS_REGION_AVERAGES} | {"population": "sum"}, # type: ignore + min_num_values_per_year=1, ) # Normalize by region's populatino @@ -448,9 +449,7 @@ def make_main_tables(tb: Table, tb_countries_avg: Table, tb_population_avg: Tabl tb_countries_avg["aggregate_method"] = "average" tb_population_avg["aggregate_method"] = "population-weighted average" # Combine - tb_multi_with_regions = concat( - [tb_multi_with_regions, tb_countries_avg, tb_population_avg], ignore_index=True - ) + tb_multi_with_regions = concat([tb_multi_with_regions, tb_countries_avg, tb_population_avg], ignore_index=True) return tb_uni, tb_multi_without_regions, tb_multi_with_regions @@ -517,6 +516,7 @@ def add_regions_and_global_aggregates( tb: Table, ds_regions: Dataset, aggregations: Optional[Dict[str, str]] = None, + min_num_values_per_year: Optional[int] = None, aggregations_world: Optional[Dict[str, str]] = None, ) -> Table: """Add regions, and world aggregates.""" @@ -525,12 +525,13 @@ def add_regions_and_global_aggregates( ds_regions, regions=REGIONS, aggregations=aggregations, + min_num_values_per_year=min_num_values_per_year, ) tb_regions = tb_regions.loc[tb_regions["country"].isin(REGIONS.keys())] # Add world if aggregations_world is None: - tb_world = tb.groupby("year", as_index=False).sum(numeric_only=True).assign(country="World") + tb_world = tb.groupby("year", as_index=False).sum(numeric_only=True, min_count=1).assign(country="World") else: tb_world = tb.groupby("year", as_index=False).agg(aggregations_world).assign(country="World") tb = concat([tb_regions, tb_world], ignore_index=True, short_name="region_counts") From 7e0b045769e1934eb299544de9027057eff4d2a2 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 19 Apr 2024 16:35:35 +0200 Subject: [PATCH 61/62] fix: confusion with egal_vdem and egaldem_vdem --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 32 ++++++++++--------- .../2024-03-07/vdem/vdem_aggregate.py | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index 9faf5fe4274..e6886de0dce 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -353,20 +353,22 @@ tables: Indicator name: `v2x_delibdem` unit: '' - ## 2.2.18 Egalitarian component index - egal_vdem: + + ## 2.1.5 Egalitarian democracy index + egaldem_vdem: title: |- - Egalitarian political institutions index (<< estimate >> estimate, aggregate: << aggregate_method >>) + Egalitarian democracy index (<< estimate >> estimate, aggregate: << aggregate_method >>) description_short: |- - << estimate.title() >> estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. + << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: |- - Question: To what extent is the egalitarian principle achieved? + Question: To what extent is the ideal of egalitarian democracy achieved? - Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. + Clarification: + The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_egal` + Indicator name: `v2x_egaldem` unit: '' ## 3.5.1.6 Legislature corrupt activities @@ -889,20 +891,20 @@ tables: Indicator name: `v2xdl_delib` unit: '' - ## 2.1.5 Egalitarian democracy index - egaldem_vdem: - title: Egalitarian democracy index (<< estimate >> estimate) + ## 2.2.18 Egalitarian component index + egal_vdem: + title: |- + Egalitarian political institutions index (<< estimate >> estimate) description_short: |- - << estimate.title() >> estimate of the extent of suffrage, the freedom and fairness of elections, freedoms of association and expression, as well as the extent to which the protection of rights, access to power, and distribution of resources is equal. + << estimate.title() >> estimate of the extent to which the protection of rights, access to power, and distribution of resources is equal. description_from_producer: |- - Question: To what extent is the ideal of egalitarian democracy achieved? + Question: To what extent is the egalitarian principle achieved? - Clarification: - The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; and 2 resources are distributed equally across all social groups; 3 groups and individuals enjoy equal access to power. To make it a measure of egalitarian democracy, the index also takes the level of electoral democracy into account. + Clarification: The egalitarian principle of democracy holds that material and immaterial inequalities inhibit the exercise of formal rights and liberties, and diminish the ability of citizens from all social groups to participate. Egalitarian democracy is achieved when 1 rights and freedoms of individuals are protected equally across all social groups; 2 resources are distributed equally across all social groups; and 3 access to power is equally distributed by gender, socioeconomic class and social group. Scale: Interval, from low to high (0-1). - Indicator name: `v2x_egaldem` + Indicator name: `v2x_egal` unit: '' ## [RE-ESTIMATE, BINARY CATEGORISATION] 2.1.1 Electoral democracy index diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py index 86e80af2933..7c25fdabd55 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem_aggregate.py @@ -60,7 +60,7 @@ "libdem_vdem", "participdem_vdem", "delibdem_vdem", - "egal_vdem", + "egaldem_vdem", "civ_libs_vdem", "phys_integr_libs_vdem", "pol_libs_vdem", From 2747540d67dc5c549433658b6d2a7f70859a3415 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 19 Apr 2024 16:48:11 +0200 Subject: [PATCH 62/62] add default entities with colours --- .../democracy/2024-03-07/vdem/vdem.meta.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml index e6886de0dce..ec36329f67e 100644 --- a/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml +++ b/etl/steps/data/garden/democracy/2024-03-07/vdem/vdem.meta.yml @@ -286,6 +286,22 @@ tables: <% endif %> display: numDecimalPlaces: 2 + presentation: + grapher_config: + selectedEntityNames: + - "Africa" + - "Asia" + - "Europe" + - "North America" + - "Oceania" + - "South America" + selectedEntityColors: + "Africa": "#A2559C" + "Asia": "#00847E" + "Europe": "#4C6A9C" + "North America": "#C4523E" + "Oceania": "#9A5129" + "South America": "#883039" variables: # 2.1 V-Dem High-Level Democracy Indices