**............................................................................** ** ** ** COMPARATIVE STUDY OF ELECTORAL SYSTEMS (CSES) ** ** Stata Example Syntax for Bridging polity-level data to CSES data: ** ** Bridging the CSES INTEGRATED MODULE DATASET (IMD) PHASE 3 Release to ** ** the V-Dem Core Dataset, Version 10 ** ** ** ** CSES IMD Version: IMD PHASE 3 RELEASE ** ** V-Dem Version: V-Dem Core Dataset - Version 10 ** ** Default Directory: c:\cses\CSES_data_bridging_project ** ** ** ** Website: www.cses.org ** ** Email: cses@umich.edu ** ** Last Updated: November 23, 2020 ** ** Created by: CSES Secretariat ** **............................................................................** ******************************************************************************** ** PURPOSE OF SYNTAX FILE ******************************************************************************** ** This syntax file is intended for experienced users of STATA. For users ** who are less familiar with STATA, we recommend that you use the Comprehensive ** File which provides detailed comments for each command in the file. This is ** available on the CSES Data Bridging Webpage - see Comprehensive File. ** This syntax file outlines how to bridge all variables included in the V-Dem ** Core Dataset, Version 10 to the CSES IMD Phase 3 Release dataset. ** Variables from V-Dem can also be linked to other CSES Data Products ** using this syntax example be specifying a different CSES data product. ** ACHTUNG: Before running the file, download the datasets and save them in the ** working directory: ** The current release of the CSES IMD Dataset is available via ** https://cses.org/data-download/cses-integrated-module-dataset-imd/ ** The current release of the V-Dem Core Dataset - Version 10 is available ** via https://www.v-dem.net/en/data/data/v-dem-dataset/ ******************************************************************************** **#>>> 1: SETTING-UP STATA ******************************************************************************** clear all capture log close cd "C:\cses\CSES_data_bridging_project" ** ACHTUNG: Running the syntax requires the CSES IMD and V-Dem datasets ** to be placed in the working directory specified above. ******************************************************************************** **#>>> 2: LOADING THE CSES IMD DATASET & PREPARING CSES IMD DATASET FOR ** BRIDGING WITH VARIABLES FROM V-Dem ******************************************************************************** use cses_imd.dta, clear tabulate IMD1006_VDem, missing tabulate IMD1008_YEAR, missing save cses_imd_formerging.dta, replace ******************************************************************************** **#>>> 3: LOADING THE V-Dem DATASET & PREPARING V-Dem DATASET ** FOR MERGING WITH CSES IMD ******************************************************************************** use "V-Dem-CY-Core-v10.dta", clear generate IMD1006_VDem = country_id generate IMD1008_YEAR = year save VDem10_formerging, replace ******************************************************************************** ** #>>> 4: MERGING THE CSES IMD AND V-Dem DATASETS TOGETHER ******************************************************************************** use cses_imd_formerging.dta, clear merge m:1 IMD1006_VDem IMD1008_YEAR using "VDem10_formerging.dta" tabulate _merge ******************************************************************************** * #>>> 5: FINALIZING THE BRIDGED DATASET ******************************************************************************** drop if _merge == 2 drop _merge save cses_imd_vDem10_core.dta, replace ************************************************** *END OF DO-FILE