Skip to contents

add_gwcode_to_cow() allows you to match, as well as one can, Gleditsch-Ward system membership data with Correlates of War state system membership data.

Usage

add_gwcode_to_cow(data)

Arguments

data

a data frame with appropriate peacesciencer attributes

Value

add_gwcode_to_cow() takes a (dyad-year, leader-year, leader-dyad-year, state-year) data frame that already has Correlates of War state system codes and adds their corollary Gleditsch-Ward codes.

Details

As of version 1.2, this function leans on the information made available in the isard package. This is a spin-off package I maintain for data that require periodic updates for the functionality in this package. As of writing, peacesciencer only requires that you have the isard package installed. It does not require you to have any particular version of the package installed. Thus, what exactly this function returns may depend on the particular version of isard you have installed. This will assuredly concern the right-bound of the temporal domain of data you get.

You can read more about the data in the documentation for isard.

The user will invariably need to be careful and ask why they want these data included. The issue here is that both have a different composition and the merging process will not (and cannot) be perfect. We can note that a case like Serbia/Yugoslavia is not too difficult to handle (since "Serbia" never overlaps with "Yugoslavia" in the Gleditsch-Ward data and Correlates of War understands Serbia as the predecessor state, dominant state, and successor state to Yugoslavia). However, there is greater weirdness with a case like Yemen/Yemen Arab Republic. The script will not create state-year or dyad-year duplicates for the Correlates of War codes. The size of the original data remain unchanged. However, there will be some year duplicates for various Gleditsch-Ward codes (e.g. Yemen, again). Use with care. You can also use the countrycode package. Whether you use this function or the countrycode package, do not do this kind of merging without assessing the output.

Author

Steven V. Miller

Examples

# just call `library(tidyverse)` at the top of the your script
library(magrittr)

cow_ddy %>% add_gwcode_to_cow()
#> # A tibble: 2,214,930 × 5
#>    ccode1 ccode2  year gwcode1 gwcode2
#>     <dbl>  <dbl> <dbl>   <dbl>   <dbl>
#>  1      2     20  1920       2      20
#>  2      2     20  1921       2      20
#>  3      2     20  1922       2      20
#>  4      2     20  1923       2      20
#>  5      2     20  1924       2      20
#>  6      2     20  1925       2      20
#>  7      2     20  1926       2      20
#>  8      2     20  1927       2      20
#>  9      2     20  1928       2      20
#> 10      2     20  1929       2      20
#> # ℹ 2,214,920 more rows

create_stateyears() %>% add_gwcode_to_cow()
#> # A tibble: 17,511 × 4
#>    ccode cw_name                   year gwcode
#>    <dbl> <chr>                    <dbl>  <dbl>
#>  1     2 United States of America  1816      2
#>  2     2 United States of America  1817      2
#>  3     2 United States of America  1818      2
#>  4     2 United States of America  1819      2
#>  5     2 United States of America  1820      2
#>  6     2 United States of America  1821      2
#>  7     2 United States of America  1822      2
#>  8     2 United States of America  1823      2
#>  9     2 United States of America  1824      2
#> 10     2 United States of America  1825      2
#> # ℹ 17,501 more rows