diff --git a/docs/articles/coerce-dispute-year-dyad-year.html b/docs/articles/coerce-dispute-year-dyad-year.html index 6918e53..2cfbd4c 100644 --- a/docs/articles/coerce-dispute-year-dyad-year.html +++ b/docs/articles/coerce-dispute-year-dyad-year.html @@ -99,7 +99,7 @@
 library(tidyverse)
 #> ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-#>  dplyr     1.1.0      readr     2.1.4
+#>  dplyr     1.1.1      readr     2.1.4
 #>  forcats   1.0.0      stringr   1.5.0
 #>  ggplot2   3.4.1      tibble    3.2.0
 #>  lubridate 1.9.2      tidyr     1.3.0
diff --git a/docs/articles/democracy.html b/docs/articles/democracy.html
index 61ffe30..a11b2df 100644
--- a/docs/articles/democracy.html
+++ b/docs/articles/democracy.html
@@ -99,7 +99,7 @@
 
 library(tidyverse)
 #> ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-#>  dplyr     1.1.0      readr     2.1.4
+#>  dplyr     1.1.1      readr     2.1.4
 #>  forcats   1.0.0      stringr   1.5.0
 #>  ggplot2   3.4.1      tibble    3.2.0
 #>  lubridate 1.9.2      tidyr     1.3.0
diff --git a/docs/articles/different-data-types.html b/docs/articles/different-data-types.html
index 66fbfcb..da5c3b6 100644
--- a/docs/articles/different-data-types.html
+++ b/docs/articles/different-data-types.html
@@ -114,7 +114,7 @@
 
 library(tidyverse)
 #> ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-#>  dplyr     1.1.0      readr     2.1.4
+#>  dplyr     1.1.1      readr     2.1.4
 #>  forcats   1.0.0      stringr   1.5.0
 #>  ggplot2   3.4.1      tibble    3.2.0
 #>  lubridate 1.9.2      tidyr     1.3.0
diff --git a/docs/articles/joins.html b/docs/articles/joins.html
index 0760cef..2bdd710 100644
--- a/docs/articles/joins.html
+++ b/docs/articles/joins.html
@@ -482,10 +482,11 @@ 

Potential Problems of the Left Join
 left_join(x, y2) %>% data.frame
 #> Joining with `by = join_by(ccode)`
-#> Warning in left_join(x, y2): Each row in `x` is expected to match at most 1 row in `y`.
-#>  Row 11 of `x` matches multiple rows.
-#>  If multiple matches are expected, set `multiple = "all"` to silence this
-#>   warning.
+#> Warning in left_join(x, y2): Detected an unexpected many-to-many relationship between `x` and `y`.
+#>  Row 11 of `x` matches multiple rows in `y`.
+#>  Row 1 of `y` matches multiple rows in `x`.
+#>  If a many-to-many relationship is expected, set `relationship =
+#>   "many-to-many"` to silence this warning.
 #>    ccode year ranking
 #> 1      2 2016     low
 #> 2      2 2017     low
diff --git a/docs/authors.html b/docs/authors.html
index 4d258fb..dff5d79 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -77,13 +77,20 @@ 

Authors

Citation

Source: inst/CITATION

-

Miller, Steven V. Forthcoming. {peacesciencer}: An R Package for Quantitative Peace Science Research Conflict Management and Peace Science http://svmiller.com/peacesciencer/

-
@Article{peacesciencer-package,
+      

Miller S (2022). +“peacesciencer: An R Package for Quantitative Peace Science Research.” +Conflict Management and Peace Science, 39(6), 755–779. +doi: 10.1177/07388942221077926. +

+
@Article{,
   title = {{peacesciencer}: An R Package for Quantitative Peace Science Research},
-  author = {{Steven V. Miller}},
+  author = {Steven V. Miller},
   journal = {Conflict Management and Peace Science},
   year = {2022},
-  url = {http://svmiller.com/peacesciencer/},
+  volume = {39},
+  number = {6},
+  pages = {755--779},
+  doi = {10.1177/07388942221077926},
 }

peacesciencer  hexlogo

-

peacesciencer is an R package including various functions and data sets to allow easier analyses in the field of quantitative peace science. The goal is to provide an R package that reasonably approximates what made EUGene so attractive to scholars working in the field of quantitative peace science in the early 2000s. EUGene shined because it encouraged replications of conflict models while having the user also generate data from scratch. Likewise, this R package will offer tools to approximate what EUGene did within the R environment (i.e. not requiring Windows for installation).

+

peacesciencer is an R package including various functions and data sets to allow easier analyses in the field of quantitative peace science. The goal is to provide an R package that reasonably approximates what made EUGene so attractive to scholars working in the field of quantitative peace science in the early 2000s. EUGene shined because it encouraged replications of conflict models while having the user also generate data from scratch. Likewise, this R package will offer tools to approximate what EUGene did within the R environment (i.e. not requiring Windows for installation).

+

Installation @@ -185,7 +186,7 @@

How to Use {peacesciencer} #> 10 I(gmlmidspell^2) 0.00247 0.000135 18.4 2.74e- 75 #> 11 I(gmlmidspell^3) -0.0000116 0.000000891 -13.0 1.16e- 38 toc() -#> 7.559 sec elapsed

+#> 7.35 sec elapsed

Here is how you might do a standard civil conflict analysis using Gleditsch-Ward states and UCDP conflict data.

 
@@ -256,7 +257,7 @@ 

How to Use {peacesciencer} #> 11 I(war_ucdpspell^3) -0.0000499 0.0000302 -1.65 0.0982 toc() -#> 2.444 sec elapsed

+#> 2.315 sec elapsed

Citing What You Do in {peacesciencer} diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 247e79c..e543266 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -9,7 +9,7 @@ articles: parlor-tricks: parlor-tricks.html state-systems: state-systems.html versions: versions.html -last_built: 2023-03-22T13:35Z +last_built: 2023-03-24T11:16Z urls: reference: http://svmiller.com/reference article: http://svmiller.com/articles diff --git a/docs/search.json b/docs/search.json index 4df40fd..9f26e9d 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"converting-cow-mid-dyadic-dispute-year-data-into-dyad-year-data","dir":"Articles","previous_headings":"","what":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"First, let’s identify dyad-year duplicates data. absolute data United Kingdom-Soviet Union dyad, six conflicts ongoing /initiated 1920. Next tie United States-Soviet Union dyad 1958, Egypt-Israel dyad (1959, 1960), Syria-Israel dyad (1955). told, 498 dyad-years duplicate dyadic dispute-year data. need whittle one dyad-year data.","code":"cow_mid_dirdisps %>% # make it non-directed for ease of presentation filter(ccode2 > ccode1) %>% group_by(ccode1, ccode2, year) %>% summarize(n = n(), mids = paste0(dispnum, collapse = \", \")) %>% arrange(-n) %>% filter(n > 1) %>% ungroup() #> `summarise()` has grouped output by 'ccode1', 'ccode2'. You can override using #> the `.groups` argument. #> # A tibble: 498 × 5 #> ccode1 ccode2 year n mids #> #> 1 200 365 1920 6 186, 197, 1133, 2363, 2364, 2604 #> 2 2 365 1958 5 125, 173, 608, 2215, 2216 #> 3 651 666 1959 5 3375, 3405, 3419, 3421, 3430 #> 4 651 666 1960 5 3375, 3405, 3419, 3422, 3430 #> 5 652 666 1955 5 3404, 3405, 3416, 3417, 3418 #> 6 2 365 1962 4 61, 1353, 2219, 3361 #> 7 2 365 1967 4 345, 2930, 2931, 2934 #> 8 200 365 1919 4 197, 2363, 2604, 2605 #> 9 651 666 1958 4 3375, 3405, 3419, 3420 #> 10 652 666 1954 4 3403, 3404, 3415, 3417 #> # … with 488 more rows"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"first-select-unique-onsets","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"First: Select Unique Onsets","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"primary aim preserve unique onsets. case United States-United Kingdom dyad 1903 illustrate ’s stake . , United States United Kingdom three MIDs ongoing 1903. Two (MID#0002 MID#0254) began 1902. third, MID#3301, new onset. case, want remove observation MID#0002 MID#0254 keep observation MID3301. United States-United Kingdom Dyadic Dispute-Years 1903 ’s peacesciencer first cut. Grouping dyad-year (.e. group_by(ccode1, ccode2, year)), creates new variable equals 1 number rows dyad-year 1. Maintaining grouped structure, calculates standard deviation disponset variable. Cases standard deviation calculate cases dyad-year duplicate assigned 0. Next, creates simple removeme column equals 1 1) ’s duplicated dyad-year, 2) ’s unique onset, 3) standard deviation greater 0 (.e. least one onset dyad-year). removes cases removeme == 1. Observe fixed USA-United Kingdom observation 1903. fix Italy-France problem 1860, ’s three dispute-years onsets year. France-Italy Dyadic Dispute-Years 1903 just tells us ’re done, knew wouldn’t . need exclusion rules whittle data.","code":"cow_mid_dirdisps %>% filter(ccode1 == 2 & ccode2 == 200 & year == 1903) %>% select(dispnum:disponset) %>% kbl(., caption = \"United States-United Kingdom Dyadic Dispute-Years in 1903\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") cow_mid_dirdisps %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% # Remove anything that's not a unique MID onset mutate(sd = sd(disponset), sd = ifelse(is.na(sd), 0, sd)) %>% mutate(removeme = ifelse(duplicated == 1 & disponset == 0 & sd > 0, 1, 0)) %>% filter(removeme != 1) %>% # remove detritus select(-removeme, -sd) %>% # practice safe group_by() ungroup() -> hold_this # ^ The `hold_this` naming convention is my favorite for intermediate objects. # It's also a bad idea to overwrite data objects that come in this package. hold_this %>% filter(ccode1 == 2 & ccode2 == 200 & year == 1903) %>% select(dispnum:disponset) #> # A tibble: 1 × 6 #> dispnum ccode1 ccode2 year dispongoing disponset #> #> 1 3301 2 200 1903 1 1 hold_this %>% filter(ccode1 == 220 & ccode2 == 325 & year == 1860) %>% select(dispnum:disponset) %>% kbl(., caption = \"France-Italy Dyadic Dispute-Years in 1903\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\")"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"second-keep-the-highest-dispute-level-fatality","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Second: Keep the Highest Dispute-Level Fatality","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"presented opportunity keep one dispute drop another two appear year, researchers likely prefer “serious” one rather one might simple threat use show force. Consider Russia-Ottoman Empire (Turkey) dyad-year 1853. two unique onsets two year. One (MID#0057) became Crimean War, important conflict! (MID#0126) apparent show force fatalities. conditions, ’s easy call keep one fatalities. Russia-Ottoman Empire Dyadic Dispute-Years 1853 one limitation CoW-MID data toward end. obviously know CoW-MID assigns fatalities end dispute participants, ’d way knowing priori many fatalities Russia-Turkey dyad 1853. situation like Belgium-Germany 1939-1940. case, highest action Belgium engaged Germany 1939 mobilization war momentarily eliminated Belgium international system happened next year. also don’t know extent Turkey responsible Russia’s fatalities. Crimean War multilateral war pitting Russians United Kingdom, Austria-Hungary, Italy, Turkey, France. Thus, follows crude, still useful. ’ll use dispute-level fatality information stand-keep duplicate dyad-year observation highest fatality score. ’ll also need take inventory handle cases fatality == -9. forthcoming data release, find cases missing fatalities CoW-MID data mean fatalities half cases. even wars! However, ’d way knowing CoW-MID. ’ll safe recode -9 .5, indicating 0 fatalities “less” fatality level 1 (1-25 deaths) CoW-MID can least confidently say latter happened. fix Russia-Turkey-1853 problem. won’t fix cases multiple disputes initiated year dyad, one died. lot . , ’ll need case exclusion rules.","code":"hold_this %>% filter(ccode1 == 365 & ccode2 == 640 & year == 1853) %>% select(dispnum:disponset, fatality1:fatality2, hiact1, hiact2) %>% kbl(., caption = \"Russia-Ottoman Empire Dyadic Dispute-Years in 1853\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, fatality)) %>% mutate(fatality = ifelse(fatality == -9, .5, fatality)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest fatality filter(fatality == max(fatality)) %>% mutate(fatality = ifelse(fatality == .5, -9, fatality)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 365 & ccode2 == 640 & year == 1853) #> # A tibble: 1 × 20 #> dispnum ccode1 ccode2 year dispongoing dispon…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 57 365 640 1853 1 1 1 0 6 6 #> # … with 10 more variables: fatalpre1 , fatalpre2 , hiact1 , #> # hiact2 , hostlev1 , hostlev2 , orig1 , orig2 , #> # duplicated , fatality , and abbreviated variable names #> # ¹​disponset, ²​fatality1, ³​fatality2"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"third-keep-the-highest-dispute-level-hostility","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Third: Keep the Highest Dispute-Level Hostility","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"next case exclusion rule want continue isolating serious MIDs MIDs lesser severity. Consider case India Pakistan 1963. India-Pakistan Dyadic Dispute-Years 1963 two unique MID onsets 1963 neither fatal, meaning duplicate dyad-year still . However, MID#2630 just threat use force whereas MID#1317 occupation territory (Pakistan India). former threat. latter use. MID#2630 higher hostility level MID ’ll want keep. caveat applies, fatalities, ’ll use dispute-level hostility variable plug-. least fix India-Pakistan observation 1963, others like .","code":"hold_this %>% filter(ccode1 == 750 & ccode2 == 770 & year == 1963) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) %>% kbl(., caption = \"India-Pakistan Dyadic Dispute-Years in 1963\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, hostlev)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest hostlev filter(hostlev == max(hostlev)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 750 & ccode2 == 770 & year == 1963) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) #> # A tibble: 1 × 9 #> dispnum ccode1 ccode2 year disponset fatality1 fatality2 hiact1 hiact2 #> #> 1 1317 750 770 1963 1 0 0 0 14"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"fourth-keep-the-highest-dispute-level-minimum-then-maximum-duration","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Fourth: Keep the Highest Dispute-Level (Minimum, Then Maximum) Duration","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"point, still duplicate dyad-years remaining data, ’ve selected cases fairly similar (least given dispute- participant-level data available). duplicates remain unique onsets fatality levels hostility levels. next available measure approximates dispute severity duration. Consider duplicate observation Colombia-Peru 1852 corresponding MIDs (MID#1506 MID#1523). MIDs look fairly similar. started year. level fatalities (none). hostility level (show force). tough read tea leaves argue alert (hiact: 8) “greater” show force (hiact: 7) even 8 > 7 (.e. CoW-MID action codes never truly ordinal). , ’re multilateral MIDs. MID#1506 pit Venezuela Colombia Chile Peru whereas MID#1523 pit Chile Colombia Peru. even unhelpfully unknown duration . -9s start days . However, MID#1523 highest minimum duration. lasted least 110 days (many 140) whereas MID#1506 minimum duration 63 days (maximum duration 122 days). conditions, keep one minimum duration , duplicates still remain, keep one highest maximum duration. fix Colombia-Peru problem 1852.","code":"haven::read_dta(\"~/Dropbox/data/cow/mid/5/MIDB 5.0.dta\") %>% filter(dispnum %in% c(1506, 1523)) %>% select(dispnum:sidea, fatality, hiact, hostlev) #> # A tibble: 7 × 13 #> dispnum stabb ccode stday stmon styear endday endmon endyear sidea fatality #> #> 1 1506 VEN 101 -9 10 1852 -9 11 1852 1 0 #> 2 1506 CHL 155 14 9 1852 -9 11 1852 0 0 #> 3 1506 PER 135 -9 8 1852 -9 11 1852 0 0 #> 4 1506 COL 100 -9 8 1852 -9 11 1852 1 0 #> 5 1523 PER 135 -9 3 1852 18 7 1852 0 0 #> 6 1523 CHL 155 2 6 1852 2 6 1852 1 0 #> 7 1523 COL 100 -9 3 1852 18 7 1852 1 0 #> # … with 2 more variables: hiact , hostlev hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, mindur, maxdur)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest mindur filter(mindur == max(mindur)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest maxdur filter(maxdur == max(maxdur)) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 135 & ccode2 == 100 & year == 1852) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) #> # A tibble: 1 × 9 #> dispnum ccode1 ccode2 year disponset fatality1 fatality2 hiact1 hiact2 #> #> 1 1523 135 100 1852 1 0 0 0 8"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"final-case-exclusions-for-the-cow-mid-data","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Final Case Exclusions for the CoW-MID Data","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"started 498 duplicate directed dyad-years dyadic dispute-year data. ’re now just 24 directed (12 non-directed) dyad-years. glance remaining observations suggest substance similar. example, MID#4428 MID#4430 one-day border fortifications Kyrgyzstan Uzbekistan 2005. MID#2171 MID#2172 one-day threats use force Cyprus Turkey 1965. Duplicate Non-Directed Dyad-Years Still Remaining final case exclusion rules round us home. First, duplicate dyad-years feature case one dispute reciprocated . example, MID#4428 mutual border fortification MID#4430 just one border fortification directed Kyrgyzstan Uzbekistan. Thus, keep one involved least two codable incidents rather MID just one codable incident. reader may object reciprocation feature higher proverbial chain, given prominence audience cost literature. caution . Gibler Miller (also Little) driven home reciprocation variable information-poor variable. minimally tells Side B MID initiated militarized incident involved attack clear initiator. review conflict data, find attacks ambushes initiated Side countered happen half time. , inferences made reciprocation variable among sensitive errors report CoW-MID data. reason, discourage researchers using variable analyses , application, ’s peacesciencer uses dispute-level reciprocation variable near bottom rung case exclusions. Still, ’s . ’re just three duplicate dyad-years now. reason MID#4428 MID#4430 still CoW-MID MID#4428 unreciprocated dispute-level also militarized incident Side B dispute. CoW-MID issue peacesciencer issue. Duplicate Non-Directed Dyad-Years Still Remaining three effectively identical MIDs. start year. fatality-level, hostility-level, duration, either reciprocated -reciprocated (MID#4428/MID#4430 issue notwithstanding). Thus, select one lowest start month. enough eliminate duplicate dyad-years.","code":"hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) %>% filter(ccode2 > ccode1) %>% select(dispnum:disponset, hiact1:hiact2, fatality:maxdur) %>% kbl(., caption = \"Duplicate Non-Directed Dyad-Years Still Remaining\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, recip)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the reciprocated ones, where non-reciprocated ones exist filter(recip == max(recip)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) %>% filter(ccode2 > ccode1) %>% select(dispnum:disponset, hiact1:hiact2, fatality:maxdur) %>% kbl(., caption = \"Duplicate Non-Directed Dyad-Years Still Remaining\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, stmon)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the reciprocated ones, where non-reciprocated ones exist filter(stmon == min(stmon)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` # And we're done hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) #> # A tibble: 0 × 25 #> # Groups: ccode1, ccode2, year [0] #> # … with 25 variables: dispnum , ccode1 , ccode2 , year , #> # dispongoing , disponset , sidea1 , sidea2 , #> # fatality1 , fatality2 , fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , fatality , hostlev , mindur , #> # maxdur , recip , stmon "},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-year-data","dir":"Articles","previous_headings":"","what":"State-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"basic form data peacesciencer creates state-year, way create_stateyears(). create_stateyears() two arguments: system mry. system takes either “cow” “gw”, depending whether user wants Correlates War state years Gleditsch-Ward state-years. defaults “cow” absence user-specified override given prominence Correlates War data peace science ecosystem. mry takes logical (TRUE FALSE), depending whether user wants function extend recently concluded calendar year (2022). Correlates War state system data extend end 2016 Gleditsch-Ward state system extend end 2017. argument allow researcher extend data years, (reasonable) assumption fundamental composition changes state system since data sets last updated. mry defaults TRUE absence user-specified override. create Correlates War state-year data 1816 2022. create Gleditsch-Ward state-year data 1816 2017.","code":"create_stateyears() #> # A tibble: 17,121 × 3 #> ccode statenme year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,111 more rows create_stateyears(system = \"gw\", mry = FALSE) #> # A tibble: 17,767 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,757 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"dyad-year-data","dir":"Articles","previous_headings":"","what":"Dyad-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"create_dyadyears() one useful functions peacesciencer, transforming raw Correlates War state system data (cow_states peacesciencer) Gleditsch-Ward state system data (gw_states) possible dyad-years. three arguments. system mry operate create_stateyears(). additional argument—directed—also takes logical (TRUE FALSE). default TRUE, returning directed dyad-year data (useful dyadic conflict analyses initiator/target distinction matters). FALSE returns non-directed dyad-year data, useful cases initiator/target distinction matter researcher cares presence absence conflict. convention non-directed dyad-year data ccode2 > ccode1 underlying code create_dyadyears() simply takes directed dyad-year data chops half rule. Correlates War dyad-years 1816 2022. Gleditsch-Ward dyad-years temporal domain.","code":"create_dyadyears() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 3 #> ccode1 ccode2 year #> #> 1 2 20 1920 #> 2 2 20 1921 #> 3 2 20 1922 #> 4 2 20 1923 #> 5 2 20 1924 #> 6 2 20 1925 #> 7 2 20 1926 #> 8 2 20 1927 #> 9 2 20 1928 #> 10 2 20 1929 #> # … with 2,139,260 more rows create_dyadyears(system = \"gw\") #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 2,089,816 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"major-vs--major-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"Major vs. Major Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"Consider section vignette comparison kind dyad-year data EUGene create user, apparently request. EUGene apparently create types dyad-years specific dyad-year types whereas peacesciencer treats case exclusions can fact given functionality package. example, just major vs. major dyads. simplicity’s sake, directed dyad-years core (captured cow_ddy package shortcut).","code":"cow_ddy %>% add_cow_majors() %>% filter(cowmaj1 == 1 & cowmaj2 == 1) #> # A tibble: 6,140 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 200 1898 1 1 #> 2 2 200 1899 1 1 #> 3 2 200 1900 1 1 #> 4 2 200 1901 1 1 #> 5 2 200 1902 1 1 #> 6 2 200 1903 1 1 #> 7 2 200 1904 1 1 #> 8 2 200 1905 1 1 #> 9 2 200 1906 1 1 #> 10 2 200 1907 1 1 #> # … with 6,130 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"major-vs--any-state-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"Major vs. Any State Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years state major power.","code":"cow_ddy %>% add_cow_majors() %>% filter(cowmaj1 == 1 | cowmaj2 == 1) #> # A tibble: 183,722 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 20 1920 1 0 #> 2 2 20 1921 1 0 #> 3 2 20 1922 1 0 #> 4 2 20 1923 1 0 #> 5 2 20 1924 1 0 #> 6 2 20 1925 1 0 #> 7 2 20 1926 1 0 #> 8 2 20 1927 1 0 #> 9 2 20 1928 1 0 #> 10 2 20 1929 1 0 #> # … with 183,712 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"all-contiguous-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"All Contiguous Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years separated 400 miles water fewer, though documentation add_contiguity() cautions users least little critical contiguity data.","code":"cow_ddy %>% add_contiguity() %>% filter(conttype %in% c(1:5)) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 82,440 × 4 #> ccode1 ccode2 year conttype #> #> 1 2 20 1920 1 #> 2 2 20 1921 1 #> 3 2 20 1922 1 #> 4 2 20 1923 1 #> 5 2 20 1924 1 #> 6 2 20 1925 1 #> 7 2 20 1926 1 #> 8 2 20 1927 1 #> 9 2 20 1928 1 #> 10 2 20 1929 1 #> # … with 82,430 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"all-dyad-years-within-a-set-distance","dir":"Articles","previous_headings":"Dyad-Year Data","what":"All Dyad-Years Within a Set Distance","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years minimum distance user-specified threshold (kilometers). function lean add_minimum_distance(), side effect truncating left bound temporal domain —right now—1886. Correlates War dyad-years 1886 2019 separated 1,000 kilometers fewer.","code":"cow_ddy %>% add_minimum_distance() %>% filter(mindist <= 1000) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 167,532 × 4 #> ccode1 ccode2 year mindist #> #> 1 2 20 1921 0 #> 2 2 20 1922 0 #> 3 2 20 1923 0 #> 4 2 20 1924 0 #> 5 2 20 1925 0 #> 6 2 20 1926 0 #> 7 2 20 1927 0 #> 8 2 20 1928 0 #> 9 2 20 1929 0 #> 10 2 20 1930 0 #> # … with 167,522 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"dyadic-dispute-year-data","dir":"Articles","previous_headings":"","what":"Dyadic Dispute-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"Dyadic dispute-year data come pre-processed peacesciencer. Another vignette show transformed true dyad-year data, also available analysis. example, (directed) dyadic dispute-year Gibler-Miller-Little (GML) MID data available gml_dirdisp. , can add information dyadic dispute-years identify contiguity relationships Correlates War major status. Users interested Correlates War MID data available use cow_mid_dirdisps. Future updates may change object names better standardization, now.","code":"gml_dirdisp %>% add_contiguity() %>% add_cow_majors() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 10,276 × 42 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2 2 200 1902 1 1 1 0 1 1 #> 2 2 200 2 1902 1 1 0 1 1 1 #> 3 3 300 345 1913 1 1 1 0 1 0 #> 4 3 345 300 1913 1 1 0 1 0 1 #> 5 4 200 339 1946 1 1 0 1 0 0 #> 6 4 339 200 1946 1 1 1 0 0 0 #> 7 7 200 651 1951 1 1 1 0 0 1 #> 8 7 200 651 1952 1 0 1 0 0 1 #> 9 7 651 200 1951 1 1 0 1 1 0 #> 10 7 651 200 1952 1 0 0 1 1 0 #> # … with 10,266 more rows, 32 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , conttype , …"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-day-data","dir":"Articles","previous_headings":"","what":"State-Day Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer comes create_statedays() function. admittedly proof concept really difficult conjure many daily data sets peace science, certainly coverage 19th century. matter, create_statedays() create data. system mry arguments (defaults) create_stateyears(). Correlates War state-days 1816 2022. Gleditsch-Ward state-days temporal domain. can conjure application user may want think daily conflict episodes within Gleditsch-Ward domain. UCDP armed conflict data precise dates , say, Correlates War MID data, making analysis possible. However, conflict data 1946 reflect peacesciencer something like . require lubridate.","code":"create_statedays() #> # A tibble: 6,203,441 × 3 #> ccode statenme date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,203,431 more rows create_statedays(system = \"gw\") #> # A tibble: 6,765,801 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,765,791 more rows create_statedays(system = \"gw\") %>% filter(year(date) >= 1946) #> # A tibble: 3,998,000 × 3 #> gwcode statename date #> #> 1 2 United States of America 1946-01-01 #> 2 2 United States of America 1946-01-02 #> 3 2 United States of America 1946-01-03 #> 4 2 United States of America 1946-01-04 #> 5 2 United States of America 1946-01-05 #> 6 2 United States of America 1946-01-06 #> 7 2 United States of America 1946-01-07 #> 8 2 United States of America 1946-01-08 #> 9 2 United States of America 1946-01-09 #> 10 2 United States of America 1946-01-10 #> # … with 3,997,990 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-month-data","dir":"Articles","previous_headings":"","what":"State-Month Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"State-months simple aggregations state-days. can accomplish extra commands create_statedays().","code":"create_statedays(system = \"gw\") %>% mutate(year = year(date), month = month(date)) %>% distinct(gwcode, statename, year, month) #> # A tibble: 222,370 × 4 #> gwcode statename year month #> #> 1 2 United States of America 1816 1 #> 2 2 United States of America 1816 2 #> 3 2 United States of America 1816 3 #> 4 2 United States of America 1816 4 #> 5 2 United States of America 1816 5 #> 6 2 United States of America 1816 6 #> 7 2 United States of America 1816 7 #> 8 2 United States of America 1816 8 #> 9 2 United States of America 1816 9 #> 10 2 United States of America 1816 10 #> # … with 222,360 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-quarter-data","dir":"Articles","previous_headings":"","what":"State-Quarter Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"assumption worth belaboring “quarter” look like general context, might look something like . , aggregation create_statedays().","code":"create_statedays(system = \"gw\") %>% mutate(year = year(date), month = month(date)) %>% filter(month %in% c(1, 4, 7, 10)) %>% mutate(quarter = case_when( month == 1 ~ \"Q1\", month == 4 ~ \"Q2\", month == 7 ~ \"Q3\", month == 10 ~ \"Q4\" )) %>% distinct(gwcode, statename, year, quarter) #> # A tibble: 74,079 × 4 #> gwcode statename year quarter #> #> 1 2 United States of America 1816 Q1 #> 2 2 United States of America 1816 Q2 #> 3 2 United States of America 1816 Q3 #> 4 2 United States of America 1816 Q4 #> 5 2 United States of America 1817 Q1 #> 6 2 United States of America 1817 Q2 #> 7 2 United States of America 1817 Q3 #> 8 2 United States of America 1817 Q4 #> 9 2 United States of America 1818 Q1 #> 10 2 United States of America 1818 Q2 #> # … with 74,069 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"leader-day-leader-month-leader-year-data","dir":"Articles","previous_headings":"","what":"Leader-Day (Leader-Month, Leader-Year) Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer leader-level units analysis well, can easily created modified Archigos (archigos) data peacesciencer. data version 4.1. create_leaderdays() create leader-day data archigos. want note one thing leader-level functions package. Whereas Correlates War state system membership often default system lot functions (prominently create_stateyears() create_dyadyears()), Gleditsch-Ward system default system state system around Archigos project created leader data. Moreover, leader data aren’t exactly tethered Gleditsch-Ward state system dates either (e.g. leader entries Gleditsch-Ward states aren’t system yet). case like , can standardize leader data either Correlates War system Gleditsch-Ward system standardize argument. default, option “none” (.e. return available leader days recorded Archigos data). “cow” “gw” standardizes leader data Correlates War state system membership Gleditsch-Ward state system membership, respectively. user may want think additional post-processing top , enough get started. , process creates state-months can create something like leader-months. leader-years, pre-packaged peacesciencer function. package also adds information leader gender, approximation leader’s age year (.e. year - yrborn), running count (starting 1) leader’s tenure (years).","code":"archigos #> # A tibble: 3,409 × 11 #> obsid gwcode leadid leader yrborn gender startdate enddate entry exit #> #> 1 USA-1869 2 81dcc… Grant 1822 M 1869-03-04 1877-03-04 Regu… Regu… #> 2 USA-1877 2 81dcc… Hayes 1822 M 1877-03-04 1881-03-04 Regu… Regu… #> 3 USA-188… 2 81dcf… Garfi… 1831 M 1881-03-04 1881-09-19 Regu… Irre… #> 4 USA-188… 2 81dcf… Arthur 1829 M 1881-09-19 1885-03-04 Regu… Regu… #> 5 USA-1885 2 34fb1… Cleve… 1837 M 1885-03-04 1889-03-04 Regu… Regu… #> 6 USA-1889 2 81dcf… Harri… 1833 M 1889-03-04 1893-03-04 Regu… Regu… #> 7 USA-1893 2 34fb1… Cleve… 1837 M 1893-03-04 1897-03-04 Regu… Regu… #> 8 USA-1897 2 81dcf… McKin… 1843 M 1897-03-04 1901-09-14 Regu… Irre… #> 9 USA-1901 2 81dd2… Roose… 1858 M 1901-09-14 1909-03-04 Regu… Regu… #> 10 USA-1909 2 81dd2… Taft 1857 M 1909-03-04 1913-03-04 Regu… Regu… #> # … with 3,399 more rows, and 1 more variable: exitcode create_leaderdays() #> # A tibble: 5,298,380 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,298,370 more rows create_leaderdays(standardize = \"cow\") #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, date)` #> # A tibble: 4,824,967 × 5 #> obsid ccode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 4,824,957 more rows create_leaderdays() %>% mutate(year = year(date), month = month(date)) %>% group_by(gwcode, obsid, year, month) %>% slice(1) #> # A tibble: 177,128 × 7 #> # Groups: gwcode, obsid, year, month [177,128] #> obsid gwcode leader date yrinoffice year month #> #> 1 USA-1869 2 Grant 1869-03-04 1 1869 3 #> 2 USA-1869 2 Grant 1869-04-01 1 1869 4 #> 3 USA-1869 2 Grant 1869-05-01 1 1869 5 #> 4 USA-1869 2 Grant 1869-06-01 1 1869 6 #> 5 USA-1869 2 Grant 1869-07-01 1 1869 7 #> 6 USA-1869 2 Grant 1869-08-01 1 1869 8 #> 7 USA-1869 2 Grant 1869-09-01 1 1869 9 #> 8 USA-1869 2 Grant 1869-10-01 1 1869 10 #> 9 USA-1869 2 Grant 1869-11-01 1 1869 11 #> 10 USA-1869 2 Grant 1869-12-01 1 1869 12 #> # … with 177,118 more rows create_leaderyears() #> # A tibble: 17,686 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,676 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"leader-dyad-year-data","dir":"Articles","previous_headings":"","what":"Leader Dyad-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer can also create leader dyad-year data way create_leaderdyadyears(). can see underlying code creating data. ’s lot code, take lot time run scratch, ensuing output large store R data object package CRAN hard-caps package size 5 MB. Instead, users want data first run download_extdata() first install update package. Therein, can run create_leaderdyadyears() create full universe leader dyad-year data.","code":"# create_leaderdyadyears() is effectively doing this. # Let's do the G-W leader dyad-year data for illustration's sake. # `download_extdata()` will download these data into the package directory. # Thus, it is *not* downloading the data fresh each time. the_url <- \"http://svmiller.com/R/peacesciencer/gw_dir_leader_dyad_years.rds\" readRDS(url(the_url)) %>% declare_attributes(data_type = \"leader_dyad_year\", system = \"gw\") #> # A tibble: 2,336,990 × 11 #> year obsid1 obsid2 gwcode1 gwcode2 gender1 gender2 leade…¹ leade…² yrino…³ #> #> 1 1870 AFG-1868 AUH-1… 700 300 M M 45 40 3 #> 2 1870 AFG-1868 BAV-1… 700 245 M M 45 39 3 #> 3 1870 AFG-1868 BRA-1… 700 140 M M 45 45 3 #> 4 1870 AFG-1868 CHN-1… 700 710 M M 45 35 3 #> 5 1870 AFG-1868 COS-1… 700 94 M M 45 39 3 #> 6 1870 AFG-1868 ECU-1… 700 130 M M 45 49 3 #> 7 1870 AFG-1868 GMY-1… 700 255 M M 45 73 3 #> 8 1870 AFG-1868 GRC-1… 700 350 M M 45 25 3 #> 9 1870 AFG-1868 IRN-1… 700 630 M M 45 39 3 #> 10 1870 AFG-1868 JPN-1… 700 740 M M 45 18 3 #> # … with 2,336,980 more rows, 1 more variable: yrinoffice2 , and #> # abbreviated variable names ¹​leaderage1, ²​leaderage2, ³​yrinoffice1 # ^ compare with: # download_extdata() # create_leaderdyadyears()"},{"path":"http://svmiller.com/articles/joins.html","id":"left-outer-join","dir":"Articles","previous_headings":"","what":"Left (Outer) Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"first type join important type join function peacesciencer. Indeed, almost every function package deals adding variables type data created peacesciencer includes . “left join” (left_join() dplyr), alternatively known “outer join” “left outer join” SQL context, type “mutating join” tidyverse context. plain English, left_join() assumes two data objects—“left” object (x) “right” object (y)—returns rows left object (x) matching information right object (y) set common matching keys (columns x y). simple example works peacesciencer context. Assume simple state-year data set United States (ccode: 2), Canada (ccode: 20), United Kingdom (ccode: 200) years 2016 2020. Recreating simple kind data problem R serve “left object” (x) simple example. Let’s assume ’re building toward kind state-year analysis describe manuscript accompanying package. example, canonical civil conflict analysis Fearon Laitin (2003) outcome varies year, several independent variables time-invariant serve variables making state--state comparisons model civil war onset (e.g ethnic fractionalization, religious fractionalization, terrain ruggedness). similar manner, basic ranking United States, Canada, United Kingdom case. Minimally, United States scores “low”, Canada scores “medium”, United Kingdom scores “high” metric. variation time simple example. “right object” (y) want add “left object” serves main data frame. Notice x variable ranking information want. , however, matching observations state identifiers corresponding Correlates War state codes U.S., Canada, United Kingdom. left join (left_join()) merges y x, returning rows x matching information y based columns share common (: ccode). obviously simple example, scales well even additional complexity. example, let’s assume added simple five-year panel Australia (ccode: 900) “left object” (x). However, corresponding information Australia “right object” (y). left join produce circumstances. ranking Australia simple example, left join returns NAs (.e. missing values) Australia. original number rows x conditions unaffected. happen observation y corresponding match x? example, let’s assume y data also included ranking Denmark (ccode: 390), though Denmark appear x. happen circumstances. Notice output left join identical output . Australia x, y. Thus, rows Australia returned absence ranking information Australia y means variable NA Australia merge. Denmark y, x. left join returns rows x matching information y, absence observations Denmark x means nowhere ranking information go merge. Thus, Denmark’s ranking ignored.","code":"tibble(ccode = c(2, 20, 200)) %>% # rowwise() is a great trick for nesting sequences in tibbles # This parlor trick, for example, generates state-year data out of raw state # data in create_stateyears() rowwise() %>% # create a sequence as a nested column mutate(year = list(seq(2016, 2020))) %>% # unnest the column unnest(year) -> x x #> # A tibble: 15 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 tibble(ccode = c(2, 20, 200), ranking = c(\"low\", \"medium\", \"high\")) -> y y #> # A tibble: 3 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high # alternatively, as I tend to do it: x %>% left_join(., y) left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 15 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high tibble(ccode = 900, year = c(2016:2020)) %>% bind_rows(x, .) -> x x #> # A tibble: 20 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 #> 16 900 2016 #> 17 900 2017 #> 18 900 2018 #> 19 900 2019 #> 20 900 2020 left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 20 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high #> 16 900 2016 NA #> 17 900 2017 NA #> 18 900 2018 NA #> 19 900 2019 NA #> 20 900 2020 NA tibble(ccode = 390, ranking = \"high\") %>% bind_rows(y, .) -> y y #> # A tibble: 4 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high #> 4 390 high left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 20 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high #> 16 900 2016 NA #> 17 900 2017 NA #> 18 900 2018 NA #> 19 900 2019 NA #> 20 900 2020 NA"},{"path":"http://svmiller.com/articles/joins.html","id":"why-the-left-join-in-particular","dir":"Articles","previous_headings":"Left (Outer) Join","what":"Why the Left Join, in Particular?","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"interested user may ask ’s special kind join appears everywhere peacesciencer. One reply use left_join() part matter taste. just well vignette reference “right join”, mirror join “left join.” right join dplyr’s right_join(x,y) returns records y matching rows x common columns, though equivalency depend reversing order x y (.e. left_join(x, y) produces information right_join(y, x)). arrangement columns differ left_join() right_join() simple application even underlying information . Ultimately, tend think “left-handed” comes data management instruct students introduce data transformation R. like intuition, especially pipe-based workflow, start master data object top pipe keep “left” add information . benefit keeping units analysis (e.g. state-years simple setup) first columns user sees well. preferred approach data transformation left_join() recurs peacesciencer result. Beyond matter taste, left join everywhere peacesciencer project endeavors hard recreate appropriate universe cases interest user allow user add stuff see fit. create_stateyears() create entire universe state-years 1816 present state-year analysis. create_dyadyears() create entire universe dyad-years 1816 present dyad-year analysis. logic, implemented peacesciencer’s multiple functions, type data user wants create created . user want expand data , though user may want something like reduce full universe 1816-2020 state-years just 1946-2010. However, universe partially discarded, universe augmented expanded. mind, every function’s use left join assumes data object receives represents full universe cases interest researcher. left join just adding information , based matching information one many data sets. done carefully, left join dutiful way adding information data set without changing number rows original data set. number columns obviously expand, number rows unaffected.","code":""},{"path":"http://svmiller.com/articles/joins.html","id":"potential-problems-of-the-left-join","dir":"Articles","previous_headings":"Left (Outer) Join","what":"Potential Problems of the Left Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"“done carefully” heavy-lifting last sentence. , let explain situations left join produce problems researcher (even join supposed operational standpoint). first less problem, least implemented peacesciencer, caution. example, panel consists just U.S., Canada, United Kingdom, Australia. happen ranking Denmark, Denmark wasn’t panel (effectively, exclusively) Anglophone states. Therefore, row created Denmark. important left join create rows Denmark, first place (.e. panel Denmark x merge). case, left join behaving . Denmark panel trying match information . peacesciencer circumvents issue creating universal data (e.g. state-years, dyad-years, available leader-years) user free subset see fit. Users run one “create” functions (e.g. create_stateyears(), create_dyadyears()) top script adding information left join, implemented everywhere package, building assumption universe cases interest user represented “left object” left outer join. Basically, expect left join create new rows x situation state represented y x. . type join assumes universe cases interest researcher already appear “left object.” second situation bigger problem. Sometimes, often bouncing information denominated Correlates War states Gleditsch-Ward states, unwanted duplicate observation data frame merged primary data interest user. Let’s go back simple example x y . Everything performs nicely, though Australia (x) ranking Denmark (y) panel state-years wasn’t part original universe cases interest us. Let’s assume, however, mistakenly entered United Kingdom twice y. know data supposed simple state-level rankings. state supposed just . United Kingdom appears twice. left join y2 x, get unwelcome result. United Kingdom duplicated yearly observations. doesn’t matter duplicate ranking y2 UK . messier, sure, ranking different duplicate observation, matters duplicated. panel like , user careful effect overweighting observations duplicate. simple example like , subsetting just complete cases (.e. Australia ranking), UK 50% observations despite fact just third observations. ’s ideal researcher. peacesciencer goes beyond make sure doesn’t happen data creates. Functions aggressively tested make sure nothing duplicates, various parlor tricks (prominently group-slices) used internally cull duplicate observations. release function makes prominent use left join done assurance doesn’t create duplicate. matter, biggest peril left join researcher may want duplicate peacesciencer . Always inspect data merge, output.","code":"x #> # A tibble: 20 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 #> 16 900 2016 #> 17 900 2017 #> 18 900 2018 #> 19 900 2019 #> 20 900 2020 y #> # A tibble: 4 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high #> 4 390 high tibble(ccode = 200, ranking = \"high\") %>% bind_rows(y, .) -> y2 left_join(x, y2) %>% data.frame #> Joining with `by = join_by(ccode)` #> Warning in left_join(x, y2): Each row in `x` is expected to match at most 1 row in `y`. #> ℹ Row 11 of `x` matches multiple rows. #> ℹ If multiple matches are expected, set `multiple = \"all\"` to silence this #> warning. #> ccode year ranking #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2016 high #> 13 200 2017 high #> 14 200 2017 high #> 15 200 2018 high #> 16 200 2018 high #> 17 200 2019 high #> 18 200 2019 high #> 19 200 2020 high #> 20 200 2020 high #> 21 900 2016 #> 22 900 2017 #> 23 900 2018 #> 24 900 2019 #> 25 900 2020 "},{"path":"http://svmiller.com/articles/joins.html","id":"semi-join","dir":"Articles","previous_headings":"","what":"Semi-Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"“semi-join” (semi_join() dplyr) returns rows left object (x) matching values right object (y). type “filtering join”, affects observations variables. appears just twice peacesciencer, serving final join create_leaderdays() create_leaderyears(). cases, serves means standardizing leader data (denominated Gleditsch-Ward system, necessarily Gleditsch-Ward system dates) Correlates War Gleditsch-Ward system. basic example semi-join context, illustration kind difficulties manifest standardizing Archigos’ leader data Correlates War state system. Assume simple state system just two states—“Lincoln” “Morrill”—two-week period start 1975 (Jan. 1, 1975 Jan. 14, 1975). simple system, “Lincoln” state full two week period (Jan. 1-Jan.14) whereas “Morrill” state just first seven days (Jan. 1-Jan. 7) , let’s say, “Lincoln” occupied “Morrill” ended statehood. also happened leader data two states. two week period, leader data suggests “Lincoln” just one continuous leader—“Archie”—whereas “Morrill” three. “Brian” leader “Morrill” retired office replaced “Cornelius.” However, deposed “Lincoln” invaded “Morrill” replaced puppet head state, “Pete.” data look like . can use basic rowwise() transformation recast data daily, resulting state-day data leader-day data. wanted standardize leader-day data state system data, semi-join leader-day data (left object) state-day object (right object), returning just leader-day data valid days state system data. Notice Pete drops data , simple example, Pete puppet head state installed Archie “Lincoln” invaded occupied “Morrill”. semi-join simply standardizing leader data state system data, effectively ’s happening semi-joins create_leaderdays() (aggregation function: create_leaderyears()).","code":"tibble(code = c(\"Lincoln\", \"Morrill\"), stdate = make_date(1975, 01, 01), enddate = c(make_date(1975, 01, 14), make_date(1975, 01, 07))) -> state_system state_system #> # A tibble: 2 × 3 #> code stdate enddate #> #> 1 Lincoln 1975-01-01 1975-01-14 #> 2 Morrill 1975-01-01 1975-01-07 tibble(code = c(\"Lincoln\", \"Morrill\", \"Morrill\", \"Morrill\"), leader = c(\"Archie\", \"Brian\", \"Cornelius\", \"Pete\"), stdate = c(make_date(1975, 01, 01), make_date(1975, 01, 01), make_date(1975, 01, 04), make_date(1975, 01, 08)), enddate = c(make_date(1975, 01, 14), make_date(1975, 01, 04), make_date(1975, 01, 08), make_date(1975, 01, 14))) -> leaders leaders #> # A tibble: 4 × 4 #> code leader stdate enddate #> #> 1 Lincoln Archie 1975-01-01 1975-01-14 #> 2 Morrill Brian 1975-01-01 1975-01-04 #> 3 Morrill Cornelius 1975-01-04 1975-01-08 #> 4 Morrill Pete 1975-01-08 1975-01-14 state_system %>% rowwise() %>% mutate(date = list(seq(stdate, enddate, by = '1 day'))) %>% unnest(date) %>% select(code, date) -> state_days state_days %>% data.frame #> code date #> 1 Lincoln 1975-01-01 #> 2 Lincoln 1975-01-02 #> 3 Lincoln 1975-01-03 #> 4 Lincoln 1975-01-04 #> 5 Lincoln 1975-01-05 #> 6 Lincoln 1975-01-06 #> 7 Lincoln 1975-01-07 #> 8 Lincoln 1975-01-08 #> 9 Lincoln 1975-01-09 #> 10 Lincoln 1975-01-10 #> 11 Lincoln 1975-01-11 #> 12 Lincoln 1975-01-12 #> 13 Lincoln 1975-01-13 #> 14 Lincoln 1975-01-14 #> 15 Morrill 1975-01-01 #> 16 Morrill 1975-01-02 #> 17 Morrill 1975-01-03 #> 18 Morrill 1975-01-04 #> 19 Morrill 1975-01-05 #> 20 Morrill 1975-01-06 #> 21 Morrill 1975-01-07 leaders %>% rowwise() %>% mutate(date = list(seq(stdate, enddate, by = '1 day'))) %>% unnest(date) %>% select(code, leader, date) -> leader_days leader_days %>% data.frame #> code leader date #> 1 Lincoln Archie 1975-01-01 #> 2 Lincoln Archie 1975-01-02 #> 3 Lincoln Archie 1975-01-03 #> 4 Lincoln Archie 1975-01-04 #> 5 Lincoln Archie 1975-01-05 #> 6 Lincoln Archie 1975-01-06 #> 7 Lincoln Archie 1975-01-07 #> 8 Lincoln Archie 1975-01-08 #> 9 Lincoln Archie 1975-01-09 #> 10 Lincoln Archie 1975-01-10 #> 11 Lincoln Archie 1975-01-11 #> 12 Lincoln Archie 1975-01-12 #> 13 Lincoln Archie 1975-01-13 #> 14 Lincoln Archie 1975-01-14 #> 15 Morrill Brian 1975-01-01 #> 16 Morrill Brian 1975-01-02 #> 17 Morrill Brian 1975-01-03 #> 18 Morrill Brian 1975-01-04 #> 19 Morrill Cornelius 1975-01-04 #> 20 Morrill Cornelius 1975-01-05 #> 21 Morrill Cornelius 1975-01-06 #> 22 Morrill Cornelius 1975-01-07 #> 23 Morrill Cornelius 1975-01-08 #> 24 Morrill Pete 1975-01-08 #> 25 Morrill Pete 1975-01-09 #> 26 Morrill Pete 1975-01-10 #> 27 Morrill Pete 1975-01-11 #> 28 Morrill Pete 1975-01-12 #> 29 Morrill Pete 1975-01-13 #> 30 Morrill Pete 1975-01-14 leader_days %>% semi_join(., state_days) %>% data.frame #> Joining with `by = join_by(code, date)` #> code leader date #> 1 Lincoln Archie 1975-01-01 #> 2 Lincoln Archie 1975-01-02 #> 3 Lincoln Archie 1975-01-03 #> 4 Lincoln Archie 1975-01-04 #> 5 Lincoln Archie 1975-01-05 #> 6 Lincoln Archie 1975-01-06 #> 7 Lincoln Archie 1975-01-07 #> 8 Lincoln Archie 1975-01-08 #> 9 Lincoln Archie 1975-01-09 #> 10 Lincoln Archie 1975-01-10 #> 11 Lincoln Archie 1975-01-11 #> 12 Lincoln Archie 1975-01-12 #> 13 Lincoln Archie 1975-01-13 #> 14 Lincoln Archie 1975-01-14 #> 15 Morrill Brian 1975-01-01 #> 16 Morrill Brian 1975-01-02 #> 17 Morrill Brian 1975-01-03 #> 18 Morrill Brian 1975-01-04 #> 19 Morrill Cornelius 1975-01-04 #> 20 Morrill Cornelius 1975-01-05 #> 21 Morrill Cornelius 1975-01-06 #> 22 Morrill Cornelius 1975-01-07"},{"path":"http://svmiller.com/articles/joins.html","id":"anti-join","dir":"Articles","previous_headings":"","what":"Anti-Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"anti-join another type filtering join, returning rows left object (x) without match right object (y). type join appears just peacesciencer. Prominently, peacesciencer prepares presents two data sets package—false_cow_dyads false_gw_dyads—represent directed dyad-years Correlates War Gleditsch-Ward systems active year, never time year. dyads context. created two scripts , year respective state system data, creates every possible daily dyadic pairing truncates dyads just least one day overlap. computationally demanding procedure compared peacesciencer (creates every possible dyadic pair given year, given state system data supplied ). However, creates possibility false dyads given year showed overlap. Consider case Suriname (115) Republic Vietnam (817) 1975 illustrative . Notice Suriname Republic Vietnam active 1975. Suriname appears Nov. 25, 1975 whereas Republic Vietnam exits April 30, 1975. However, daily overlap two exist point day 1975. false dyads. anti_join() used create_dyadyears() function remove observations presenting user. simple example anti-join examples mind.","code":"false_cow_dyads #> # A tibble: 60 × 4 #> ccode1 ccode2 year in_ps #> #> 1 115 817 1975 1 #> 2 210 255 1945 1 #> 3 211 255 1945 1 #> 4 223 678 1990 1 #> 5 223 680 1990 1 #> 6 255 210 1945 1 #> 7 255 211 1945 1 #> 8 255 260 1990 1 #> 9 255 265 1990 1 #> 10 255 290 1945 1 #> # … with 50 more rows false_gw_dyads #> # A tibble: 38 × 4 #> gwcode1 gwcode2 year in_ps #> #> 1 99 100 1830 1 #> 2 99 211 1830 1 #> 3 100 99 1830 1 #> 4 100 615 1830 1 #> 5 115 817 1975 1 #> 6 211 99 1830 1 #> 7 211 615 1830 1 #> 8 255 850 1945 1 #> 9 300 305 1918 1 #> 10 300 345 1918 1 #> # … with 28 more rows check_both <- function(x) { gw_states %>% mutate(data = \"G-W\") %>% filter(gwcode %in% x) -> gwrows cow_states %>% mutate(startdate = ymd(paste0(styear,\"/\",stmonth, \"/\", stday)), enddate = ymd(paste0(endyear,\"/\",endmonth,\"/\",endday))) %>% select(stateabb:statenme, startdate, enddate) %>% mutate(data = \"CoW\") %>% rename(statename = statenme) %>% filter(ccode %in% x) -> cowrows dat <- bind_rows(gwrows, cowrows) %>% select(gwcode, ccode, stateabb, everything()) return(dat) } check_both(c(115, 817)) #> # A tibble: 4 × 7 #> gwcode ccode stateabb statename startdate enddate data #> #> 1 115 NA SUR Surinam 1975-11-25 2017-12-31 G-W #> 2 817 NA RVN Vietnam, Republic of 1954-05-01 1975-04-30 G-W #> 3 NA 115 SUR Suriname 1975-11-25 2016-12-31 CoW #> 4 NA 817 RVN Republic of Vietnam 1954-06-04 1975-04-30 CoW valid_dyads <- tibble(ccode1 = c(2, 20, 200), ccode2 = c(20, 200, 900), year = c(2016, 2017, 2018)) valid_dyads %>% bind_rows(., false_cow_dyads %>% select(ccode1:year)) -> valid_and_invalid valid_and_invalid #> # A tibble: 63 × 3 #> ccode1 ccode2 year #> #> 1 2 20 2016 #> 2 20 200 2017 #> 3 200 900 2018 #> 4 115 817 1975 #> 5 210 255 1945 #> 6 211 255 1945 #> 7 223 678 1990 #> 8 223 680 1990 #> 9 255 210 1945 #> 10 255 211 1945 #> # … with 53 more rows valid_and_invalid %>% # remove those invalid dyads-years anti_join(., false_cow_dyads) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 3 × 3 #> ccode1 ccode2 year #> #> 1 2 20 2016 #> 2 20 200 2017 #> 3 200 900 2018"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"create-a-new-state-variable","dir":"Articles","previous_headings":"","what":"Create a “New State” Variable","title":"Various Parlor Tricks in `{peacesciencer}`","text":"manuscript includes partial replication state-year civil conflict analysis analogous Fearon Laitin (2003) Gibler Miller (2014). analyses include “new state” variable, arguing states within first two years existence likely experience civil war onset. partial replication include . easiest way create variable group_by() mutate based row number group, group_by() unfortunate side effect erasing attributes data (.e. ps_system ps_type attributes). break peacesciencer pipe. want variable, recommend creating merging variable creating bulk data. ’s ’d .","code":"# Hypothetical main data create_stateyears(system = 'gw') %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd(type = \"intrastate\") %>% add_peace_years() -> Data #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(gwcode, year)` # Add in new state variable after the fact create_stateyears(system = 'gw') %>% group_by(gwcode) %>% mutate(newstate = ifelse(row_number() <= 2, 1, 0)) %>% left_join(Data, .) %>% select(gwcode:ucdponset, newstate, everything()) -> Data #> Joining with `by = join_by(gwcode, statename, year)` # Proof of concept: Here's India Data %>% filter(gwcode == 750) #> # A tibble: 73 × 9 #> gwcode statename year ucdpongoing ucdponset newstate maxin…¹ confl…² ucdps…³ #> #> 1 750 India 1947 0 0 1 NA NA 0 #> 2 750 India 1948 1 1 1 2 227 1 #> 3 750 India 1949 1 0 0 2 227 0 #> 4 750 India 1950 1 0 0 2 227 0 #> 5 750 India 1951 1 0 0 2 227 0 #> 6 750 India 1952 0 0 0 NA NA 0 #> 7 750 India 1953 0 0 0 NA NA 1 #> 8 750 India 1954 0 0 0 NA NA 2 #> 9 750 India 1955 0 0 0 NA NA 3 #> 10 750 India 1956 1 1 0 1 251 4 #> # … with 63 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids, ³​ucdpspell # And here's Belize Data %>% filter(gwcode == 80) #> # A tibble: 39 × 9 #> gwcode statename year ucdpongoing ucdponset newstate maxin…¹ confl…² ucdps…³ #> #> 1 80 Belize 1981 0 0 1 NA NA 0 #> 2 80 Belize 1982 0 0 1 NA NA 1 #> 3 80 Belize 1983 0 0 0 NA NA 2 #> 4 80 Belize 1984 0 0 0 NA NA 3 #> 5 80 Belize 1985 0 0 0 NA NA 4 #> 6 80 Belize 1986 0 0 0 NA NA 5 #> 7 80 Belize 1987 0 0 0 NA NA 6 #> 8 80 Belize 1988 0 0 0 NA NA 7 #> 9 80 Belize 1989 0 0 0 NA NA 8 #> 10 80 Belize 1990 0 0 0 NA NA 9 #> # … with 29 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids, ³​ucdpspell"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"code-capabilitiesdevelopmentmilitarization-as-bremer-1992-did","dir":"Articles","previous_headings":"","what":"Code Capabilities/Development/Militarization as Bremer (1992) Did","title":"Various Parlor Tricks in `{peacesciencer}`","text":"manuscript includes replication Bremer’s (1992) “dangerous dyads” design, albeit one leverages newer/better data sources unavailable Bremer time. convenience’s sake, replication used approaches estimating Bremer’s variables, including “weak-link” mechanisms Dixon (1994) introduced seminal work democratic conflict resolution. user wanted recreate covariates Bremer (1992) , . covariates question concern information grabbed Correlates War national material capabilities data set.1 example, user guide recreates “relative power” variable proportion lower composite index national capabilities (CINC) variable higher one. Bremer opts different approach, defining “relative power” variable three-part ordinal category powerful side CINC score 1) 10 times higher less powerful side, 2) three times higher side, 3) less three times higher side. exact passage p. 322. Based CINC scores, computed larger--smaller capability ratios dyad-years classified three groups. capability ratio less equal three, dyad considered constitute case small power difference. ratio larger 10, power difference coded large, whereas ratio 3 10 coded medium power difference. either CINC scores missing (equal zero) ratio calculation, power difference score dyad coded missing also. easy case_when() function, also ’ve consumed space words manuscript allocated journal space allow. ’s added difficulty making sure identify side non-directed dyad-year powerful. Next, manuscript codes Bremer’s (1992) development/“advanced economies” measure using weak-link lower GDP per capita dyad using simulations Anders et al. (2020). defense, exactly kind data Bremer wishes available . says footnote 26 page 324. optimistic assumptions data availability, estimate number dyad-years relevant data [GNP GDP per capita] assembled less 20% total dyad-years consideration. realistic estimate might low 10%. Clearly, ability test generalization 80% 90% needed data missing limited, especially case, missing data concentrated heavily pre-World War II era less advanced states. Given limitation, Bremer uses approach coding development/“advanced economies” measure. economically advanced state characterized possessing share system-wide economic capability greater share system-wide demographic capability. Hence, years found true, classified state advanced; otherwise, less advanced. next step involved examining pair states year assigning one three groups: advanced (7,160 dyad-years), one advanced (61,823 dyad-years), less advanced (128,939 dyad-years). Replicating approach going require group-summaries raw national material capabilities data, outside peacesciencer’s core functionality. Bremer’s wording little vague; doesn’t explain variable, variables, comprise “economic capability” “demographic capability.” Let’s assume “demographic capability” just total population variable whereas “economic capability” variables include iron steel production primary energy consumption. variable look something like . Now, let’s merge Bremer data frame created. ’ll make ordinal variable well 2, 1, 0 ordering scheme. Finally, manuscript creates militarization measure weak-link uses data military personnel total population. Bremer opts approach similar development indicator uses. Instead, relied material capabilities data set discussed , classified state militarized share system-wide military capabilities greater share system-wide demographic capabilities. classified less militarized true. classification dyad-year based whether , one, neither two states making dyad militarized year. reads like ’s , reiterating ’m assuming ’s using just total population variable measure “demographic capability.” Let’s merge Bremer data created inspect output. wanted perfectly recreate data Bremer (1992) almost 30 years ago, ’s ’d peacesciencer (albeit newer data). Still, think data innovations followed Bremer (1992) merit approach employed manuscript.","code":"cow_ddy %>% # built-in data set for convenience filter(ccode2 > ccode1) %>% # make it non-directed # add CINC scores add_nmc() %>% # select just what we want select(ccode1:year, cinc1, cinc2) -> Bremer Bremer %>% # create a three-item ordinal relative power category with values 2, 1, and 0 mutate(relpow = case_when( (cinc1 > cinc2) & (cinc1 > 10*cinc2) ~ 2, (cinc1 > cinc2) & ((cinc1 > 3*cinc2) & (cinc1 < 10*cinc2)) ~ 1, (cinc1 > cinc2) & (cinc1 <= 3*cinc2) ~ 0, # copy-paste, re-arrange (cinc2 > cinc1) & (cinc2 > 10*cinc1) ~ 2, (cinc2 > cinc1) & ((cinc2 > 3*cinc1) & (cinc2 < 10*cinc1))~ 1, (cinc2 > cinc1) & (cinc2 <= 3*cinc1) ~ 0, TRUE ~ NA_real_ )) -> relpow_example # Let's inspect the output. relpow_example %>% na.omit %>% mutate(whichside = ifelse(cinc1 > cinc2, \"ccode1 > ccode2\", \"ccode2 >= ccode1\")) %>% group_split(whichside, relpow) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> cinc1 : double #> cinc2 : double #> relpow : double #> whichside: character #> > #> >[6]> #> [[1]] #> # A tibble: 132,639 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1892 0.173 0.173 0 ccode1 > ccode2 #> 2 2 200 1897 0.169 0.166 0 ccode1 > ccode2 #> 3 2 200 1898 0.197 0.157 0 ccode1 > ccode2 #> 4 2 200 1899 0.185 0.169 0 ccode1 > ccode2 #> 5 2 200 1900 0.188 0.178 0 ccode1 > ccode2 #> 6 2 200 1901 0.203 0.174 0 ccode1 > ccode2 #> 7 2 200 1902 0.208 0.161 0 ccode1 > ccode2 #> 8 2 200 1903 0.210 0.143 0 ccode1 > ccode2 #> 9 2 200 1904 0.205 0.135 0 ccode1 > ccode2 #> 10 2 200 1905 0.214 0.121 0 ccode1 > ccode2 #> # … with 132,629 more rows #> #> [[2]] #> # A tibble: 114,225 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 70 1831 0.0420 0.00945 1 ccode1 > ccode2 #> 2 2 70 1832 0.0445 0.00963 1 ccode1 > ccode2 #> 3 2 70 1833 0.0481 0.00958 1 ccode1 > ccode2 #> 4 2 70 1834 0.0478 0.00971 1 ccode1 > ccode2 #> 5 2 70 1835 0.0485 0.00980 1 ccode1 > ccode2 #> 6 2 70 1836 0.0510 0.00941 1 ccode1 > ccode2 #> 7 2 70 1837 0.0535 0.00975 1 ccode1 > ccode2 #> 8 2 70 1838 0.0533 0.00966 1 ccode1 > ccode2 #> 9 2 70 1839 0.0508 0.00948 1 ccode1 > ccode2 #> 10 2 70 1840 0.0495 0.00898 1 ccode1 > ccode2 #> # … with 114,215 more rows #> #> [[3]] #> # A tibble: 198,867 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 20 1920 0.290 0.0101 2 ccode1 > ccode2 #> 2 2 20 1921 0.253 0.0105 2 ccode1 > ccode2 #> 3 2 20 1922 0.256 0.00841 2 ccode1 > ccode2 #> 4 2 20 1923 0.272 0.00986 2 ccode1 > ccode2 #> 5 2 20 1924 0.254 0.00889 2 ccode1 > ccode2 #> 6 2 20 1925 0.254 0.00870 2 ccode1 > ccode2 #> 7 2 20 1926 0.263 0.00924 2 ccode1 > ccode2 #> 8 2 20 1927 0.239 0.00937 2 ccode1 > ccode2 #> 9 2 20 1928 0.240 0.00970 2 ccode1 > ccode2 #> 10 2 20 1929 0.240 0.00980 2 ccode1 > ccode2 #> # … with 198,857 more rows #> #> [[4]] #> # A tibble: 141,100 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1861 0.144 0.258 0 ccode2 >= ccode1 #> 2 2 200 1862 0.176 0.251 0 ccode2 >= ccode1 #> 3 2 200 1863 0.179 0.251 0 ccode2 >= ccode1 #> 4 2 200 1864 0.193 0.243 0 ccode2 >= ccode1 #> 5 2 200 1865 0.135 0.256 0 ccode2 >= ccode1 #> 6 2 200 1866 0.0982 0.248 0 ccode2 >= ccode1 #> 7 2 200 1867 0.114 0.253 0 ccode2 >= ccode1 #> 8 2 200 1868 0.107 0.253 0 ccode2 >= ccode1 #> 9 2 200 1869 0.108 0.246 0 ccode2 >= ccode1 #> 10 2 200 1870 0.0990 0.242 0 ccode2 >= ccode1 #> # … with 141,090 more rows #> #> [[5]] #> # A tibble: 133,564 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1816 0.0397 0.337 1 ccode2 >= ccode1 #> 2 2 200 1817 0.0358 0.328 1 ccode2 >= ccode1 #> 3 2 200 1818 0.0361 0.329 1 ccode2 >= ccode1 #> 4 2 200 1819 0.0371 0.317 1 ccode2 >= ccode1 #> 5 2 200 1820 0.0371 0.317 1 ccode2 >= ccode1 #> 6 2 200 1821 0.0342 0.317 1 ccode2 >= ccode1 #> 7 2 200 1822 0.0329 0.311 1 ccode2 >= ccode1 #> 8 2 200 1823 0.0331 0.318 1 ccode2 >= ccode1 #> 9 2 200 1824 0.0330 0.330 1 ccode2 >= ccode1 #> 10 2 200 1825 0.0342 0.331 1 ccode2 >= ccode1 #> # … with 133,554 more rows #> #> [[6]] #> # A tibble: 235,749 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 20 200 1920 0.0101 0.128 2 ccode2 >= ccode1 #> 2 20 200 1922 0.00841 0.0945 2 ccode2 >= ccode1 #> 3 20 200 1923 0.00986 0.0990 2 ccode2 >= ccode1 #> 4 20 200 1924 0.00889 0.107 2 ccode2 >= ccode1 #> 5 20 200 1925 0.00870 0.0956 2 ccode2 >= ccode1 #> 6 20 200 1939 0.00909 0.0997 2 ccode2 >= ccode1 #> 7 20 255 1934 0.00891 0.0891 2 ccode2 >= ccode1 #> 8 20 255 1935 0.00874 0.103 2 ccode2 >= ccode1 #> 9 20 255 1936 0.00865 0.115 2 ccode2 >= ccode1 #> 10 20 255 1937 0.00893 0.118 2 ccode2 >= ccode1 #> # … with 235,739 more rows cow_nmc %>% group_by(year) %>% # calculate year proportions mutate(prop_tpop = tpop/sum(tpop, na.rm=T), prop_irst = irst/sum(irst, na.rm=T), prop_pec = pec/sum(pec, na.rm=T)) %>% ungroup() %>% # standardize an \"economic capability\" measure # then make an advanced dummy mutate(econcap = (prop_irst + prop_pec)/2, advanced = ifelse(econcap > prop_tpop, 1, 0)) %>% select(ccode, year, prop_tpop:ncol(.)) -> Advanced Advanced #> # A tibble: 15,951 × 7 #> ccode year prop_tpop prop_irst prop_pec econcap advanced #> #> 1 2 1816 0.0398 0.0954 0.00966 0.0525 1 #> 2 2 1817 0.0404 0.0938 0.0103 0.0520 1 #> 3 2 1818 0.0411 0.102 0.0110 0.0564 1 #> 4 2 1819 0.0416 0.101 0.0104 0.0555 1 #> 5 2 1820 0.0422 0.113 0.0105 0.0617 1 #> 6 2 1821 0.0430 0.0927 0.0108 0.0518 1 #> 7 2 1822 0.0431 0.0950 0.0109 0.0530 1 #> 8 2 1823 0.0439 0.0933 0.0111 0.0522 1 #> 9 2 1824 0.0447 0.0861 0.0122 0.0491 1 #> 10 2 1825 0.0453 0.0891 0.0129 0.0510 1 #> # … with 15,941 more rows Bremer %>% left_join(., Advanced %>% select(ccode, year, advanced) %>% rename(ccode1 = ccode, advanced1 = advanced)) %>% left_join(., Advanced %>% select(ccode, year, advanced) %>% rename(ccode2 = ccode, advanced2 = advanced)) %>% mutate(advancedcat = case_when( advanced1 == 1 & advanced2 == 1 ~ 2, (advanced1 == 1 & advanced2 == 0) | (advanced1 == 0 & advanced2 == 1) ~ 1, advanced1 == 0 & advanced2 == 0 ~ 0 )) -> Bremer #> Joining with `by = join_by(ccode1, year)` #> Joining with `by = join_by(ccode2, year)` # Let's inspect the output Bremer %>% na.omit %>% group_split(advancedcat) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> cinc1 : double #> cinc2 : double #> advanced1 : double #> advanced2 : double #> advancedcat: double #> > #> >[3]> #> [[1]] #> # A tibble: 538,707 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 31 40 1986 0.0000349 0.00326 0 0 0 #> 2 31 40 1987 0.0000349 0.00328 0 0 0 #> 3 31 40 1988 0.0000460 0.00334 0 0 0 #> 4 31 40 1989 0.0000584 0.00335 0 0 0 #> 5 31 40 1990 0.0000511 0.00325 0 0 0 #> 6 31 40 1991 0.0000432 0.00330 0 0 0 #> 7 31 40 1992 0.0000444 0.00271 0 0 0 #> 8 31 40 1993 0.0000479 0.00265 0 0 0 #> 9 31 40 1994 0.0000365 0.00198 0 0 0 #> 10 31 40 1995 0.0000355 0.00161 0 0 0 #> # … with 538,697 more rows #> #> [[2]] #> # A tibble: 344,483 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 2 31 1986 0.135 0.0000349 1 0 1 #> 2 2 31 1987 0.134 0.0000349 1 0 1 #> 3 2 31 1988 0.134 0.0000460 1 0 1 #> 4 2 31 1989 0.148 0.0000584 1 0 1 #> 5 2 31 1990 0.141 0.0000511 1 0 1 #> 6 2 31 1991 0.137 0.0000432 1 0 1 #> 7 2 31 1992 0.148 0.0000444 1 0 1 #> 8 2 31 1993 0.153 0.0000479 1 0 1 #> 9 2 31 1994 0.146 0.0000365 1 0 1 #> 10 2 31 1995 0.140 0.0000355 1 0 1 #> # … with 344,473 more rows #> #> [[3]] #> # A tibble: 54,945 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 2 20 1920 0.290 0.0101 1 1 2 #> 2 2 20 1921 0.253 0.0105 1 1 2 #> 3 2 20 1922 0.256 0.00841 1 1 2 #> 4 2 20 1923 0.272 0.00986 1 1 2 #> 5 2 20 1924 0.254 0.00889 1 1 2 #> 6 2 20 1925 0.254 0.00870 1 1 2 #> 7 2 20 1926 0.263 0.00924 1 1 2 #> 8 2 20 1927 0.239 0.00937 1 1 2 #> 9 2 20 1928 0.240 0.00970 1 1 2 #> 10 2 20 1929 0.240 0.00980 1 1 2 #> # … with 54,935 more rows cow_nmc %>% group_by(year) %>% # calculate year proportions mutate(prop_tpop = tpop/sum(tpop, na.rm=T), prop_milex = milex/sum(milex, na.rm=T), prop_milper = milper/sum(milper, na.rm=T)) %>% ungroup() %>% # standardize a \"military capability\" measure # then make an advanced dummy mutate(militcap = (prop_milper + prop_milex)/2, militarized = ifelse(militcap > prop_tpop, 1, 0)) %>% select(ccode, year, prop_tpop:ncol(.)) -> Militarized Militarized #> # A tibble: 15,951 × 7 #> ccode year prop_tpop prop_milex prop_milper militcap militarized #> #> 1 2 1816 0.0398 0.0682 0.00859 0.0384 0 #> 2 2 1817 0.0404 0.0451 0.00827 0.0267 0 #> 3 2 1818 0.0411 0.0370 0.00832 0.0227 0 #> 4 2 1819 0.0416 0.0449 0.00709 0.0260 0 #> 5 2 1820 0.0422 0.0310 0.00733 0.0192 0 #> 6 2 1821 0.0430 0.0345 0.00486 0.0197 0 #> 7 2 1822 0.0431 0.0249 0.00417 0.0146 0 #> 8 2 1823 0.0439 0.0249 0.00534 0.0151 0 #> 9 2 1824 0.0447 0.0295 0.00474 0.0171 0 #> 10 2 1825 0.0453 0.0321 0.00511 0.0186 0 #> # … with 15,941 more rows Bremer %>% left_join(., Militarized %>% select(ccode, year, militarized) %>% rename(ccode1 = ccode, militarized1 = militarized)) %>% left_join(., Militarized %>% select(ccode, year, militarized) %>% rename(ccode2 = ccode, militarized2 = militarized)) %>% mutate(militcat = case_when( militarized1 == 1 & militarized2 == 1 ~ 2, (militarized1 == 1 & militarized2 == 0) | (advanced1 == 0 & militarized2 == 1) ~ 1, militarized1 == 0 & militarized2 == 0 ~ 0 )) -> Bremer #> Joining with `by = join_by(ccode1, year)` #> Joining with `by = join_by(ccode2, year)` Bremer %>% select(ccode1:year, militarized1:ncol(.)) %>% na.omit %>% group_split(militcat) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> militarized1: double #> militarized2: double #> militcat : double #> > #> >[3]> #> [[1]] #> # A tibble: 303,368 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1923 0 0 0 #> 2 2 20 1925 0 0 0 #> 3 2 20 1926 0 0 0 #> 4 2 20 1927 0 0 0 #> 5 2 20 1928 0 0 0 #> 6 2 20 1929 0 0 0 #> 7 2 20 1930 0 0 0 #> 8 2 20 1931 0 0 0 #> 9 2 20 1932 0 0 0 #> 10 2 20 1933 0 0 0 #> # … with 303,358 more rows #> #> [[2]] #> # A tibble: 340,196 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1920 1 0 1 #> 2 2 20 1921 1 0 1 #> 3 2 20 1922 1 0 1 #> 4 2 20 1924 1 0 1 #> 5 2 20 1947 1 0 1 #> 6 2 20 1948 1 0 1 #> 7 2 20 1949 1 0 1 #> 8 2 20 1950 1 0 1 #> 9 2 20 1971 1 0 1 #> 10 2 20 1973 1 0 1 #> # … with 340,186 more rows #> #> [[3]] #> # A tibble: 112,758 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1942 1 1 2 #> 2 2 20 1943 1 1 2 #> 3 2 20 1944 1 1 2 #> 4 2 20 1945 1 1 2 #> 5 2 20 1946 1 1 2 #> 6 2 20 1951 1 1 2 #> 7 2 20 1952 1 1 2 #> 8 2 20 1953 1 1 2 #> 9 2 20 1954 1 1 2 #> 10 2 20 1955 1 1 2 #> # … with 112,748 more rows"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"get-multiple-peace-years-in-one-fell-swoop","dir":"Articles","previous_headings":"","what":"Get Multiple Peace Years in One Fell Swoop","title":"Various Parlor Tricks in `{peacesciencer}`","text":"add_peace_years() designed work generally, based data/functions included package. example, assume wanted dyad-year analysis comparing Correlates War (CoW) Militarized Interstate Dispute (MID) Gibler-Miller-Little conflict data. Just add pipe ask peace-years. can state-year data well. example, can compare CoW UCDP code civil wars differently since 1946. note, however, nature different state systems used data sets means ’ll treat one master merge codes .","code":"cow_ddy %>% # non-directed, politically relevant, for convenience filter(ccode2 > ccode1) %>% filter_prd() %>% add_cow_mids(keep = NULL) %>% add_gml_mids(keep = NULL) %>% add_peace_years() -> NDY #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles #> dispute-year data into dyad-year data by first selecting on unique onsets. #> Thereafter, where duplicates remain, it whittles dispute-year data into #> dyad-year data in the following order: 1) retaining highest `fatality`, 2) #> retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) #> retaining highest estimated `maxdur`, 5) retaining reciprocated over #> non-reciprocated observations, 6) retaining the observation with the lowest #> start month, and, where duplicates still remained (and they don't), 7) forcibly #> dropping all duplicates for observations that are otherwise very similar. See: #> http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Dyadic data are non-directed and initiation variables make no sense in this #> context. #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles #> dispute-year data into dyad-year data by first selecting on unique onsets. #> Thereafter, where duplicates remain, it whittles dispute-year data into #> dyad-year data in the following order: 1) retaining highest `fatality`, 2) #> retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) #> retaining highest estimated `maxdur`, 5) retaining reciprocated over #> non-reciprocated observations, 6) retaining the observation with the lowest #> start month, and, where duplicates still remained (and they don't), 7) forcibly #> dropping all duplicates for observations that are otherwise very similar. See: #> http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(year, dyad)` #> Joining with `by = join_by(year, dyad)` # Here's a snapshot of U.S-Cuba from 1980-89 for illustration sake. NDY %>% filter(ccode1 == 2 & ccode2 == 40) %>% select(ccode1:year, cowmidongoing, gmlmidongoing, cowmidspell:gmlmidspell) %>% filter(year >= 1980) #> # A tibble: 37 × 7 #> ccode1 ccode2 year cowmidongoing gmlmidongoing cowmidspell gmlmidspell #> #> 1 2 40 1980 0 0 0 0 #> 2 2 40 1981 1 1 1 1 #> 3 2 40 1982 0 0 0 0 #> 4 2 40 1983 1 1 1 1 #> 5 2 40 1984 0 0 0 0 #> 6 2 40 1985 0 0 1 1 #> 7 2 40 1986 0 1 2 2 #> 8 2 40 1987 1 1 3 0 #> 9 2 40 1988 0 0 0 0 #> 10 2 40 1989 0 0 1 1 #> # … with 27 more rows create_stateyears(system = 'gw') %>% filter(between(year, 1946, 2019)) %>% add_ccode_to_gw() %>% add_ucdp_acd(type = \"intrastate\", only_wars = TRUE) %>% add_cow_wars(type = \"intra\") %>% # select just a few things select(gwcode, ccode, year, statename, ucdpongoing, ucdponset, cowintraongoing, cowintraonset) %>% add_peace_years() %>% select(gwcode:statename, ucdpspell, cowintraspell, everything()) %>% # India is illustrative of how the two differ. # UCDP has an intra-state conflict to the level of war early # into its existence. CoW does not. filter(gwcode == 750) #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(year, ccode)` #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, year)` #> # A tibble: 73 × 10 #> gwcode ccode year statename ucdpsp…¹ cowin…² ucdpo…³ ucdpo…⁴ cowin…⁵ cowin…⁶ #> #> 1 750 750 1947 India 0 0 0 0 0 0 #> 2 750 750 1948 India 1 1 1 1 0 0 #> 3 750 750 1949 India 0 2 1 0 0 0 #> 4 750 750 1950 India 0 3 1 0 0 0 #> 5 750 750 1951 India 0 4 1 0 0 0 #> 6 750 750 1952 India 0 5 0 0 0 0 #> 7 750 750 1953 India 1 6 0 0 0 0 #> 8 750 750 1954 India 2 7 0 0 0 0 #> 9 750 750 1955 India 3 8 0 0 0 0 #> 10 750 750 1956 India 4 9 0 0 0 0 #> # … with 63 more rows, and abbreviated variable names ¹​ucdpspell, #> # ²​cowintraspell, ³​ucdpongoing, ⁴​ucdponset, ⁵​cowintraongoing, ⁶​cowintraonset"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"measure-leader-tenure-in-days","dir":"Articles","previous_headings":"","what":"Measure Leader Tenure in Days","title":"Various Parlor Tricks in `{peacesciencer}`","text":"create_leaderyears(), default, returns estimate leader-tenure unique calendar year leader. think reasonable thing include, benchmarking years internal lifting elsewhere function generates leader-year data leader-day data Archigos. However, can lead peculiar observations may square knee-jerk think leader tenure. illustrate mean case Jimmy Carter leader-year data standardized Correlates War state system membership. Jimmy Carter took office January 1977 (year 1) tenure 1978 (year 2), 1979 (year 3), 1980 (year 4), exited office January 1981 (year 5). know presidents American context four-year terms. output suggests five years. problematic research design, especially one may interested happens leader behavior certain amount time office, user can something like generate estimates leader tenure given year day. Basically, core leader-year generated, user can use create_leaderdays() function summarize leader tenure year minimum number days leader office year maximum number days leader office year. ’s look like case Jimmy Carter. measure might useful. Basically, Jimmy Carter new leader 1977 (min_daysoffice = 1). 1978, almost year belt (.e. Jan. 1, 1978 347th day office). time left office 1981, completed 1,462 days job. create_leaderyears() elects create information user. matter, take much effort user create kind information wanted.","code":"leader_years <- create_leaderyears(standardize = 'cow') #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, date)` leader_years %>% filter(obsid == \"USA-1977\") #> # A tibble: 5 × 7 #> obsid leader ccode gender leaderage year yrinoffice #> #> 1 USA-1977 Carter 2 M 53 1977 1 #> 2 USA-1977 Carter 2 M 54 1978 2 #> 3 USA-1977 Carter 2 M 55 1979 3 #> 4 USA-1977 Carter 2 M 56 1980 4 #> 5 USA-1977 Carter 2 M 57 1981 5 # don't standardize the leader-days for this use, just to be safe. create_leaderdays(standardize = 'none') %>% # extract year from date mutate(year = lubridate::year(date)) %>% # group by leader group_by(obsid) %>% # count days in office, for leader tenure mutate(daysinoffice = seq(1:n())) %>% # group-by leader and year group_by(obsid, year) %>% # how long was the minimum (maximum) days in office for the leader in the year? summarize(min_daysoffice = min(daysinoffice), max_dayoffice = max(daysinoffice)) %>% #practice safe group-by, and assign to object ungroup() -> leader_tenures #> `summarise()` has grouped output by 'obsid'. You can override using the #> `.groups` argument. # add this information to our data leader_years %>% left_join(., leader_tenures) -> leader_years #> Joining with `by = join_by(obsid, year)` leader_years %>% filter(obsid == \"USA-1977\") #> # A tibble: 5 × 9 #> obsid leader ccode gender leaderage year yrinoffice min_daysoffice max_d…¹ #> #> 1 USA-1977 Carter 2 M 53 1977 1 1 346 #> 2 USA-1977 Carter 2 M 54 1978 2 347 711 #> 3 USA-1977 Carter 2 M 55 1979 3 712 1076 #> 4 USA-1977 Carter 2 M 56 1980 4 1077 1442 #> 5 USA-1977 Carter 2 M 57 1981 5 1443 1462 #> # … with abbreviated variable name ¹​max_dayoffice"},{"path":"http://svmiller.com/articles/state-systems.html","id":"where-the-systems-conflict-with-each-other","dir":"Articles","previous_headings":"","what":"Where the Systems Conflict With Each Other","title":"A Discussion of the Two State Systems (CoW, G-W) in `{peacesciencer}`","text":"large, user might see differences two systems overstate differences see, least practical concerns. example, CoW treats Canada independent state starting 1920 (coinciding founding membership League Nations, one coding criteria) whereas G-W Canada independent state starting 1867 (coinciding British North America Act, 1867). However, code Canada (20) identical systems Canada never period disappeared either system. cases simple; one temporal domain subset system’s temporal domain particular state. differences note. G-W states CoW doesn’t (e.g. Transvaal Orange Free State) CoW states G-W don’t (e.g. Sao Tome Principe Seychelles). cases simple; corresponding state code entity system. commonality apparent differences (least think), lot differences pose real problem integrating one . Yet, also true differ, sometimes really differ. Trying integrate one amounts collision. example two systems collide . Yemeni unification one several points divergence two systems. Unlike, say, dissolution Yugoslavia, CoW G-W agreement unification took place (22 May 1990). However, disagree means data entry. unaware either G-W CoW discussing exact case, difference interpretation mirrors (likely) see unification Germany year. CoW seems interpret Yemeni unification creation unseen, entirely new Yemeni state just simple integration one . Thus, newly formed Republic Yemen (“Yemen”) gets new state code.2 G-W seem interpret unification less case formation new state, demise People’s Democratic Republic Yemen (“South Yemen”) integration Yemen Arab Republic (“North Yemen”). new code new entity, just continuation “Yemen (Arab Republic Yemen)” demise “Yemen, People’s Republic .” might seem like ’s distinction without much difference, matter standard peace science data. , example, happen merge G-W codes CoW state-year data cases. G-W code 678 going duplicated twice data. G-W code 678 1990 refers Yemen Arab Republic unification, Yemen unification. CoW sees two states G-W sees one. state-day data, problem. state-year data, becomes problem aggregation time results duplicate entries code merged data. Worse yet, easy way around ’s unique issue arises trying integrate two different state systems . another case systems collide : Serbia Yugoslavia. case, state systems differ major ways classifying entities dates. main difference interpret Yugoslavia . Unlike case Yemen, G-W discuss Yugoslavia bit 1999 article. one passage page 397. Yugoslavia appears COW-list continuously 1878 1941. However,Serbian government fled German invasion 1915. new kingdom Serbia, Croatia, Montenegro proclaimed 1918 become Kingdom Yugoslavia 1929. sensible consider single polity? revisit case page 401 describing major differences system CoW’s system. Unlike COW, consider Serbia 1878 Austro-Hungarian invasion 1915 different polity Kingdom Croats, Serbs, Slovenes (renamed Yugoslavia 1929), established 1918. interesting difference interpretation whether Serbia disappear international system three-year period World War . CoW says “” G-W point government’s retreat Albania Austro-Hungarian/Bulgarian occupations suggestive “state” without territory (, thus, state). bigger difference interpretation concerns interpret “Yugoslavia.” CoW seems interpret Serbian “center” Yugoslavia, analogous interpretation (G-W’s interpretation) Prussian core German Empire. CoW, means Serbia precedes succeeds Yugoslavia Yugoslavia fundamentally territorial expansion Serbia result World War . G-W, 1915 retreat Serbian government 1918 creation State Slovenes, Croats Serbs amounts death one state (Serbia) formation new state (Yugoslavia) years later. Yugoslavia dies 2006 last remnant creation, Montenegro, emerges independent Serbia. Thus, Serbia reappears state system entity first time since 1915. integration run inverse situation Yemeni German unification 1990. cases, G-W see integration whereas CoW sees new state creation (case Yemen) old state restoration (case Germany). case, CoW sees one continuous state breaking apart whereas G-W see state death old state restoration. Correlates War state code 345 appear twice 2006, referring G-W state Serbia G-W state Yugoslavia year.","code":"create_stateyears() %>% filter(ccode %in% c(678:680) & year %in% c(1988:1991)) %>% add_gwcode_to_cow() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 8 × 4 #> ccode statenme year gwcode #> #> 1 678 Yemen Arab Republic 1988 678 #> 2 678 Yemen Arab Republic 1989 678 #> 3 678 Yemen Arab Republic 1990 678 #> 4 679 Yemen 1990 678 #> 5 679 Yemen 1991 678 #> 6 680 Yemen People's Republic 1988 680 #> 7 680 Yemen People's Republic 1989 680 #> 8 680 Yemen People's Republic 1990 680 cow_states %>% mutate(startdate = ymd(paste0(styear,\"/\",stmonth, \"/\", stday)), enddate = ymd(paste0(endyear,\"/\",endmonth,\"/\",endday))) %>% select(stateabb:statenme, startdate, enddate) %>% mutate(data = \"CoW\") %>% rename(statename = statenme) %>% filter(ccode == 345) %>% bind_rows(., gw_states %>% filter(gwcode %in% c(340, 345)) %>% mutate(data = \"G-W\")) %>% select(data, stateabb, statename, ccode, gwcode, everything()) #> # A tibble: 5 × 7 #> data stateabb statename ccode gwcode startdate enddate #> #> 1 CoW YUG Yugoslavia 345 NA 1878-07-13 1941-04-20 #> 2 CoW YUG Yugoslavia 345 NA 1944-10-20 2016-12-31 #> 3 G-W SER Serbia NA 340 1878-07-13 1915-10-01 #> 4 G-W SER Serbia NA 340 2006-06-05 2017-12-31 #> 5 G-W YUG Yugoslavia NA 345 1918-12-01 2006-06-04 create_stateyears(system = 'gw') %>% filter(gwcode %in% c(340, 345) & year %in% c(2005:2008)) %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 5 × 4 #> gwcode statename year ccode #> #> 1 340 Serbia 2006 345 #> 2 340 Serbia 2007 345 #> 3 340 Serbia 2008 345 #> 4 345 Yugoslavia 2005 345 #> 5 345 Yugoslavia 2006 345"},{"path":"http://svmiller.com/articles/state-systems.html","id":"how-peacesciencer-handles-the-integration-of-cow-and-g-w-state-system-data","dir":"Articles","previous_headings":"","what":"How {peacesciencer} Handles the Integration of CoW and G-W State System Data","title":"A Discussion of the Two State Systems (CoW, G-W) in `{peacesciencer}`","text":"peacesciencer two functions converting CoW codes G-W codes (vice-versa). add_ccode_to_gw() take data set ps_system attribute “gw” match G-W codes CoW codes. data uses gw_cow_years data frame package. can see created (along ample annotation ’m , two differ, ’m ’m ). corollary add_gwcode_to_cow(), adds G-W codes data frame ps_system attribute “cow”. function uses cow_gw_years data frame package. code generates data also amply annotated available public viewing. implementation philosophy important state . break philosophy following main points. First, collisions G-W state system data CoW state system data unavoidable higher levels temporal aggregation (e.g. state-years). user trying merge G-W codes CoW state-year data, create duplicate G-W state codes 1990 Yemen Arab Republic/Yemen (Germany/West Germany). CoW sees two states merging one new (Yemen) previous (Germany) state G-W see one folding . similar situation happen trying merge CoW codes G-W state-year data regarding final disintegration Yugoslavia 2006. CoW sees Serbia preceding, dominating, succeeding Yugoslavia G-W see Yugoslavia entity entirely distinct Serbia. Consider implication : user may Gleditsch-Ward state-year data civil conflict analysis want merge CoW’s national material capabilities data . Matching CoW codes G-W state codes beforehand invariably create duplicate entries Serbia-2006 Yugoslavia-2006. user avoid . happen two state systems collide . Second, functionality build peacesciencer comes philosophy classification system must “master” system. preach students well. user elects treat “master” system discretion, peacesciencer forces user important way. Namely, “create” family functions assign ps_system attribute data creates. user starts workflow create_stateyears(system = 'gw'), get state-year data frame “master” system G-W. user instead wants CoW master system, run create_stateyears(system = 'cow') create_stateyears(system = 'gw'). ultimately design choice user, peacesciencer force way. Something must “master” system. ’s worth stating right wrong answer user’s choice tailored research design. recommendation take one two tracks toward choosing “master” system. One approach make “master” system one coinciding bulk data author use. CoW larger presence G-W peace science data ecosystem, certainly “right-hand side” variables (e.g. capabilities, trade) inter-state conflict. Whereas primarily inter-state conflict researcher, account CoW default option data-creation functions. reasonable approach make “master” system one coinciding outcome variable. Think way. user creating data peacesciencer want explain outcome. Let’s say interested explaining intrastate conflict levels intensity UCDP armed conflict data. conflicts use G-W system classification. data collect fundamentally nested universe G-W state-year data since 1946. important, principle, get part right split hairs Yemen, Germany, Serbia/Yugoslavia. conditions, user make G-W system master (e.g. create_stateyears(system = 'gw')). Finally, peacesciencer strives make integration seamless possible can. example, add_minimum_distance() look data user feeds see “master” system. ’s CoW, add_minimum_distance() merge minimum distance data cow_mindist data frame package. ’s G-W system, add_minimum_distance() merge minimum distance data gw_mindist data frame. add_sdp_gdp() add_democracy() also . Collisions CoW state system data G-W state system data unavoidable; example, anything CoW ecosystem (e.g. alliances, IGOs, capabilities) going require CoW codes merging. possible, peacesciencer tries inclusive avoid elevating one can. end result suite functions peacesciencer work well robustly, given circumstances. CoW system master, merging G-W codes result duplicate G-W codes given different interpretations German Yemeni unification. G-W system master, merging CoW codes result duplicate CoW codes given different interpretation disintegration Yugoslavia. unavoidable, functionality add_ccode_to_gw() add_gwcode_to_cow() importantly duplicate master codes. underlying data used functions pre-processed make sure happen. functions like add_minimum_distance(), add_sdp_gdp(), add_democracy() come CoW G-W flavors allow easier integration well. matter commonality systems, differ important ways create unavoidable collisions merging one . user aware even peacesciencer works well contain collisions occur.","code":""},{"path":"http://svmiller.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steve Miller. Author, maintainer.","code":""},{"path":"http://svmiller.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Miller, Steven V. Forthcoming. {peacesciencer}: R Package Quantitative Peace Science Research Conflict Management Peace Science http://svmiller.com/peacesciencer/","code":"@Article{peacesciencer-package, title = {{peacesciencer}: An R Package for Quantitative Peace Science Research}, author = {{Steven V. Miller}}, journal = {Conflict Management and Peace Science}, year = {2022}, url = {http://svmiller.com/peacesciencer/}, }"},{"path":"http://svmiller.com/index.html","id":"peacesciencer-tools-and-data-for-quantitative-peace-science","dir":"","previous_headings":"","what":"Tools and Data for Quantitative Peace Science Research","title":"Tools and Data for Quantitative Peace Science Research","text":"peacesciencer R package including various functions data sets allow easier analyses field quantitative peace science. goal provide R package reasonably approximates made EUGene attractive scholars working field quantitative peace science early 2000s. EUGene shined encouraged replications conflict models user also generate data scratch. Likewise, R package offer tools approximate EUGene within R environment (.e. requiring Windows installation).","code":""},{"path":"http://svmiller.com/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Tools and Data for Quantitative Peace Science Research","text":"can install CRAN, follows: can install development version package devtools package. development version package invariably goodies, may may various levels stress-testing.","code":"install.packages(\"peacesciencer\") devtools::install_github(\"svmiller/peacesciencer\")"},{"path":"http://svmiller.com/index.html","id":"how-to-use-peacesciencer","dir":"","previous_headings":"","what":"How to Use {peacesciencer}","title":"Tools and Data for Quantitative Peace Science Research","text":"New users read two things get started. package’s website exhaustive list description functions data included package. {peacesciencer} user’s guide worth reading. user’s guide points potential uses benefits also offering encouragement completely new R programming language. package designed accessible prior experience R, though completely new users feel lost overwhelmed learn “tidy” approach R help get started. workflow going look something like . First, start one two processes create either dyad-year state-year data. dyad-year data created create_dyadyears() function. optional parameters hidden defaults. user can specify kind state system (system) data want use—either Correlates War (\"cow\") Gleditsch-Ward (\"gw\"), whether want extend data recently concluded calendar year (mry) (.e. Correlates War state system membership data current Dec. 31, 2016 script can extend end recently concluded calendar year), whether user wants directed non-directed dyad-year data (directed). create_stateyears() works much way, though “directed” “non-directed” make sense state-year context. functions default Correlates War state system membership data recently concluded calendar year. Thereafter, user can specify additional variables want added dyad-year state-year data. note: additional functions lean primarily Correlates War state code identifiers. Indeed, bulk quantitative peace science data ecosystem built around Correlates War project. variables user wants added “pipe” process like . note user may want break data-generating process manageable “chunks” (e.g. first generating dyad-year data saving object, adding piece piece). ’s look like operation. Assume want create data something analogous “dangerous dyads” design non-directed dyad-years. ’s ’d peacesciencer, going lifted source R scripts user’s guide. first part code chunk lean core peacesciencer functionality whereas stuff post-processing , bonus, modeling. might standard civil conflict analysis using Gleditsch-Ward states UCDP conflict data.","code":"# library(tidyverse) # load this first for most/all things # library(peacesciencer) # the package of interest # library(stevemisc) # a dependency, but also used for standardizing variables for better interpretation library(tictoc) tic() create_dyadyears(directed = FALSE, mry = FALSE) %>% filter_prd() %>% add_gml_mids(keep = NULL) %>% add_peace_years() %>% add_nmc() %>% add_democracy() %>% add_cow_alliance() %>% add_sdp_gdp() -> Data Data %>% mutate(landcontig = ifelse(conttype == 1, 1, 0)) %>% mutate(cowmajdyad = ifelse(cowmaj1 == 1 | cowmaj2 == 1, 1, 0)) %>% # Create estimate of militarization as milper/tpop # Then make a weak-link mutate(milit1 = milper1/tpop1, milit2 = milper2/tpop2, minmilit = ifelse(milit1 > milit2, milit2, milit1)) %>% # create CINC proportion (lower over higher) mutate(cincprop = ifelse(cinc1 > cinc2, cinc2/cinc1, cinc1/cinc2)) %>% # create weak-link specification using Quick UDS data mutate(mindemest = ifelse(xm_qudsest1 > xm_qudsest2, xm_qudsest2, xm_qudsest1)) %>% # Create \"weak-link\" measure of jointly advanced economies mutate(minwbgdppc = ifelse(wbgdppc2011est1 > wbgdppc2011est2, wbgdppc2011est2, wbgdppc2011est1)) -> Data # r2sd() is in {stevemisc}, a {peacesciencer} dependency. # This is just for a more readable regression output. Data %>% mutate_at(vars(\"cincprop\", \"mindemest\", \"minwbgdppc\", \"minmilit\"), ~r2sd(.)) -> Data broom::tidy(modDD <- glm(gmlmidonset ~ landcontig + cincprop + cowmajdyad + cow_defense + mindemest + minwbgdppc + minmilit + gmlmidspell + I(gmlmidspell^2) + I(gmlmidspell^3), data= Data, family=binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -3.06 0.0635 -48.2 0 #> 2 landcontig 1.06 0.0568 18.7 4.21e- 78 #> 3 cincprop 0.455 0.0363 12.5 6.63e- 36 #> 4 cowmajdyad 0.144 0.0575 2.51 1.20e- 2 #> 5 cow_defense -0.119 0.0580 -2.04 4.09e- 2 #> 6 mindemest -0.499 0.0525 -9.51 1.93e- 21 #> 7 minwbgdppc 0.293 0.0511 5.72 1.06e- 8 #> 8 minmilit 0.255 0.0226 11.3 2.02e- 29 #> 9 gmlmidspell -0.147 0.00505 -29.0 5.33e-185 #> 10 I(gmlmidspell^2) 0.00247 0.000135 18.4 2.74e- 75 #> 11 I(gmlmidspell^3) -0.0000116 0.000000891 -13.0 1.16e- 38 toc() #> 7.559 sec elapsed tic() create_stateyears(system = 'gw') %>% filter(year %in% c(1946:2019)) %>% add_ucdp_acd(type=c(\"intrastate\"), only_wars = FALSE) %>% add_peace_years() %>% add_democracy() %>% add_creg_fractionalization() %>% add_sdp_gdp() %>% add_rugged_terrain() -> Data create_stateyears(system = 'gw') %>% filter(year %in% c(1946:2019)) %>% add_ucdp_acd(type=c(\"intrastate\"), only_wars = TRUE) %>% add_peace_years() %>% rename_at(vars(ucdpongoing:ucdpspell), ~paste0(\"war_\", .)) %>% left_join(Data, .) -> Data Data %>% arrange(gwcode, year) %>% group_by(gwcode) %>% mutate_at(vars(\"xm_qudsest\", \"wbgdppc2011est\", \"wbpopest\"), list(l1 = ~lag(., 1))) %>% rename_at(vars(contains(\"_l1\")), ~paste(\"l1\", gsub(\"_l1\", \"\", .), sep = \"_\") ) -> Data modCW <- list() broom::tidy(modCW$\"All UCDP Conflicts\" <- glm(ucdponset ~ l1_wbgdppc2011est + l1_wbpopest + l1_xm_qudsest + I(l1_xm_qudsest^2) + newlmtnest + ethfrac + relfrac + ucdpspell + I(ucdpspell^2) + I(ucdpspell^3), data=subset(Data), family = binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -5.10 1.35 -3.77 0.000160 #> 2 l1_wbgdppc2011est -0.285 0.110 -2.59 0.00953 #> 3 l1_wbpopest 0.229 0.0672 3.41 0.000644 #> 4 l1_xm_qudsest 0.257 0.181 1.43 0.154 #> 5 I(l1_xm_qudsest^2) -0.726 0.211 -3.44 0.000574 #> 6 newlmtnest 0.0549 0.0666 0.824 0.410 #> 7 ethfrac 0.442 0.358 1.23 0.217 #> 8 relfrac -0.389 0.402 -0.969 0.333 #> 9 ucdpspell -0.0738 0.0393 -1.88 0.0601 #> 10 I(ucdpspell^2) 0.00443 0.00205 2.16 0.0304 #> 11 I(ucdpspell^3) -0.0000602 0.0000280 -2.15 0.0316 broom::tidy(modCW$\"Wars Only\" <- glm(war_ucdponset ~ l1_wbgdppc2011est + l1_wbpopest + l1_xm_qudsest + I(l1_xm_qudsest^2) + newlmtnest + ethfrac + relfrac + war_ucdpspell + I(war_ucdpspell^2) + I(war_ucdpspell^3), data=subset(Data), family = binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -6.59 2.08 -3.16 0.00156 #> 2 l1_wbgdppc2011est -0.343 0.172 -1.99 0.0463 #> 3 l1_wbpopest 0.272 0.106 2.56 0.0105 #> 4 l1_xm_qudsest -0.0847 0.270 -0.313 0.754 #> 5 I(l1_xm_qudsest^2) -0.761 0.352 -2.16 0.0307 #> 6 newlmtnest 0.342 0.112 3.05 0.00226 #> 7 ethfrac 0.333 0.554 0.601 0.548 #> 8 relfrac -0.281 0.593 -0.474 0.635 #> 9 war_ucdpspell -0.111 0.0562 -1.98 0.0478 #> 10 I(war_ucdpspell^2) 0.00466 0.00252 1.85 0.0643 #> 11 I(war_ucdpspell^3) -0.0000499 0.0000302 -1.65 0.0982 toc() #> 2.444 sec elapsed"},{"path":"http://svmiller.com/index.html","id":"citing-what-you-do-in-peacesciencer","dir":"","previous_headings":"","what":"Citing What You Do in {peacesciencer}","title":"Tools and Data for Quantitative Peace Science Research","text":"can () cite peacesciencer. package includes data frame BibTeX file (ps_bib) function finding returning BibTeX entries can include projects. ps_cite() function. ps_cite() function takes string partial match relevant keywords (KEYWORDS) associated entries ps_bib file. example, can () cite package . can see relevant citations consider using data returned add_democracy() can also return partial matches see citations associated , say, alliance data package. function might expand complexity future releases, can use right now finding appropriate citations. also scan ps_bib data see .","code":"ps_cite(\"peacesciencer\") #> @ARTICLE{peacesciencer-package, #> AUTHOR = {Steven V. Miller}, #> JOURNAL = {Conflict Management and Peace Science}, #> TITLE = {peacesciencer}: An R Package for Quantitative Peace Science Research}, #> YEAR = {2022}, #> KEYWORDS = {peacesciencer, add_capital_distance(), add_ccode_to_gw(), add_gwcode_to_cow(), capitals}, #> URL = {http://svmiller.com/peacesciencer/}} ps_cite(\"add_democracy()\") #> @UNPUBLISHED{coppedgeetal2020vdem, #> AUTHOR = {Michael Coppedge and John Gerring and Carl Henrik Knutsen and Staffan I. Lindberg and Jan Teorell and David Altman and Michael Bernhard and M. Steven Fish and Adam Glynn and Allen Hicken and Anna Luhrmann and Kyle L. Marquardt and Kelly McMann and Pamela Paxton and Daniel Pemstein and Brigitte Seim and Rachel Sigman and Svend-Erik Skaaning and Jeffrey Staton and Agnes Cornell and Lisa Gastaldi and Haakon Gjerl{\\o}w and Valeriya Mechkova and Johannes von R{\\\"o}mer and Aksel Sundtr{\\\"o}m and Eitan Tzelgov and Luca Uberti and Yi-ting Wang and Tore Wig and Daniel Ziblatt}, #> NOTE = {Varieties of Democracy ({V}-{D}em) Project}, #> TITLE = {V-Dem Codebook v10}, #> YEAR = {2020}, #> KEYWORDS = {add_democracy(), v-dem, varieties of democracy}} #> #> @UNPUBLISHED{marquez2016qme, #> AUTHOR = {Xavier Marquez}, #> NOTE = {Available at SSRN: http://ssrn.com/abstract=2753830}, #> TITLE = {A Quick Method for Extending the {U}nified {D}emocracy {S}cores}, #> YEAR = {2016}, #> KEYWORDS = {add_democracy(), UDS, Unified Democracy Scores}, #> URL = {http://dx.doi.org/10.2139/ssrn.2753830}} #> #> @UNPUBLISHED{marshalletal2017p, #> AUTHOR = {Monty G. Marshall and Ted Robert Gurr and Keith Jaggers}, #> NOTE = {University of Maryland, Center for International Development and Conflict Management}, #> TITLE = {Polity {IV} Project: Political Regime Characteristics and Transitions, 1800-2016}, #> YEAR = {2017}, #> KEYWORDS = {add_democracy(), polity}} #> #> @ARTICLE{pemsteinetal2010dc, #> AUTHOR = {Pemstein, Daniel and Stephen A. Meserve and James Melton}, #> JOURNAL = {Political Analysis}, #> NUMBER = {4}, #> PAGES = {426--449}, #> TITLE = {Democratic Compromise: A Latent Variable Analysis of Ten Measures of Regime Type}, #> VOLUME = {18}, #> YEAR = {2010}, #> KEYWORDS = {add_democracy(), UDS, Unified Democracy Scores}, #> OWNER = {steve}, #> TIMESTAMP = {2011.01.30}} ps_cite(\"alliance\") #> @BOOK{gibler2009ima, #> AUTHOR = {Douglas M. Gibler}, #> PUBLISHER = {Washington DC: CQ Press}, #> TITLE = {International Military Alliances, 1648-2008}, #> YEAR = {2009}, #> KEYWORDS = {add_cow_alliance()}} #> #> @ARTICLE{leedsetal2002atop, #> AUTHOR = {Bretty Ashley Leeds and Jeffrey M. Ritter and Sara McLaughlin Mitchell and Andrew G. Long}, #> JOURNAL = {International Interactions}, #> PAGES = {237--260}, #> TITLE = {Alliance Treaty Obligations and Provisions, 1815-1944}, #> VOLUME = {28}, #> YEAR = {2002}, #> KEYWORDS = {add_atop_alliance()}}"},{"path":"http://svmiller.com/index.html","id":"issuesrequests","dir":"","previous_headings":"","what":"Issues/Requests","title":"Tools and Data for Quantitative Peace Science Research","text":"peacesciencer already capable meet wide variety needs peace science community. Users free raise issue project’s Github feature performing think additions like see.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":null,"dir":"Reference","previous_headings":"","what":"(An Abbreviation of) The LEAD Data Set — LEAD","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"abbreviated version LEAD Data Set, incorporating variables think interesting potentially useful data.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"","code":"LEAD"},{"path":"http://svmiller.com/reference/LEAD.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"data frame 3409 observations following 12 variables. obsid observational ID archigos leveledu 0 = primary, 1 = secondary, 2 = university, 3 = graduate milservice leader prior military service? combat leader prior combat experience military service? rebel leader previously part rebel group? warwin leader previously part winning war effort part military service? warloss leader previously part losing war effort part military service? rebelwin leader previously part winning war effort part rebel group? rebelloss leader previously part losing war effort part rebel group? yrsexper previous years experience politics becoming leader physhealth leader physical health issues? mentalhealth leader mental health issues?","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"Data ported Ellis et al. (2015). Users want variables included peacesciencer raise issue Github.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"Ellis, Carli Mortenson, Michael C. Horowitz, Allan C. Stam. 2015. \"Introducing LEAD Data Set.\" International Interactions 41(4): 718--741.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"add_archigos() allows add information leaders dyad-year state-year data. function leans abbreviated version data, also comes package.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"","code":"add_archigos(data)"},{"path":"http://svmiller.com/reference/add_archigos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"add_archigos() takes dyad-year state-year data frame adds summary variables based leader-level data. include whether leader transition state-year (first/second state dyad-year), whether \"irregular\" leader transition, number leaders state-year, unique leader ID Jan. 1 year, unique leader ID Dec. 31 year.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_archigos() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 2,139,270 × 13 #> ccode1 ccode2 year leadert…¹ irreg…² n_lea…³ jan1o…⁴ dec31…⁵ leade…⁶ irreg…⁷ #> #> 1 2 20 1920 0 0 1 USA-19… USA-19… 1 0 #> 2 2 20 1921 1 0 2 USA-19… USA-19… 1 0 #> 3 2 20 1922 0 0 1 USA-19… USA-19… 0 0 #> 4 2 20 1923 1 0 2 USA-19… USA-19… 0 0 #> 5 2 20 1924 0 0 1 USA-19… USA-19… 0 0 #> 6 2 20 1925 0 0 1 USA-19… USA-19… 0 0 #> 7 2 20 1926 0 0 1 USA-19… USA-19… 1 0 #> 8 2 20 1927 0 0 1 USA-19… USA-19… 0 0 #> 9 2 20 1928 0 0 1 USA-19… USA-19… 0 0 #> 10 2 20 1929 1 0 2 USA-19… USA-19… 0 0 #> # … with 2,139,260 more rows, 3 more variables: n_leaders2 , #> # jan1obsid2 , dec31obsid2 , and abbreviated variable names #> # ¹​leadertransition1, ²​irregular1, ³​n_leaders1, ⁴​jan1obsid1, ⁵​dec31obsid1, #> # ⁶​leadertransition2, ⁷​irregular2 create_stateyears() %>% add_archigos() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 17,121 × 8 #> ccode statenme year leader…¹ irreg…² n_lea…³ jan1o…⁴ dec31…⁵ #> #> 1 2 United States of America 1816 NA NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA NA #> # … with 17,111 more rows, and abbreviated variable names ¹​leadertransition, #> # ²​irregular, ³​n_leaders, ⁴​jan1obsid, ⁵​dec31obsid # }"},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"add_atop_alliance() allows add Alliance Treaty Obligations Provisions (ATOP) data (dyad-year, leader-dyad-year) data frame.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"","code":"add_atop_alliance(data)"},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"add_atop_alliance() takes (dyad-year, leader-dyad-year) data frame adds information alliance pledge given dyad-year ATOP data. include whether alliance defense pledge, offense pledge, neutrality pledge, non-aggression pledge, pledge consultation time crisis.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Data version 5.0 ATOP. function also work leader-dyad-years, though users careful leader-level applications alliance data. Alliance data primarily communicated yearly, making possible---even likely---least one leader-dyad given year credited alliance active particular leader-dyad. ATOP alliance data communicated time measurements granular year, least dyad-years. alliance-level data provided ATOP termination dates, unaware well start termination dates coincide particular members joining fact exiting early. alliance phase data appear communicate \"phases\" understood beginning/ending underlying document amended way affects one variable codings, may may signatory joining fact exiting early. guidance useful going forward, use data leader-level analyses mind.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Leeds, Brett Ashley, Jeffrey M. Ritter, Sara McLaughlin Mitchell, Andrew G. Long. 2002. Alliance Treaty Obligations Provisions, 1815-1944. International Interactions 28: 237-60.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_atop_alliance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 8 #> ccode1 ccode2 year atop_defense atop_offense atop_neutral atop_non…¹ atop_…² #> #> 1 2 20 1920 0 0 0 0 0 #> 2 2 20 1921 0 0 0 0 0 #> 3 2 20 1922 0 0 0 0 0 #> 4 2 20 1923 0 0 0 0 0 #> 5 2 20 1924 0 0 0 0 0 #> 6 2 20 1925 0 0 0 0 0 #> 7 2 20 1926 0 0 0 0 0 #> 8 2 20 1927 0 0 0 0 0 #> 9 2 20 1928 0 0 0 0 0 #> 10 2 20 1929 0 0 0 0 0 #> # … with 2,139,260 more rows, and abbreviated variable names ¹​atop_nonagg, #> # ²​atop_consul"},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add capital-to-capital distance to a data frame — add_capital_distance","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"add_capital_distance() allows add capital--capital distance (dyad-year, leader-year, leader-dyad-year, state-year) data frame. capitals coded cow_capitals gw_capitals data frames, along latitudes longitudes. distance variable emerges capdist calculated using \"Vincenty\" method (.e. \"crow flies\") expressed kilometers.","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"","code":"add_capital_distance(data)"},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"add_capital_distance() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds capital--capital distance first state second state (dyad-year data) minimum capital--capital distance given state given year. minor note function: cases capital transition recorded underlying data , conversion capital-years (eventual merging dyad-year data frame), Jan. 1 capital used calculating distances.","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"function leans attributes data provided one \"create\" functions package (e.g. create_dyadyear() create_stateyear()).","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_capital_distance() #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year capdist #> #> 1 2 20 1920 2011. #> 2 2 20 1921 2011. #> 3 2 20 1922 2011. #> 4 2 20 1923 2011. #> 5 2 20 1924 2011. #> 6 2 20 1925 2011. #> 7 2 20 1926 2011. #> 8 2 20 1927 2011. #> 9 2 20 1928 2011. #> 10 2 20 1929 2011. #> # … with 2,139,260 more rows create_stateyears() %>% add_capital_distance() #> Warning: There were 390 warnings in `summarize()`. #> The first warning was: #> ℹ In argument: `mincapdist = min(.data$capdist, na.rm = TRUE)`. #> ℹ In group 206: `ccode1 = 2`, `year = 2021`. #> Caused by warning in `min()`: #> ! no non-missing arguments to min; returning Inf #> ℹ Run `dplyr::last_dplyr_warnings()` to see the 389 remaining warnings. #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 4 #> ccode statenme year mincapdist #> #> 1 2 United States of America 1816 6677. #> 2 2 United States of America 1817 6677. #> 3 2 United States of America 1818 6677. #> 4 2 United States of America 1819 6677. #> 5 2 United States of America 1820 6677. #> 6 2 United States of America 1821 6677. #> 7 2 United States of America 1822 6679. #> 8 2 United States of America 1823 6679. #> 9 2 United States of America 1824 6679. #> 10 2 United States of America 1825 6679. #> # … with 17,111 more rows # }"},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"add_ccode_to_gw() allows match, well one can, Correlates War system membership data Gleditsch-Ward system data.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"","code":"add_ccode_to_gw(data)"},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"add_ccode_to_gw() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame already Gleditsch-Ward state system codes adds corollary Correlates War codes.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"data-raw directory project's Github contains information underlying data assists merging codes. user invariably need careful ask want data included. issue different composition merging process () perfect. can note case like Gran Colombia difficult handle (.e. CoW entity none splinter states conflict CoW's coding). However, greater weirdness case like unification West Germany East Germany. Herein, Correlates War treats unification reappearance original Germany whereas Gleditsch-Ward treat unification incorporation East Germany West Germany. script create state-year dyad-year duplicates Gleditsch-Ward codes. size original data remain unchanged. However, year duplicates various Correlates War codes (prominently Serbia Yugoslavia 2006). Use care. can also use countrycode package. Whether use function countrycode package, kind merging without assessing output.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_dyadyears(system = \"gw\") %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 5 #> gwcode1 gwcode2 year ccode1 ccode2 #> #> 1 2 20 1867 2 NA #> 2 2 20 1868 2 NA #> 3 2 20 1869 2 NA #> 4 2 20 1870 2 NA #> 5 2 20 1871 2 NA #> 6 2 20 1872 2 NA #> 7 2 20 1873 2 NA #> 8 2 20 1874 2 NA #> 9 2 20 1875 2 NA #> 10 2 20 1876 2 NA #> # … with 2,089,816 more rows create_stateyears(system = 'gw') %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 4 #> gwcode statename year ccode #> #> 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 #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_contiguity.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"add_contiguity() allows add Correlates War contiguity data dyad-year, leader-year, leader-dyad-year, state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"","code":"add_contiguity(data)"},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"add_contiguity() takes data frame adds information contiguity relationship based \"master records\" Correlates War direct contiguity data (v. 3.2). data dyad-year (leader dyad-year), function returns lowest contiguity type observed dyad-year (contiguity observed ). data state-year (leader-year), data return total number land sea borders calculated master records.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"contiguity codes dyad-year data range 0 5. 1 = direct land contiguity. 2 = separated 12 miles water fewer (la Stannis Baratheon). 3 = separated 24 miles water fewer (12 miles). 4 = separated 150 miles water fewer (24 miles). 5 = separated 400 miles water fewer (150 miles). Importantly, 0 dyads contiguous CoW contiguity data. conscious decision part think CoW's contiguity data exactly ordinal. Cross-reference CoW's contiguity data minimum distance data exact package see dyads CoW codes contiguous fact close , sometimes even land-contiguous. example, Zimbabwe Namibia separated hundred feet water peculiar intersection Zambezi River borders Zambia, Botswana, Namibia, Zimbabwe meet. contiguity record CoW data. cases contiguity records situationally missing (e.g. India-Bangladesh, Bangladesh-Myanmar 1971) cases states much closer CoW's contiguity data imply (e.g. Pakistan Soviet Union separated 30 kilometers Afghani territory). researcher free recode 0s , say, 6s, peacesciencer . additional clarity, \"master records\" produce duplicates cases contiguity relationship changed given year. function returns minimum contiguity relationship observed given year. duplicates returned output. mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"Stinnett, Douglas M., Jaroslav Tir, Philip Schafer, Paul F. Diehl, Charles Gochman (2002). \"Correlates War Project Direct Contiguity Data, Version 3.\" Conflict Management Peace Science 19 (2):58-66.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_contiguity() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year conttype #> #> 1 2 20 1920 1 #> 2 2 20 1921 1 #> 3 2 20 1922 1 #> 4 2 20 1923 1 #> 5 2 20 1924 1 #> 6 2 20 1925 1 #> 7 2 20 1926 1 #> 8 2 20 1927 1 #> 9 2 20 1928 1 #> 10 2 20 1929 1 #> # … with 2,139,260 more rows create_stateyears() %>% add_contiguity() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 5 #> ccode statenme year land sea #> #> 1 2 United States of America 1816 0 0 #> 2 2 United States of America 1817 0 0 #> 3 2 United States of America 1818 0 0 #> 4 2 United States of America 1819 0 0 #> 5 2 United States of America 1820 0 0 #> 6 2 United States of America 1821 0 0 #> 7 2 United States of America 1822 0 0 #> 8 2 United States of America 1823 0 0 #> 9 2 United States of America 1824 0 0 #> 10 2 United States of America 1825 0 0 #> # … with 17,111 more rows # }"},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War alliance data to a data frame — add_cow_alliance","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"add_cow_alliance() allows add Correlates War alliance data dyad-year data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"","code":"add_cow_alliance(data)"},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"data dyad-year leader-dyad-year data frame (either \"directed\" \"non-directed\")","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"add_cow_alliance() takes dyad-year data frame adds information alliance pledge given dyad-year. include whether alliance defense pledge, neutrality pledge, non-aggression pledge, pledge consultation time crisis (entente).","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Duplicates original directed dyad-year alliance data pre-processed. Check cow_alliance package's data-raw directory Github information. function also work leader-dyad-years, though users careful leader-level applications alliance data. Alliance data primarily communicated yearly, making possible---even likely---least one leader-dyad given year credited alliance active particular leader-dyad. Correlates War's alliance data communicated time measurements granular year. Apply data leader-level analyses mind.","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Congressional Quarterly Press.","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_alliance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 7 #> ccode1 ccode2 year cow_defense cow_neutral cow_nonagg cow_entente #> #> 1 2 20 1920 0 0 0 0 #> 2 2 20 1921 0 0 0 0 #> 3 2 20 1922 0 0 0 0 #> 4 2 20 1923 0 0 0 0 #> 5 2 20 1924 0 0 0 0 #> 6 2 20 1925 0 0 0 0 #> 7 2 20 1926 0 0 0 0 #> 8 2 20 1927 0 0 0 0 #> 9 2 20 1928 0 0 0 0 #> 10 2 20 1929 0 0 0 0 #> # … with 2,139,260 more rows"},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War major power information to a data frame — add_cow_majors","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"add_cow_majors() allows add Correlates War major power variables dyad-year, leader-year, leader dyad-year, state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"","code":"add_cow_majors(data)"},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"add_cow_majors() takes data frame adds information major power status given state dyad year. data dyad-year (leader dyad-year), function returns two columns whether first state (.e. ccode1) second state (.e. ccode2) major powers given year, according Correlates War. 1 = major power. 0 = major power. data state-year (leader-year), functions returns just one column (cowmaj) whether state major power given state-year.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_majors() #> # A tibble: 2,139,270 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 20 1920 1 0 #> 2 2 20 1921 1 0 #> 3 2 20 1922 1 0 #> 4 2 20 1923 1 0 #> 5 2 20 1924 1 0 #> 6 2 20 1925 1 0 #> 7 2 20 1926 1 0 #> 8 2 20 1927 1 0 #> 9 2 20 1928 1 0 #> 10 2 20 1929 1 0 #> # … with 2,139,260 more rows"},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"add_cow_mids() merges CoW's MID data dyad-year data frame. version CoW-MID data package version 5.0.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"","code":"add_cow_mids(data, keep)"},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"data dyad-year data frame (either \"directed\" \"non-directed\") keep optional parameter, specified character vector, passed function select(one_of(.)) wrapper. allows user discard unwanted columns directed dispute data output consume much space memory. Note: Correlates War system codes (ccode1, ccode2), observation year (year), presence absence ongoing MID (cowmidongoing), presence absence unique MID onset (cowmidonset) always returned. foolish self-defeating eliminate observations. user free keep discard anything else see fit. keep specified function, ensuing output returns everything.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"add_cow_mids() takes dyad-year data frame adds dyad-year dispute information CoW-MID data.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. merging process employs several rules whittle duplicate dyad-years merging dyad-year data frame. function also return message user case-exclusion rules went process. Users interested implementing case-exclusion rules look \"whittle\" class functions also provided package.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_mids() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 24 #> ccode1 ccode2 year dispnum cowmidong…¹ cowmi…² sidea1 sidea2 fatal…³ fatal…⁴ #> #> 1 2 20 1920 NA 0 0 NA NA NA NA #> 2 2 20 1921 NA 0 0 NA NA NA NA #> 3 2 20 1922 NA 0 0 NA NA NA NA #> 4 2 20 1923 NA 0 0 NA NA NA NA #> 5 2 20 1924 NA 0 0 NA NA NA NA #> 6 2 20 1925 NA 0 0 NA NA NA NA #> 7 2 20 1926 NA 0 0 NA NA NA NA #> 8 2 20 1927 NA 0 0 NA NA NA NA #> 9 2 20 1928 NA 0 0 NA NA NA NA #> 10 2 20 1929 NA 0 0 NA NA NA NA #> # … with 2,139,260 more rows, 14 more variables: fatalpre1 , #> # fatalpre2 , hiact1 , hiact2 , hostlev1 , #> # hostlev2 , orig1 , orig2 , fatality , hostlev , #> # mindur , maxdur , recip , stmon , and abbreviated #> # variable names ¹​cowmidongoing, ²​cowmidonset, ³​fatality1, ⁴​fatality2 # keep just the dispute number and Side A/B identifiers cow_ddy %>% add_cow_mids(keep=c(\"dispnum\",\"sidea1\", \"sidea2\")) #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 8 #> ccode1 ccode2 year cowmidonset cowmidongoing dispnum sidea1 sidea2 #> #> 1 2 20 1920 0 0 NA NA NA #> 2 2 20 1921 0 0 NA NA NA #> 3 2 20 1922 0 0 NA NA NA #> 4 2 20 1923 0 0 NA NA NA #> 5 2 20 1924 0 0 NA NA NA #> 6 2 20 1925 0 0 NA NA NA #> 7 2 20 1926 0 0 NA NA NA #> 8 2 20 1927 0 0 NA NA NA #> 9 2 20 1928 0 0 NA NA NA #> 10 2 20 1929 0 0 NA NA NA #> # … with 2,139,260 more rows # }"},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War trade data to a data frame — add_cow_trade","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"add_cow_trade() allows add Correlates War trade data (dyad-year, leader-year, leader-dyad-year, state-year) data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"","code":"add_cow_trade(data)"},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"add_cow_trade() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information volume trade given dyad-year state-year. state-year (leader-year) data, minimally sum imports sum exports. dyad-year (leader-dyad-year) data, function returns value imports current million USD first country second country (vice-versa) along \"smooth\" equivalents.","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"dyad-year (leader-dyad-year) data, must kind information loss order work within limited space available package. package loads truncated version data trade values rounded three decimal points order greatly reduce disk space package. think terribly problematic, though admit like . problem research question, may want consider using function dyad-year leader-dyad-year data. mindful data fundamentally state-year dyad-year extensions leader-level data understood approximations leaders (leader-dyads) given state-year (dyad-year).","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"Barbieri, Katherine, Omar M. G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science. 26(5): 471-491.","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) # The function below works, but depends on running `download_extdata()` beforehand. # cow_ddy %>% add_cow_trade() create_stateyears() %>% add_cow_trade() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 5 #> ccode statenme year imports exports #> #> 1 2 United States of America 1816 NA NA #> 2 2 United States of America 1817 NA NA #> 3 2 United States of America 1818 NA NA #> 4 2 United States of America 1819 NA NA #> 5 2 United States of America 1820 NA NA #> 6 2 United States of America 1821 NA NA #> 7 2 United States of America 1822 NA NA #> 8 2 United States of America 1823 NA NA #> 9 2 United States of America 1824 NA NA #> 10 2 United States of America 1825 NA NA #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"add_cow_wars() allows Correlates War data dyad-year state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"","code":"add_cow_wars(data, type, intratype = \"all\")"},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"data data frame appropriate peacesciencer attributes type type war want add. Options include \"inter\" \"intra\". intratype types armed conflicts user wants consider, specified character vector. Options include \"local issues\" \"central control\". Applicable type \"intra\".","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"add_cow_wars() takes dyad-year state-year data frame returns information wars either inter-state intra-state war data set Correlates War. function works state-year data user wants information extra-state wars intra-state wars. function works dyad-year data user wants information inter-state wars.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Intra-state war data coerced true state-year data first selecting duplicate state-years unique onsets, whichever war deadliest. inter-state war data work functionally way. intra-state wars: primary_state used identify government principally fighting domestic non-state actor central control local issues. Internationalized civil wars included data, outside actors intervene behalf government rebel group. Extra-state war functionality available right now try figure demand use.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Dixon, Jeffrey, Meredith Sarkees. 2016. Guide Intra-State Wars: Examination Civil Wars, 1816-2014. Thousand Oaks, CA: Sage. Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_stateyears(system = \"cow\") %>% add_cow_wars(type = \"intra\", intratype = \"central control\") #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 13 #> ccode statenme year warnum warname wartype cowin…¹ cowin…² intnl outcome #> #> 1 2 United Stat… 1816 NA NA NA 0 0 NA NA #> 2 2 United Stat… 1817 NA NA NA 0 0 NA NA #> 3 2 United Stat… 1818 NA NA NA 0 0 NA NA #> 4 2 United Stat… 1819 NA NA NA 0 0 NA NA #> 5 2 United Stat… 1820 NA NA NA 0 0 NA NA #> 6 2 United Stat… 1821 NA NA NA 0 0 NA NA #> 7 2 United Stat… 1822 NA NA NA 0 0 NA NA #> 8 2 United Stat… 1823 NA NA NA 0 0 NA NA #> 9 2 United Stat… 1824 NA NA NA 0 0 NA NA #> 10 2 United Stat… 1825 NA NA NA 0 0 NA NA #> # … with 17,111 more rows, 3 more variables: sideadeaths , #> # sidebdeaths , intrawarnums , and abbreviated variable names #> # ¹​cowintraonset, ²​cowintraongoing create_stateyears(system = \"cow\") %>% add_cow_wars(type = \"intra\", intratype = \"local issues\") #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 13 #> ccode statenme year warnum warname wartype cowin…¹ cowin…² intnl outcome #> #> 1 2 United Stat… 1816 NA NA NA 0 0 NA NA #> 2 2 United Stat… 1817 NA NA NA 0 0 NA NA #> 3 2 United Stat… 1818 NA NA NA 0 0 NA NA #> 4 2 United Stat… 1819 NA NA NA 0 0 NA NA #> 5 2 United Stat… 1820 NA NA NA 0 0 NA NA #> 6 2 United Stat… 1821 NA NA NA 0 0 NA NA #> 7 2 United Stat… 1822 NA NA NA 0 0 NA NA #> 8 2 United Stat… 1823 NA NA NA 0 0 NA NA #> 9 2 United Stat… 1824 NA NA NA 0 0 NA NA #> 10 2 United Stat… 1825 NA NA NA 0 0 NA NA #> # … with 17,111 more rows, 3 more variables: sideadeaths , #> # sidebdeaths , intrawarnums , and abbreviated variable names #> # ¹​cowintraonset, ²​cowintraongoing cow_ddy %>% add_cow_wars(type = \"inter\") #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 14 #> ccode1 ccode2 year cowintero…¹ cowin…² sidea1 sidea2 initi…³ initi…⁴ outco…⁵ #> #> 1 2 20 1920 0 0 NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA #> # … with 2,139,260 more rows, 4 more variables: outcome2 , #> # batdeath1 , batdeath2 , resume , and abbreviated variable #> # names ¹​cowinterongoing, ²​cowinteronset, ³​initiator1, ⁴​initiator2, ⁵​outcome1 # }"},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":null,"dir":"Reference","previous_headings":"","what":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"add_creg_fractionalization() allows add information fractionalization/polarization state's ethnic religious groups data.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"","code":"add_creg_fractionalization(data)"},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"add_creg_fractionalization() takes dyad-year, leader-year, leader-dyad-year, state-data frame, whether primary state identifiers Correlates War system Gleditsch-Ward system, returns information fractionalization polarization state(s) given year. function returns four additional columns data state-year returns eight additional columns data state-year (leader-year). columns returned fractionalization ethnic groups, polarization ethnic groups, fractionalization religious groups, polarization religious groups. data dyad-year (leader-dyad-year), return doubles provides information states dyad.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Please see information underlying data creg, associated R script data-raw directory, see data generated. creg data duplicates. standardizing true CoW codes, duplicates concern Serbia/Yugoslavia 1991 1992 well Russia/Soviet Union 1991. standardizing true Gleditsch-Ward codes, duplicates concern Serbia/Yugoslavia 1991 Russia/Soviet Union 1991. cases, function group-arrange fractionalized/polarized estimate (reasonable, think) assumption estimates prior dissolution states. problematic, feel free consult underlying data merge manually. underlying data Gleditsch-Ward codes Correlates War codes. merge makes depends declare \"master\" system top pipe (.e. create_dyadyears() create_stateyears()). , example, run create_stateyears(system=\"cow\") follow add_gwcode_to_cow(), merge Correlates War codes Gleditsch-Ward codes. can see script mechanics see achieved. mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Alesina, Alberto, Arnaud Devleeschauwer, William Easterly, Sergio Kurlat Romain Wacziarg. 2003. \"Fractionalization\". Journal Economic Growth 8: 155-194. Montalvo, Jose G. Marta Reynal-Querol. 2005. \"Ethnic Polarization, Potential Conflict, Civil Wars\" American Economic Review 95(3): 796--816. Nardulli, Peter F., Cara J. Wong, Ajay Singh, Buddy Petyon, Joseph Bajjalieh. 2012. Composition Religious Ethnic Groups (CREG) Project. Cline Center Democracy.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_creg_fractionalization() #> # A tibble: 2,139,270 × 11 #> ccode1 ccode2 year ethfrac1 ethpol1 relfrac1 relpol1 ethfr…¹ ethpol2 relfr…² #> #> 1 2 20 1920 NA NA NA NA NA NA NA #> 2 2 20 1921 NA NA NA NA NA NA NA #> 3 2 20 1922 NA NA NA NA NA NA NA #> 4 2 20 1923 NA NA NA NA NA NA NA #> 5 2 20 1924 NA NA NA NA NA NA NA #> 6 2 20 1925 NA NA NA NA NA NA NA #> 7 2 20 1926 NA NA NA NA NA NA NA #> 8 2 20 1927 NA NA NA NA NA NA NA #> 9 2 20 1928 NA NA NA NA NA NA NA #> 10 2 20 1929 NA NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: relpol2 , and abbreviated #> # variable names ¹​ethfrac2, ²​relfrac2 create_stateyears() %>% add_creg_fractionalization() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year ethfrac ethpol relfrac relpol #> #> 1 2 United States of America 1816 NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA #> # … with 17,111 more rows create_stateyears(system = \"gw\") %>% add_creg_fractionalization() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 7 #> gwcode statename year ethfrac ethpol relfrac relpol #> #> 1 2 United States of America 1816 NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Add democracy information to a data frame — add_democracy","title":"Add democracy information to a data frame — add_democracy","text":"add_democracy() allows add estimates democracy data.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add democracy information to a data frame — add_democracy","text":"","code":"add_democracy(data)"},{"path":"http://svmiller.com/reference/add_democracy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add democracy information to a data frame — add_democracy","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add democracy information to a data frame — add_democracy","text":"add_democracy() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information level democracy state two states dyad given year. data dyad-year leader-dyad-year, function adds six total columns first state (.e. ccode1 gwcode1) second state (.e. ccode2 gwcode2) level democracy measured Varieties Democracy project (v2x_polyarchy), Polity project (polity2), Xavier Marquez' QuickUDS extensions/estimates. data state-year leader-year, function returns three additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add democracy information to a data frame — add_democracy","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year. vignette package's website talks data primarily encourage maximize number observations analysis follow. Xavier Marquez' QuickUDS estimates best coverage. democracy ultimately control variable, otherwise variable huge concern analysis (.e. user particular stake best measurement democracy best conceptualization operationalization \"democracy\"), please use Marquez' estimates instead Polity V-dem. user analysis inter-state conflict, across standard post-1816 domain conflict studies, definitely use Polity data extent missingness large unnecessary. Please read vignette describing issues : http://svmiller.com/peacesciencer/articles/democracy.html","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add democracy information to a data frame — add_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add democracy information to a data frame — add_democracy","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add democracy information to a data frame — add_democracy","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_democracy() #> # A tibble: 2,139,270 × 9 #> ccode1 ccode2 year v2x_polyarchy1 polity21 xm_quds…¹ v2x_p…² polit…³ xm_qu…⁴ #> #> 1 2 20 1920 0.446 10 1.19 0.442 9 0.982 #> 2 2 20 1921 0.509 10 1.19 0.576 10 1.31 #> 3 2 20 1922 0.51 10 1.19 0.622 10 1.31 #> 4 2 20 1923 0.516 10 1.19 0.622 10 1.31 #> 5 2 20 1924 0.514 10 1.20 0.622 10 1.31 #> 6 2 20 1925 0.505 10 1.20 0.622 10 1.28 #> 7 2 20 1926 0.511 10 1.20 0.661 10 1.28 #> 8 2 20 1927 0.53 10 1.20 0.672 10 1.28 #> 9 2 20 1928 0.533 10 1.25 0.672 10 1.28 #> 10 2 20 1929 0.549 10 1.25 0.672 10 1.28 #> # … with 2,139,260 more rows, and abbreviated variable names ¹​xm_qudsest1, #> # ²​v2x_polyarchy2, ³​polity22, ⁴​xm_qudsest2 create_stateyears(system=\"gw\") %>% add_democracy() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 6 #> gwcode statename year v2x_polyarchy polity2 xm_qudsest #> #> 1 2 United States of America 1816 0.367 9 0.707 #> 2 2 United States of America 1817 0.37 9 0.707 #> 3 2 United States of America 1818 0.365 9 0.707 #> 4 2 United States of America 1819 0.362 9 0.707 #> 5 2 United States of America 1820 0.349 9 0.707 #> 6 2 United States of America 1821 0.336 9 0.707 #> 7 2 United States of America 1822 0.341 9 0.707 #> 8 2 United States of America 1823 0.345 9 0.707 #> 9 2 United States of America 1824 0.345 9 0.707 #> 10 2 United States of America 1825 0.341 9 0.707 #> # … with 18,627 more rows create_stateyears(system=\"cow\") %>% add_democracy() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 6 #> ccode statenme year v2x_polyarchy polity2 xm_qudsest #> #> 1 2 United States of America 1816 0.367 9 0.707 #> 2 2 United States of America 1817 0.37 9 0.707 #> 3 2 United States of America 1818 0.365 9 0.707 #> 4 2 United States of America 1819 0.362 9 0.707 #> 5 2 United States of America 1820 0.349 9 0.707 #> 6 2 United States of America 1821 0.336 9 0.707 #> 7 2 United States of America 1822 0.341 9 0.707 #> 8 2 United States of America 1823 0.345 9 0.707 #> 9 2 United States of America 1824 0.345 9 0.707 #> 10 2 United States of America 1825 0.341 9 0.707 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_fpsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Add dyadic foreign policy similarity measures to your data — add_fpsim","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"add_fpsim() allows add variety dyadic foreign policy similarity measures (dyad-year, leader-dyad-year) data frame","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"","code":"add_fpsim(data, keep)"},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"data data frame appropriate peacesciencer attributes keep optional parameter, specified character vector, dyadic foreign policy similarity measure(s) user wants returned function. keep specified, function returns 14 dyadic foreign policy similarity measures calculated Haege (2011). Otherwise, function subsets underlying data just user wants merges .","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"add_fpsim() takes (dyad-year, leader-dyad-year) data frame adds information dyadic foreign policy similarity, based several measures calculated offered Frank Haege.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"dyad-year (leader-dyad-year) data, must kind information loss order reduce disk space data like command. case, calculations rounded three decimal spots. think terribly problematic, though admit like . problem research question (though imagine ), may want consider using function dyad-year leader-dyad-year data. mindful data fundamentally dyad-year extensions leader-level data understood approximations leaders-dyads given dyad-year. data function uses directed dyad-year merge left-join, making function agnostic whether dyad-year (leader-dyad-year) data directed non-directed. Haege's (2011) article reads first glance agnostic particular measures consider \"preferred\" \"default\" measure dyadic foreign policy similarity. Indeed, 2011 publication Political Analysis mostly drives point home S important limitations multiple variants Haege calculates substitutable. means user interested measuring dyadic foreign policy similarity might cycle assess varying effects whereas user interested just control variable model can (probably) get picking just one belaboring measure .","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"suggested-defaults","dir":"Reference","previous_headings":"","what":"Suggested Defaults","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"evaluation data, article, email exchange author leads following points user consider. follows rationale users think kappa default measure dyadic foreign policy similarity, though \"valued\" equivalent alliance data inadvisable default. example end document offers operational \"nudge\" user want function. choice measure part depend temporal domain. user just post-WWII sample, UN voting measures offer better coverage. partial alliance data, though, 19th century coverage. Haege implores use chance-corrected measures, like Cohen's (1960) kappa Scott's (1955) pi. two, Haege suggests kappa pi. rationale user need build strong assumption baseline propensity forming tie dyad members dyad make Scott's (1955) pi appropriate estimate Cohen's (1960) kappa even important chance correction. choice squared versus absolute distances arbitrary. Users probably think differences, know differences. S usually calculated absolute differences software packages, though never usually belabored user. Comparability S might argument favor absolute distance default, keep mind squared distances much commonly used types distance association metrics. choice binary valued also design choice user consider full merits, though practice valuing alliance ties quantitative scale builds strong assumptions scale alliance strength presented something like Correlates War ATOP typology. S traditionally done default, another reason application lot quantitative peace science research suspect.","code":""},{"path":[]},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"the-main-source-of-the-data","dir":"Reference","previous_headings":"","what":"The Main Source of the Data","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"use data whatsoever (except Tau-b), please cite Haege (2011). Data version 2.0. Haege, Frank M. 2011. \"Choice Circumstance? Adjusting Measures Foreign Policy Similarity Chance Agreement.\" Political Analysis 19(3): 287-305. Tau-b calculated Haege, additional citation (beyond citing package) necessary.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"citations-for-the-particular-similarity-measure-you-choose","dir":"Reference","previous_headings":"","what":"Citations for the Particular Similarity Measure You Choose","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Additional citations depend particular measure similarity using, whether Kendall's (1938) Tau-b, Signorino Ritter's (1999) S, Cohen's (1960) kappa Scott's (1955) pi. Haege (2011) part chorus arguing use S, though S measures included data elect ignore chorus use measure. Likewise, Tau-b , though good measure dyadic foreign policy similarity reasons Signorino Ritter (1999) mention. Haege (2011) argues chance-corrected measure dyadic foreign policy similarity, either Cohen's (1960) kappa Scott's (1955) pi. Cohen, Jacob. 1960. \"Coefficient Agreement Nominal Scales.\" Educational Psychological Measurement 20(1): 37-46. Kendall, M.G. 1938. \"New Measure Rank Correlation.\" Biometrika 30(1/2): 81--93. Scott, William . 1955. \"Reliability Content Analysis: Case Nominal Scale Coding.\" Public Opinion Quarterly 19(3): 321--5. Signorino, Curtis S. Jeffrey M. Ritter. \"Tau-b Tau-B: Measuring Similarity Foreign Policy Positions.\" 43(1): 115--44.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"citations-for-the-underlying-data-informing-the-similarity-measure","dir":"Reference","previous_headings":"","what":"Citations for the Underlying Data Informing the Similarity Measure","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Haege (2011) also suggests cite underlying data informing similarity measure, whether UN voting alliances. case, recommended Voeten citation 2013 alliance data proper. case alliances, know Gibler's (2009) book recommended even alliance data since updated (reflected measure). UN voting data, understanding 2017 paper Journal Conflict Resolution also preferred citation. Bailey, Michael ., Anton Strezhnev, Erik Voeten. 2017. \"Estimating Dynamic State Preferences United Nations Voting Data.\" Journal Conflict Resolution 61(2): 430--456. Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"","code":"if (FALSE) { # just call `library(tidyverse)` at the top of the your script. library(magrittr) # The function below works, but depends on # running `download_extdata()` beforehand. cow_ddy %>% add_fpsim() # Select just the two kappa measures that are suggested defaults. # `kappaba`: kappa for binary alliance data if you have pre-WWII data. # `kappavv`: kappa for UN voting data if you just post-WWII data. cow_ddy %>% add_fpsim(keep=c(\"kappaba\", \"kappavv\")) }"},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"add_gml_mids() merges GML's MID data (dyad-year, leader-year, leader-dyad-year, state-year) data frame. current version GML MID data 2.2.1.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"","code":"add_gml_mids(data, keep, init = \"sidea-all-joiners\")"},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"data data frame appropriate peacesciencer attributes keep optional parameter, specified character vector, applicable just dyad-year data, passed function select(one_of(.)) wrapper. allows user discard unwanted columns directed dispute data output consume much space memory. Note: Correlates War system codes (ccode1, ccode2), observation year (year), presence absence ongoing MID (gmlmidongoing), presence absence unique MID onset (gmlmidonset) always returned. foolish self-defeating eliminate observations. user free keep discard anything else see fit. keep specified function, ensuing output returns everything. init initiators coded? Applicable state-year, leader-dyad-year, leader-year data. parameter accepts one three possible values (\"sidea-orig\", \"sidea--joiners\", \"sidea--joiners\"). \"sidea-orig\" = state initiates MID (appears summary return output) state Side onset dispute. \"sidea--joiners\" = state initiates MID (appears summary return output) state Side onset dispute state joined MID Side . \"sidea--joiners\" = state initiates MID (appears summary return output) state Side onset dispute joined point thereafter. See details section discussion. default \"sidea--joiners\".","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"add_gml_mids() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds dispute information GML MID data. data dyad-year, return laundry list information onsets, ongoing conflicts, assorted participant- dispute-level summaries. data leader-dyad-year, carefully matched leaders well. data state-year leader-year, function returns information ongoing disputes (onsets) whether ongoing disputes (onsets) state (leader) initiated.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. merging process employs several rules whittle duplicate dyad-years merging dyad-year data frame. function also return message user case-exclusion rules went process. Users interested implementing case-exclusion rules look \"whittle\" class functions also provided package. Determining \"initiation\" state-year summaries inter-state disputes possible since implied directionality \"initiation.\" half cases, straightforward. can use participant summaries determine dispute bilateral dispute escalate beyond attack, state Side initiated dispute. multilateral MIDs, conditions still hold least originators. However, considerable difficulty cases 1) participant-level summaries suggested actions level clash higher, 2) participant joiner originator. effort required flesh enormous, perhaps forthcoming future update. add_gml_mids() allows make one three judgment calls (see arguments section documentation). call make, say probably use option \"sidea--joiners\". review MID data Doug Gibler suggests states join dispute roped conflict (.e. targeted state) first incident. routinely initiate entry conflict, concept \"initiation\" supposed capture literature. doubt cases third state brought dispute actions state even original MID coding rules place high barrier coding type dispute entry. However, time required individually assess whether state initiated entry MID something simplest cases (e.g. bilateral cases highest participant action fell short clash) time-consuming. require audit almost half participant-level summaries data. forthcoming publication, Gibler Miller offer excellent coverage new data set militarized events. However, include confrontations World War II.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gml_mids() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 26 #> ccode1 ccode2 year dispnum gmlmidong…¹ gmlmi…² sidea1 sidea2 fatal…³ fatal…⁴ #> #> 1 2 20 1920 NA 0 0 NA NA NA NA #> 2 2 20 1921 NA 0 0 NA NA NA NA #> 3 2 20 1922 NA 0 0 NA NA NA NA #> 4 2 20 1923 NA 0 0 NA NA NA NA #> 5 2 20 1924 NA 0 0 NA NA NA NA #> 6 2 20 1925 NA 0 0 NA NA NA NA #> 7 2 20 1926 NA 0 0 NA NA NA NA #> 8 2 20 1927 NA 0 0 NA NA NA NA #> 9 2 20 1928 NA 0 0 NA NA NA NA #> 10 2 20 1929 NA 0 0 NA NA NA NA #> # … with 2,139,260 more rows, 16 more variables: fatalpre1 , #> # fatalpre2 , hiact1 , hiact2 , hostlev1 , #> # hostlev2 , orig1 , orig2 , fatality , hostlev , #> # recip , mindur , maxdur , stmon , init1 , #> # init2 , and abbreviated variable names ¹​gmlmidongoing, ²​gmlmidonset, #> # ³​fatality1, ⁴​fatality2 # keep just the dispute number and Side A/B identifiers cow_ddy %>% add_gml_mids(keep=c(\"dispnum\",\"sidea1\", \"sidea2\")) #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 12 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: dispnum , and abbreviated #> # variable name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"add_gwcode_to_cow() allows match, well one can, Gleditsch-Ward system membership data Correlates War state system membership data.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"","code":"add_gwcode_to_cow(data)"},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"add_gwcode_to_cow() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame already Correlates War state system codes adds corollary Gleditsch-Ward codes.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"data-raw directory project's Github contains information underlying data assists merging codes. user invariably need careful ask want data included. issue different composition merging process () perfect. can note case like Serbia/Yugoslavia difficult handle (since \"Serbia\" never overlaps \"Yugoslavia\" Gleditsch-Ward data Correlates War understands Serbia predecessor state, dominant state, successor state Yugoslavia). However, greater weirdness case like Yemen/Yemen Arab Republic. script create state-year dyad-year duplicates Correlates War codes. size original data remain unchanged. However, year duplicates various Gleditsch-Ward codes (e.g. Yemen, ). Use care. can also use countrycode package. Whether use function countrycode package, kind merging without assessing output.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gwcode_to_cow() #> # A tibble: 2,139,270 × 5 #> ccode1 ccode2 year gwcode1 gwcode2 #> #> 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 #> # … with 2,139,260 more rows create_stateyears() %>% add_gwcode_to_cow() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 4 #> ccode statenme year gwcode #> #> 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 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_igos.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"add_igos() allows add information Correlates War International Governmental Organizations data dyad-year state-year data, matching Correlates War system codes.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"","code":"add_igos(data)"},{"path":"http://svmiller.com/reference/add_igos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"add_igos() takes dyad-year data frame state-year data frame adds information available Correlates War International Governmental Organizations data. data dyad-year, function returns original data just one additional column total number mutual IGOs members dyad full members. data state-year, function returns original data four additional columns. number IGOs state full member, number IGOs state associate member, number IGOs state observer, number IGOs state involved way (.e. sum three columns).","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"Pevehouse, Jon C.W., Timothy Nordstron, Roseanne W McManus, Anne Spencer Jamison. 2020. \"Tracking Organizations World: Correlates War IGO Version 3.0 datasets.\" Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"","code":"# \\donttest{ # just call library(tidyverse) at the top of the pipe library(magrittr) cow_ddy %>% add_igos() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year dyadigos #> #> 1 2 20 1920 7 #> 2 2 20 1921 8 #> 3 2 20 1922 8 #> 4 2 20 1923 7 #> 5 2 20 1924 7 #> 6 2 20 1925 8 #> 7 2 20 1926 8 #> 8 2 20 1927 8 #> 9 2 20 1928 8 #> 10 2 20 1929 8 #> # … with 2,139,260 more rows create_stateyears() %>% add_igos() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year sum_igo_full sum_igo_a…¹ sum_i…² sum_i…³ #> #> 1 2 United States of America 1816 0 0 0 0 #> 2 2 United States of America 1817 0 0 0 0 #> 3 2 United States of America 1818 0 0 0 0 #> 4 2 United States of America 1819 0 0 0 0 #> 5 2 United States of America 1820 0 0 0 0 #> 6 2 United States of America 1821 0 0 0 0 #> 7 2 United States of America 1822 0 0 0 0 #> 8 2 United States of America 1823 0 0 0 0 #> 9 2 United States of America 1824 0 0 0 0 #> 10 2 United States of America 1825 0 0 0 0 #> # … with 17,111 more rows, and abbreviated variable names ¹​sum_igo_associate, #> # ²​sum_igo_observer, ³​sum_igo_anytype # }"},{"path":"http://svmiller.com/reference/add_lead.html","id":null,"dir":"Reference","previous_headings":"","what":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"add_lead() allows add data recorded LEAD data leader-year leader-dyad-year data.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"","code":"add_lead(data, keep)"},{"path":"http://svmiller.com/reference/add_lead.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"data leader-year leader-dyad-year data frame keep optional parameter, specified character vector, leader attributes user wants return function. keep specified, everything LEAD data package returned. Otherwise, function subsets LEAD data just user wants.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"add_lead() takes leader-year leader-dyad-year data frame adds data recorded LEAD data . leader-dyad-year data, suffices \"1\" \"2\" added data indicate attributes first leader (obsid1) second leader (obsid2), respectively.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"Ellis, Carli Mortenson, Michael C. Horowitz, Allan C. Stam. 2015. \"Introducing LEAD Data Set.\" International Interactions 41(4): 718--741.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_leaderyears() %>% add_lead() #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 18 #> obsid leader gwcode gender leade…¹ year yrino…² level…³ milse…⁴ combat rebel #> #> 1 USA-… Grant 2 M 47 1869 1 2 1 1 0 #> 2 USA-… Grant 2 M 48 1870 2 2 1 1 0 #> 3 USA-… Grant 2 M 49 1871 3 2 1 1 0 #> 4 USA-… Grant 2 M 50 1872 4 2 1 1 0 #> 5 USA-… Grant 2 M 51 1873 5 2 1 1 0 #> 6 USA-… Grant 2 M 52 1874 6 2 1 1 0 #> 7 USA-… Grant 2 M 53 1875 7 2 1 1 0 #> 8 USA-… Grant 2 M 54 1876 8 2 1 1 0 #> 9 USA-… Grant 2 M 55 1877 9 2 1 1 0 #> 10 USA-… Hayes 2 M 55 1877 1 3 1 1 0 #> # … with 17,676 more rows, 7 more variables: warwin , warloss , #> # rebelwin , rebelloss , yrsexper , physhealth , #> # mentalhealth , and abbreviated variable names ¹​leaderage, ²​yrinoffice, #> # ³​leveledu, ⁴​milservice create_leaderyears() %>% add_lead(keep = c(\"yrsexper\")) #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 8 #> obsid leader gwcode gender leaderage year yrinoffice yrsexper #> #> 1 USA-1869 Grant 2 M 47 1869 1 0 #> 2 USA-1869 Grant 2 M 48 1870 2 0 #> 3 USA-1869 Grant 2 M 49 1871 3 0 #> 4 USA-1869 Grant 2 M 50 1872 4 0 #> 5 USA-1869 Grant 2 M 51 1873 5 0 #> 6 USA-1869 Grant 2 M 52 1874 6 0 #> 7 USA-1869 Grant 2 M 53 1875 7 0 #> 8 USA-1869 Grant 2 M 54 1876 8 0 #> 9 USA-1869 Grant 2 M 55 1877 9 0 #> 10 USA-1877 Hayes 2 M 55 1877 1 12 #> # … with 17,676 more rows # }"},{"path":"http://svmiller.com/reference/add_lwuf.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"add_lwuf() allows add estimates leader willingness use force leader-year data leader-dyad-year data.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"","code":"add_lwuf(data, keep)"},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"data leader-year leader dyad-year data frame generated peacesciencer keep optional argument, specified character vector, variables lwuf data frame user wants data. See lwuf data documentation . argument unspecified, function return measures leader willingness use force generated Carter Smith.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"add_lwuf() takes leader-year leader-dyad-year data frame adds estimates leader willingness use force, generated Carter Smith (2020).","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"See lwuf information, copy-paste . letter published Carter Smith (2020) contains information thetas refer. \"M1\" theta variation standard Rasch model boilerplate information LEAD data. authors consider \"theoretically relevant\" \"risk-related\" refer conflict risk-taking. \"M2\" theta expands \"M1\" including political orientation psychological characteristics. \"M3\" \"M4\" expand \"M1\" \"M2\" considering 36 variables LEAD data. authors construct include measures, though analyses suggest \"M2\" best-performing measure. probably consider using theta2_mean default estimate leader willingness use force leader-year analyses.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"Carter, Jeff Charles E. Smith, Jr. 2020. \"Framework Measuring Leaders' Willingness Use Force.\" American Political Science Review 114(4): 1352--1358.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_leaderyears() %>% add_lwuf() #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 15 #> obsid leader gwcode gender leaderage year yrino…¹ theta…² theta…³ theta…⁴ #> #> 1 USA-1869 Grant 2 M 47 1869 1 1.01 0.509 1.04 #> 2 USA-1869 Grant 2 M 48 1870 2 1.01 0.509 1.04 #> 3 USA-1869 Grant 2 M 49 1871 3 1.01 0.509 1.04 #> 4 USA-1869 Grant 2 M 50 1872 4 1.01 0.509 1.04 #> 5 USA-1869 Grant 2 M 51 1873 5 1.01 0.509 1.04 #> 6 USA-1869 Grant 2 M 52 1874 6 1.01 0.509 1.04 #> 7 USA-1869 Grant 2 M 53 1875 7 1.01 0.509 1.04 #> 8 USA-1869 Grant 2 M 54 1876 8 1.01 0.509 1.04 #> 9 USA-1869 Grant 2 M 55 1877 9 1.01 0.509 1.04 #> 10 USA-1877 Hayes 2 M 55 1877 1 0.464 0.545 0.472 #> # … with 17,676 more rows, 5 more variables: theta2_sd , #> # theta3_mean , theta3_sd , theta4_mean , theta4_sd , and #> # abbreviated variable names ¹​yrinoffice, ²​theta1_mean, ³​theta1_sd, #> # ⁴​theta2_mean # }"},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add minimum distance data to your data frame — add_minimum_distance","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"add_minimum_distance() allows add minimum distance (kilometers) (dyad-year, leader-year, leader-dyad-year, state-year) data frame. estimates recorded cow_mindist gw_mindist data come package. data current end 2019.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"","code":"add_minimum_distance(data)"},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"add_minimum_distance() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds minimum distance first state second state (dyad-year data) minimum minimum (sic) distance given state given year.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"function leans attributes data provided one \"create\" functions package (e.g. create_dyadyear() create_stateyear()).","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_minimum_distance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year mindist #> #> 1 2 20 1920 NA #> 2 2 20 1921 0 #> 3 2 20 1922 0 #> 4 2 20 1923 0 #> 5 2 20 1924 0 #> 6 2 20 1925 0 #> 7 2 20 1926 0 #> 8 2 20 1927 0 #> 9 2 20 1928 0 #> 10 2 20 1929 0 #> # … with 2,139,260 more rows create_dyadyears(system = \"gw\") %>% add_minimum_distance() #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 4 #> gwcode1 gwcode2 year mindist #> #> 1 2 20 1867 NA #> 2 2 20 1868 NA #> 3 2 20 1869 NA #> 4 2 20 1870 NA #> 5 2 20 1871 NA #> 6 2 20 1872 NA #> 7 2 20 1873 NA #> 8 2 20 1874 NA #> 9 2 20 1875 NA #> 10 2 20 1876 NA #> # … with 2,089,816 more rows create_stateyears(system =\"gw\") %>% add_minimum_distance() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 4 #> gwcode statename year minmindist #> #> 1 2 United States of America 1816 NA #> 2 2 United States of America 1817 NA #> 3 2 United States of America 1818 NA #> 4 2 United States of America 1819 NA #> 5 2 United States of America 1820 NA #> 6 2 United States of America 1821 NA #> 7 2 United States of America 1822 NA #> 8 2 United States of America 1823 NA #> 9 2 United States of America 1824 NA #> 10 2 United States of America 1825 NA #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_nmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War National Military Capabilities Data — add_nmc","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"add_nmc() allows add Correlates War National Material Capabilities data data.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"","code":"add_nmc(data)"},{"path":"http://svmiller.com/reference/add_nmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"add_nmc() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information national material capabilities state two states dyad given year. data dyad-year (leader-dyad-year), function adds 12 total columns first state (.e. ccode1) second state (.e. ccode2) estimates national military capabilities provided Correlates War project. data state-year (leader-year), function returns six additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"Singer, J. David, Stuart Bremer, John Stuckey. (1972). \"Capability Distribution, Uncertainty, Major Power War, 1820-1965.\" Bruce Russett (ed) Peace, War, Numbers, Beverly Hills: Sage, 19-48. Singer, J. David. 1987. \"Reconstructing Correlates War Dataset Material Capabilities States, 1816-1985.\" International Interactions 14(1): 115-32.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_nmc() #> # A tibble: 2,139,270 × 17 #> ccode1 ccode2 year milex1 milper1 irst1 pec1 tpop1 upop1 cinc1 milex2 #> #> 1 2 20 1920 1657118 343 42809 743808 106461 27428 0.290 10755 #> 2 2 20 1921 1116342 387 20101 622541 108538 28210 0.253 10209 #> 3 2 20 1922 860853 270 36173 641311 110049 29013 0.256 10028 #> 4 2 20 1923 678256 247 45665 834889 111947 29840 0.272 13316 #> 5 2 20 1924 570142 261 38540 762070 114109 30690 0.254 12824 #> 6 2 20 1925 589706 252 46122 790029 115829 31565 0.254 12984 #> 7 2 20 1926 558004 247 49069 852304 117397 32464 0.263 13936 #> 8 2 20 1927 596501 249 45656 842978 119035 33389 0.239 16745 #> 9 2 20 1928 678100 251 52371 833446 120509 34340 0.240 18862 #> 10 2 20 1929 701300 255 57339 903141 121767 35318 0.240 21058 #> # … with 2,139,260 more rows, and 6 more variables: milper2 , irst2 , #> # pec2 , tpop2 , upop2 , cinc2 create_stateyears() %>% add_nmc() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 10 #> ccode statenme year milex milper irst pec tpop upop cinc #> #> 1 2 United States of Ame… 1816 3823 17 80 254 8659 101 0.0397 #> 2 2 United States of Ame… 1817 2466 15 80 277 8899 106 0.0358 #> 3 2 United States of Ame… 1818 1910 14 90 302 9139 112 0.0361 #> 4 2 United States of Ame… 1819 2301 13 90 293 9379 118 0.0371 #> 5 2 United States of Ame… 1820 1556 15 110 303 9618 124 0.0371 #> 6 2 United States of Ame… 1821 1612 11 100 321 9939 130 0.0342 #> 7 2 United States of Ame… 1822 1079 10 100 332 10268 136 0.0329 #> 8 2 United States of Ame… 1823 1170 11 110 345 10596 143 0.0331 #> 9 2 United States of Ame… 1824 1261 11 110 390 10924 151 0.0330 #> 10 2 United States of Ame… 1825 1336 11 120 424 11252 158 0.0342 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_peace_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Peace Years to Your Conflict Data — add_peace_years","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"add_peace_years() calculates peace years ongoing conflicts. function works dyad-year state-year data generated peacesciencer. forthcoming v. 0.7.0, add_peace_years() deprecated generic versatile add_spells(). Users free continue function, though recommend balanced panels (like state-year dyad-year), less imbalanced panels (like leader-years, leader-dyad-years). change name implies, add_spells() greater flexibility cross-sectional units time.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"","code":"add_peace_years(data, pad = FALSE)"},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame pad optional parameter, defaults FALSE. TRUE, peace-year calculations fill cases panels unbalanced/gaps. Think state like Germany disappearing 45 years illustrative .","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"add_peace_years() takes dyad-year state-year data frame adds peace years ongoing conflicts. Dyadic conflict data supported include Correlates War (CoW) Militarized Interstate Dispute (MID) data set Gibler-Miller-Little (GML) corrections CoW-MID. State-level conflict data supported function include UCDP armed conflict data CoW intra-state war data.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"function internally uses sbtscs() stevemisc. interest full disclosure, sbtscs() leans heavily btscs() DAMisc. optimized code performance. Importantly, underlying function (sbtscs() stevemisc, way btscs() DAMisc) important performance issues trying run event data sandwiched observations without event data. mean. Assume got full Gleditsch-Ward state-year data 1816 2020 added UCDP armed conflict data . want peace-years , function fail every year 1816 1945 (along 2020, writing) event data. can force function \"fail\" setting pad = TRUE argument, clear advisable reason. Assume wanted event data UCDP just extrasystemic onsets. data start 1946 , 1946, United Kingdom, Netherlands, France extrasystemic conflicts. years 1946, events imputed 1 countries 1s first year observation everyone else NA implicitly assumed zero. NAs, function runs sequence resulting wonky spells 1946 implied (absence ) data. fact, none implied absence data 1946. function works just fine truncate temporal domain reflect nature event data. Basically, want use function generally, filter dyad-year state-year data make sure years without event data recorded (e.g. CoW-MID analyses dyad-years observations 1816?). less problem years -NAs succeed (precede) event data. example, UCDP conflict data run 1946 2019 (writing). 2020 observations compromise function output pad = TRUE included argument. Finally, add_peace_years() calculate peace years leave temporal dependence adjustment taste researcher. Importantly, recommend manually creating splines square/cube terms creates problems adjusting temporal dependence model predictions. regression formula R, can specify Carter Signorino (2010) approach ... + gmlmidspell + (gmlmidspell^2) + (gmlmidspell^3) (assuming ran add_peace_years() dyad-year data frame including Gibler-Miller-Little conflict data). Beck et al. cubic splines approach ... + splines::bs(gmlmidspell, 4). function includes spell three splines (hence 4 command). Either approach makes easier model predictions, given R's functionality.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"Armstrong, Dave. 2016. ``DAMisc: Dave Armstrong's Miscellaneous Functions.'' R package version 1.4-3. Beck, Nathaniel, Jonathan N. Katz, Richard Tucker. 1998. \"Taking Time Seriously: Time-Series-Cross-Section Analysis Binary Dependent Variable.\" American Journal Political Science 42(4): 1260--1288. Carter, David B. Curtis S. Signorino. 2010. \"Back Future: Modeling Time Dependence Binary Data.\" Political Analysis 18(3): 271--292. Miller, Steven V. 2017. ``Quickly Create Peace Years BTSCS Models sbtscs stevemisc.'' http://svmiller.com/blog/2017/06/quickly-create-peace-years--btscs-models--stevemisc/","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gml_mids(keep = NULL) %>% add_cow_mids(keep = NULL) %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() %>% add_peace_years() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(year, dyad)` #> Joining with `by = join_by(year, dyad)` #> # A tibble: 246,302 × 19 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 246,292 more rows, 8 more variables: cowmidonset , #> # cowmidongoing , conttype , cowmaj1 , cowmaj2 , #> # prd , cowmidspell , gmlmidspell , and abbreviated variable #> # name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Add rugged terrain information to a data frame — add_rugged_terrain","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"add_rugged_terrain() allows add information, however crude, \"ruggedness\" state's terrain (dyad-year, leader-year, leader-dyad-year, state-year) data.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"","code":"add_rugged_terrain(data)"},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"add_rugged_terrain() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame, whether primary state identifiers Correlates War system Gleditsch-Ward system, returns information \"ruggedness\" state's terrain. two indicators returned \"terrain ruggedness index\" calculated Nunn Puga (2012) logarithmic transformation mountainous state (calculated Gibler Miller, 2014). dyad-year (leader-dyad-year) data get four additional columns (.e. indicators states dyad) whereas state-year data get just two additional columns.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Please see information underlying data rugged, associated R script data-raw directory, see data generated. Importantly, data time-agnostic move slowly. talking geography . data sets benchmark around 1999-2000 leap faith use data comparisons across entirety Correlates War Gleditsch-Ward system membership. Every use data types either cross-sectional snapshots making state--state comparisons World War II (think prominent civil war studies ). mindful expect get data. underlying data Gleditsch-Ward codes Correlates War codes. merge makes depends declare \"master\" system top pipe (e.g.. create_dyadyears() create_stateyears()). , example, run create_stateyears(system=\"cow\") follow add_gwcode_to_cow(), merge Correlates War codes Gleditsch-Ward codes. can see script mechanics see achieved.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Fearon, James D., David Laitin, \"Ethnicity, Insurgency, Civil War\" American Political Science Review 97: 75–90. Gibler, Douglas M. Steven V. Miller. 2014. \"External Territorial Threat, State Capacity, Civil War.\" Journal Peace Research 51(5): 634-646. Nunn, Nathan Diego Puga. 2012. \"Ruggedness: Blessing Bad Geography Africa.\" Review Economics Statistics. 94(1): 20-36. Riley, Shawn J., Stephen D. DeGloria, Robert Elliot. 1999. \"Terrain Ruggedness Index Quantifies Topographic Heterogeneity,” Intermountain Journal Sciences 5: 23–27.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_rugged_terrain() #> # A tibble: 2,139,270 × 7 #> ccode1 ccode2 year rugged1 newlmtnest1 rugged2 newlmtnest2 #> #> 1 2 20 1920 1.07 3.21 0.775 2.80 #> 2 2 20 1921 1.07 3.21 0.775 2.80 #> 3 2 20 1922 1.07 3.21 0.775 2.80 #> 4 2 20 1923 1.07 3.21 0.775 2.80 #> 5 2 20 1924 1.07 3.21 0.775 2.80 #> 6 2 20 1925 1.07 3.21 0.775 2.80 #> 7 2 20 1926 1.07 3.21 0.775 2.80 #> 8 2 20 1927 1.07 3.21 0.775 2.80 #> 9 2 20 1928 1.07 3.21 0.775 2.80 #> 10 2 20 1929 1.07 3.21 0.775 2.80 #> # … with 2,139,260 more rows create_stateyears() %>% add_rugged_terrain() #> Joining with `by = join_by(ccode)` #> # A tibble: 17,121 × 5 #> ccode statenme year rugged newlmtnest #> #> 1 2 United States of America 1816 1.07 3.21 #> 2 2 United States of America 1817 1.07 3.21 #> 3 2 United States of America 1818 1.07 3.21 #> 4 2 United States of America 1819 1.07 3.21 #> 5 2 United States of America 1820 1.07 3.21 #> 6 2 United States of America 1821 1.07 3.21 #> 7 2 United States of America 1822 1.07 3.21 #> 8 2 United States of America 1823 1.07 3.21 #> 9 2 United States of America 1824 1.07 3.21 #> 10 2 United States of America 1825 1.07 3.21 #> # … with 17,111 more rows create_stateyears(system = \"gw\") %>% add_rugged_terrain() #> Joining with `by = join_by(gwcode)` #> # A tibble: 18,637 × 5 #> gwcode statename year rugged newlmtnest #> #> 1 2 United States of America 1816 1.07 3.21 #> 2 2 United States of America 1817 1.07 3.21 #> 3 2 United States of America 1818 1.07 3.21 #> 4 2 United States of America 1819 1.07 3.21 #> 5 2 United States of America 1820 1.07 3.21 #> 6 2 United States of America 1821 1.07 3.21 #> 7 2 United States of America 1822 1.07 3.21 #> 8 2 United States of America 1823 1.07 3.21 #> 9 2 United States of America 1824 1.07 3.21 #> 10 2 United States of America 1825 1.07 3.21 #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"add_sdp_gdp() allows add estimated GDP \"surplus\" domestic product data 2020 analysis published International Studies Quarterly Anders, Fariss, Markowitz.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"","code":"add_sdp_gdp(data)"},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"add_sdp_gdp() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information estimated gross domestic product (2011 USD) year, estimated population year, GDP per capita year, Anders, Fariss Markowitz term \"surplus domestic product\" year. data dyad-year (leader-dyad-year), function adds eight total columns first state (.e. ccode1) second state (.e. ccode2) estimates. data state-year (leader-year), function returns four additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"function leans attributes data provided one \"create\" functions. Make sure recognized function (data created function) appear top proverbial pipe. Users also want note underlying function access two different data sets. appears results published International Studies Quarterly used Correlates War classification, follow-repository Github uses Gleditsch-Ward classification. extent estimates generated simulation, mean estimates slightly different across data sets even common observations (e.g. United States 1816). large nominal numbers, estimates log-transformed. Users can always exponentiate choose. Researchers can use data construct reasonable estimates surplus GDP per capita, must exponentiate underlying variables . mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_sdp_gdp() #> # A tibble: 2,139,270 × 11 #> ccode1 ccode2 year wbgdp20…¹ wbpop…² sdpest1 wbgdp…³ wbgdp…⁴ wbpop…⁵ sdpest2 #> #> 1 2 20 1920 27.6 18.4 27.5 9.19 24.8 15.9 24.7 #> 2 2 20 1921 27.6 18.5 27.5 9.18 24.8 16.0 24.6 #> 3 2 20 1922 27.7 18.5 27.6 9.21 24.8 16.0 24.7 #> 4 2 20 1923 27.8 18.5 27.7 9.26 24.9 16.0 24.7 #> 5 2 20 1924 27.8 18.5 27.7 9.30 24.9 16.0 24.8 #> 6 2 20 1925 27.9 18.5 27.8 9.32 25.0 16.0 24.9 #> 7 2 20 1926 27.9 18.5 27.8 9.34 25.1 16.0 24.9 #> 8 2 20 1927 27.9 18.6 27.8 9.35 25.1 16.1 25.0 #> 9 2 20 1928 27.9 18.6 27.8 9.36 25.2 16.1 25.0 #> 10 2 20 1929 27.9 18.6 27.8 9.35 25.1 16.1 25.0 #> # … with 2,139,260 more rows, 1 more variable: wbgdppc2011est2 , and #> # abbreviated variable names ¹​wbgdp2011est1, ²​wbpopest1, ³​wbgdppc2011est1, #> # ⁴​wbgdp2011est2, ⁵​wbpopest2 create_stateyears() %>% add_sdp_gdp() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year wbgdp2011est wbpopest sdpest wbgdppc20…¹ #> #> 1 2 United States of America 1816 23.6 15.9 22.9 7.66 #> 2 2 United States of America 1817 23.6 16.0 22.9 7.64 #> 3 2 United States of America 1818 23.6 16.0 22.9 7.64 #> 4 2 United States of America 1819 23.7 16.0 23.0 7.66 #> 5 2 United States of America 1820 23.7 16.1 23.0 7.66 #> 6 2 United States of America 1821 23.8 16.1 23.1 7.68 #> 7 2 United States of America 1822 23.8 16.1 23.1 7.70 #> 8 2 United States of America 1823 23.8 16.1 23.1 7.69 #> 9 2 United States of America 1824 23.9 16.2 23.2 7.69 #> 10 2 United States of America 1825 23.9 16.2 23.3 7.72 #> # … with 17,111 more rows, and abbreviated variable name ¹​wbgdppc2011est create_stateyears(system = \"gw\") %>% add_sdp_gdp() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 7 #> gwcode statename year wbgdp2011est wbpopest sdpest wbgdppc2…¹ #> #> 1 2 United States of America 1816 23.6 15.9 22.8 7.66 #> 2 2 United States of America 1817 23.6 16.0 22.8 7.64 #> 3 2 United States of America 1818 23.6 16.0 22.9 7.64 #> 4 2 United States of America 1819 23.7 16.0 22.9 7.66 #> 5 2 United States of America 1820 23.7 16.1 23.0 7.66 #> 6 2 United States of America 1821 23.8 16.1 23.0 7.68 #> 7 2 United States of America 1822 23.8 16.1 23.1 7.70 #> 8 2 United States of America 1823 23.8 16.1 23.1 7.69 #> 9 2 United States of America 1824 23.9 16.2 23.2 7.69 #> 10 2 United States of America 1825 23.9 16.2 23.2 7.72 #> # … with 18,627 more rows, and abbreviated variable name ¹​wbgdppc2011est"},{"path":"http://svmiller.com/reference/add_spells.html","id":null,"dir":"Reference","previous_headings":"","what":"Add ","title":"Add ","text":"add_spells() calculates \"spells\" state-year, leader-year, dyad-year data. application mostly concerned things like \"peace spells\" conflicts given cross-sectional unit (e.g. state dyad).","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add ","text":"","code":"add_spells(data, conflict_event_type = \"ongoing\", ongo = FALSE)"},{"path":"http://svmiller.com/reference/add_spells.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add ","text":"data applicable data frame (e.g. leader-year, dyad-year, state-year, created peacesciencer) conflict_event_type type event spells calculated, either \"ongoing\" \"onset\". Default \"ongoing\". \"ongoing\", spells calculated presence ongoing event. \"onset\", spells calculated onset conflict event successive zeros (observed) calculated \"peace\". See Details section . ongo TRUE, successive 1s considered ongoing events treated NA first 1. FALSE, successive 1s treated failures. Defaults FALSE.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add ","text":"add_spells() takes dyad-year, leader-year, state-year data frame adds spells ongoing conflicts. Dyadic conflict data supported include Correlates War (CoW) Militarized Interstate Dispute (MID) data set Gibler-Miller-Little (GML) corrections CoW-MID. State-level conflict data supported function include UCDP armed conflict data CoW intra-state war data. Leader-year conflict data supported include GML MID data.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add ","text":"function internally uses ps_spells() stevemisc. interest full disclosure, ps_spells() leans heavily add_duration() spduration. optimized code performance. Thinking application like peace-years, add_spells() calculate peace years leave temporal dependence adjustment taste researcher. Importantly, recommend manually creating splines square/cube terms creates problems adjusting temporal dependence model predictions. regression formula R, can specify Carter Signorino (2010) approach ... + gmlmidspell + (gmlmidspell^2) + (gmlmidspell^3) (assuming ran add_spells() dyad-year data frame including Gibler-Miller-Little conflict data). Beck et al. cubic splines approach ... + splines::bs(gmlmidspell, 4). function includes spell three splines (hence 4 command). Either approach makes easier model predictions, given R's functionality. Thinking dyadic analyses conflict, always understood something like \"peace-years\" calculated ongoing event onset event. Think something like Iran-Iraq War (MID#2115) illustrative . MID (became war) started 1980 ended 1988. bilateral incidents Iran-Iraq independent war, per Correlates War coding rules. peace years calculated \"onset\" event, list peace-years two countries 1981 1988. never understood make sense, still seen others insist correct way . add_peace_years() force calculation ongoing event, still maintain correct. add_spells() allow calculate onsets, even ongoing events default. underlying function add_spells() stop without return NAs bracketing observed events. surest way happen something like dyad-year analysis inter-state conflicts 1816 2010, create_dyadyears() created observations 2011 2020 well. Remove using function confine temporal domain just time-units (e.g. years) observed event data. See example .","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add ","text":"Beger, Andreas, Daina Chiba, Daniel W. Hill, Jr, Nils W. Metternich, Shahryar Minhas Michael D. Ward. 2018. ``spduration: Split-Population Duration (Cure) Regression.'' R package version 0.17.1. Beck, Nathaniel, Jonathan N. Katz, Richard Tucker. 1998. \"Taking Time Seriously: Time-Series-Cross-Section Analysis Binary Dependent Variable.\" American Journal Political Science 42(4): 1260--1288. Carter, David B. Curtis S. Signorino. 2010. \"Back Future: Modeling Time Dependence Binary Data.\" Political Analysis 18(3): 271--292.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add ","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add ","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) aaa <- subset(cow_ddy, year <= 2010) aaa %>% add_gml_mids(keep = NULL) %>% add_cow_mids(keep = NULL) %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() %>% add_spells() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(orig_order)` #> Joining with `by = join_by(orig_order)` #> # A tibble: 224,564 × 19 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 224,554 more rows, 8 more variables: cowmidonset , #> # cowmidongoing , conttype , cowmaj1 , cowmaj2 , #> # prd , gmlmidspell , cowmidspell , and abbreviated variable #> # name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() merges Thompson Dreyer's (2012) strategic rivalry data dyad-year data frame. right-bound, right now, bound 2010.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"","code":"add_strategic_rivalries(data, across_types = 1)"},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"data dyad-year data frame (either \"directed\" \"non-directed\") across_types optional, relevant state-year, takes value 1, 2, 3 look whether one three types fits criteria ideological, interventionary, positional, spatial rivalry. Defaults 1.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() takes dyad-year data frame adds information ongoing strategic rivalries. also include simple dummy variable whether ongoing rivalry year . state-year data, returns count ongoing strategic rivalries state year meeting certain criteria (.e. whether state interventionary, ideological, positional, spatial rivalry ongoing year, many).","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() include information derived rivalry data user may want (e.g. start year rivalry). Feel free select fact. Function includes --fly adjustment Austria rivalry #79. case, Austria-Serbia rivalry continues two years Austria-Hungary (ccode: 300) became Austria (ccode: 305). across_types argument optional observed state-year calls. defaults 1. default, function looks rivalry data (td_rivalries) focuses type1 column. , say, state ongoing rivalry primarily spatial, codes spatial rivalry. Assume input across_types = 2, function looks across type1 type2 columns see spatial component rivalry either primary secondary dimension. , codes 1. across_types must 1, 2, 3.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R. David Dreyer. 2012. Handbook International Rivalries. CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_strategic_rivalries() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 12 #> ccode1 ccode2 year rivalryno rival…¹ styear endyear region type1 type2 type3 #> #> 1 2 20 1920 NA NA NA NA NA NA NA NA #> 2 2 20 1921 NA NA NA NA NA NA NA NA #> 3 2 20 1922 NA NA NA NA NA NA NA NA #> 4 2 20 1923 NA NA NA NA NA NA NA NA #> 5 2 20 1924 NA NA NA NA NA NA NA NA #> 6 2 20 1925 NA NA NA NA NA NA NA NA #> 7 2 20 1926 NA NA NA NA NA NA NA NA #> 8 2 20 1927 NA NA NA NA NA NA NA NA #> 9 2 20 1928 NA NA NA NA NA NA NA NA #> 10 2 20 1929 NA NA NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: ongoingrivalry , and #> # abbreviated variable name ¹​rivalryname # across_types defaults to 1 create_stateyears() %>% add_strategic_rivalries() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year ideological interventi…¹ posit…² spatial #> #> 1 2 United States of America 1816 0 0 1 1 #> 2 2 United States of America 1817 0 0 1 1 #> 3 2 United States of America 1818 0 0 1 1 #> 4 2 United States of America 1819 0 0 1 1 #> 5 2 United States of America 1820 0 0 1 0 #> 6 2 United States of America 1821 0 0 1 1 #> 7 2 United States of America 1822 0 0 1 1 #> 8 2 United States of America 1823 0 0 1 1 #> 9 2 United States of America 1824 0 0 1 1 #> 10 2 United States of America 1825 0 0 1 1 #> # … with 17,111 more rows, and abbreviated variable names ¹​interventionary, #> # ²​positional # }"},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":null,"dir":"Reference","previous_headings":"","what":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"add_ucdp_acd() allows add UCDP Armed Conflict data state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"","code":"add_ucdp_acd(data, type, issue, only_wars = FALSE)"},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"data state-year data frame type types armed conflicts user wants consider, specified character vector. Options include \"extrasystemic\", \"interstate\", \"intrastate\", \"II\". \"II\" convenience shorthand \"internationalized intrastate\". want just one (say: \"intrastate\"), type want quotes sufficient. want multiple, wrap vector c(). issue want subset data just different armed conflicts different types issues? , specify type argument. Options include \"territory\", \"government\", \"\". only_wars subsets conflict data just intensity levels \"war\" (.e. >1,000 deaths). Defaults FALSE.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"add_ucdp_acd() takes state-year data frame returns state-year information UCDP Armed Conflict data set (v. 20.1). variables returned whether ongoing armed conflict year, whether armed conflict episode onset year, maximum intensity observed year (armed conflict observed), character vector associated conflict IDs year.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Right now, state-year data supported. worth saying \"\" issue argument understood equivalent c(\"territory\",\"government\"). former kind \"\" (boolean speak) explicit category data. latter \"\" (boolean speak) likelihood want tempted specify \"\" issue argument.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union create_stateyears(system = \"gw\") %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 10,490 × 7 #> gwcode statename year ucdpongoing ucdponset maxinte…¹ confl…² #> #> 1 2 United States of America 1946 0 0 NA NA #> 2 2 United States of America 1947 0 0 NA NA #> 3 2 United States of America 1948 0 0 NA NA #> 4 2 United States of America 1949 0 0 NA NA #> 5 2 United States of America 1950 1 1 1 238 #> 6 2 United States of America 1951 0 0 NA NA #> 7 2 United States of America 1952 0 0 NA NA #> 8 2 United States of America 1953 0 0 NA NA #> 9 2 United States of America 1954 0 0 NA NA #> 10 2 United States of America 1955 0 0 NA NA #> # … with 10,480 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids create_stateyears(system = \"gw\") %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd(type = \"intrastate\", issue = \"government\") #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 10,490 × 7 #> gwcode statename year ucdpongoing ucdponset maxinte…¹ confl…² #> #> 1 2 United States of America 1946 0 0 NA NA #> 2 2 United States of America 1947 0 0 NA NA #> 3 2 United States of America 1948 0 0 NA NA #> 4 2 United States of America 1949 0 0 NA NA #> 5 2 United States of America 1950 0 0 NA NA #> 6 2 United States of America 1951 0 0 NA NA #> 7 2 United States of America 1952 0 0 NA NA #> 8 2 United States of America 1953 0 0 NA NA #> 9 2 United States of America 1954 0 0 NA NA #> 10 2 United States of America 1955 0 0 NA NA #> # … with 10,480 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids"},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"Add UCDP onsets to state-year data — add_ucdp_onsets","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"add_ucdp_onsets() allows add information conflict episode onsets UCDP data program state-year data.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"","code":"add_ucdp_onsets(data)"},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"data state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"add_ucdp_onsets() takes state-year data frame adds summary variables based armed conflict onsets data provided UCDP. variables returned sum new conflict dyads (exist) given state-year, sum new onset episodes (new conflicts) separated one, two, three, five, 10 years since last conflict episode.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe. underlying data version 19.1. Importantly, UCDP yearly onset data nominally state-year, technically state-dyad-episode-year cases onsets. example, four France-1946 observations four new conflict episodes Cambodia, Laos, Thailand, Vietnam. two Panama-1989 episodes, one invasion United States another failed coup attempt. means duplicates original data process summaries. user probably want consider kind recoding .","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) library(dplyr) create_stateyears(system=\"gw\") %>% add_ucdp_onsets() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 9 #> gwcode statename year sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ #> #> 1 2 United States o… 1816 0 0 0 0 0 0 #> 2 2 United States o… 1817 0 0 0 0 0 0 #> 3 2 United States o… 1818 0 0 0 0 0 0 #> 4 2 United States o… 1819 0 0 0 0 0 0 #> 5 2 United States o… 1820 0 0 0 0 0 0 #> 6 2 United States o… 1821 0 0 0 0 0 0 #> 7 2 United States o… 1822 0 0 0 0 0 0 #> 8 2 United States o… 1823 0 0 0 0 0 0 #> 9 2 United States o… 1824 0 0 0 0 0 0 #> 10 2 United States o… 1825 0 0 0 0 0 0 #> # … with 18,627 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 create_stateyears() %>% add_gwcode_to_cow() %>% add_ucdp_onsets() #> Joining with `by = join_by(ccode, year)` #> Joining with `by = join_by(year, gwcode)` #> # A tibble: 17,121 × 10 #> ccode statenme year gwcode sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ #> #> 1 2 United St… 1816 2 0 0 0 0 0 0 #> 2 2 United St… 1817 2 0 0 0 0 0 0 #> 3 2 United St… 1818 2 0 0 0 0 0 0 #> 4 2 United St… 1819 2 0 0 0 0 0 0 #> 5 2 United St… 1820 2 0 0 0 0 0 0 #> 6 2 United St… 1821 2 0 0 0 0 0 0 #> 7 2 United St… 1822 2 0 0 0 0 0 0 #> 8 2 United St… 1823 2 0 0 0 0 0 0 #> 9 2 United St… 1824 2 0 0 0 0 0 0 #> 10 2 United St… 1825 2 0 0 0 0 0 0 #> # … with 17,111 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 # Recall, these are summaries. You'll need to post-process to what you want. create_stateyears(system=\"gw\") %>% add_ucdp_onsets() %>% mutate(onset = ifelse(sumonset1 > 0, 1, 0)) #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 10 #> gwcode statename year sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ onset #> #> 1 2 United St… 1816 0 0 0 0 0 0 0 #> 2 2 United St… 1817 0 0 0 0 0 0 0 #> 3 2 United St… 1818 0 0 0 0 0 0 0 #> 4 2 United St… 1819 0 0 0 0 0 0 0 #> 5 2 United St… 1820 0 0 0 0 0 0 0 #> 6 2 United St… 1821 0 0 0 0 0 0 0 #> 7 2 United St… 1822 0 0 0 0 0 0 0 #> 8 2 United St… 1823 0 0 0 0 0 0 0 #> 9 2 United St… 1824 0 0 0 0 0 0 0 #> 10 2 United St… 1825 0 0 0 0 0 0 0 #> # … with 18,627 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 # }"},{"path":"http://svmiller.com/reference/archigos.html","id":null,"dir":"Reference","previous_headings":"","what":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"leader-level data drawn Archigos data. Space considerations mean offer just columns based data. Data version 4.1.","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"","code":"archigos"},{"path":"http://svmiller.com/reference/archigos.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"data frame 3409 observations following 11 variables. gwcode numeric vector Gleditsch-Ward state code obsid character vector observation ID leadid unique leader identifier leader leader name yrborn year leader born gender categorical variable leader gender (\"M\" men, \"W\" women) startdate date leader start date enddate date leader end date entry character vector leader's entry type exit character vector leader's exit type exitcode character vector information leader's exit type","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"Space considerations mean can offer columns overall data. Archigos data rich information. Consult raw data available Hein Goeman's website . best conform data requirements CRAN, leader names renamed included irregular characters (e.g. umlauts accents). leaders, particular applications, hav renamed \"(Juan Orlando) Hernandez\" (HON-2014), \"(Antonio) Saca Gonzalez\" (SAL-2004), \"Julian Trujillo Largacha\" (COL-1878), \"Cesar Gaviria Trujillo\" (COL-1990), \"Gabriel Garcia Moreno\" (ECU-1869), \"Marcos . Morinigo\" (PAR-1894-1), \"Higinio Morinigo\" (PAR-1940), \"Sebastian Pinera\" (CHL-2010), \"Sauli Niinisto\" (FIN-2012), \"Louis Gerhard De Geer\" (SWD-1876), \"Stefan Lofven\" (SWD-2014), \"Lars Lokke Rasmussen\" (DEN-2009, DEN-2015), \"Fernando de Araujo\" (ETM-2008-1). None names contain special characters data . clarity's sake, renamed ccode column raw data gwcode. may deceive user peeking data Correlates War state codes, Gleditsch-Ward state codes.","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"directed dyad-year-level data alliance obligations provisions ATOP project","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"","code":"atop_alliance"},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"data frame 272,046 observations following eight variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year atop_defense numeric vector equals 1 alliance observed defense pledge atop_offense numeric vector equals 1 alliance observed offense pledge atop_neutral numeric vector equals 1 alliance observed neutrality pledge atop_nonagg numeric vector equals 1 alliance observed non-aggression pledge atop_consul numeric vector equals 1 alliance observed consultation pledge","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"data-raw directory project's Github shows data processed.","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"Leeds, Brett Ashley, Jeffrey M. Ritter, Sara McLaughlin Mitchell, Andrew G. Long. 2002. Alliance Treaty Obligations Provisions, 1815-1944. International Interactions 28: 237-60.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Democracy data for all Correlates of War states — ccode_democracy","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"democracy data Correlates War state system members.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"","code":"ccode_democracy"},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"data frame 16536 observations following 5 variables. ccode Correlates War system code year numeric vector year v2x_polyarchy Varieties Democracy \"polyarchy\" estimate polity2 polity2 score Polity project xm_qudsest extension Unified Democracy Scores (UDS) estimates, made possibly QuickUDS package Xavier Marquez.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"Missing data connote data unavailable various reasons. Either democracy data code , case Polity project, state system member outright evaluated variable. Polity data 2017. Varieties Democracy data version 10. Xavier Marquez' QuickUDS estimates (.e. extensions Pemstein et al. (2010)) come package Marquez makes available Github (https://github.com/xmarquez/QuickUDS).","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War directed dyad-year alliance data — cow_alliance","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"version 4.1 Correlates War directed dyad-year alliance data.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"","code":"cow_alliance"},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"data frame 120784 observations following 7 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year cow_defense numeric vector equals 1 alliance included defense pledge cow_neutral numeric vector equals 1 alliance included neutrality pledge cow_nonagg numeric vector equals 1 alliance included non-aggression pledge cow_entente numeric vector equals 1 alliance included pledge consult crisis occurred","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"directed dyad-year alliance data alliance initiations, straight dyad-years, \"per se.\" suggests presence duplicate directed dyad-years. computing ease, given intended use, take care duplicate dyad-years behind scenes. Consider case U.S. Canada 1958. Therein, apparently two separate alliance initiations included defense pledges. behind--scenes cleaning process groups ccode1, ccode2, year summarizes alliance pledge variables. replace value greater 1 1. indicates presence absence defense pledge given directed dyad-year.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Congressional Quarterly Press.","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":null,"dir":"Reference","previous_headings":"","what":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"complete list capitals capital transitions Correlates War state system members. use internally calculating capital--capital distances add_capital_distances() function.","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"","code":"cow_capitals"},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"data frame 252 observations following 7 variables. ccode numeric vector Correlates War state code statenme character vector state capital character vector name capital styear character vector start year. See details section information. endyear character vector end year. See details section information. lat numeric vector latitude coordinates capital lng numeric vector longitude coordinates capital","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"convenience, start year states 1816. Samoa, example, state 1816. However, functions use cow_capitals data create observations states exist given point time. data current end 2020. Cases start year 1816 indicate capital transition. example, Brazil's capital moved Rio de Janeiro Brasilia (planned capital) 1960. 25 states data experienced capital transition. recent Burundi 2018. Indonesia, writing, planning capital transition, completed yet. Kazakhstan renamed capital state leader 2019. data retain name Astana. changed event software use records change. capitals data without peculiarities. Prominently, Portugal transferred Portuguese court Lisbon Rio de Janeiro 1808 1821. recorded data. knowledge inter-state conflict data note war dispute , say, Portugal Spain (Portugal country) point time, create weirdness suggest massive distance two countries, like Portugal Spain, otherwise land-contiguous. Spain: republican government moved capital start civil war (1936) Valencia. However, abandoned capital 1937. elect record capital transition. data also (think) reasonable back-dating capitals coincide states transition without necessarily formal capitals first appearance state system membership data. concern Lithuania, Kazakhstan, Philippines. Kaunas initial post-independence capital Lithuania. Almaty initial post-independence capital Kazakhstan. Quezon City initial post-independence capital Philippines. concerns, , one two years three countries.","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"contain abbreviated version \"master records\" Correlates War direct contiguity data. Data contain cosmetic changes assist functions downstream .","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"","code":"cow_contdir"},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"data frame 2025840 observations following 4 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state conttype numeric vector contiguity relationship begin year-month contiguity relationship begins (YYYYMM) end year-month contiguity relationship ends (YYYYMM)","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"\"master record\" provided Correlates War \"non-directed.\" make data \"directed\" convenience. clarity, contiguity codes range 1 5. 1 = direct land contiguity. 2 = separated 12 miles water fewer (la Stannis Baratheon). 3 = separated 24 miles water fewer (12 miles). 4 = separated 150 miles water fewer (24 miles). 5 = separated 400 miles water fewer (150 miles). Cases separation 400 miles water included master record (easily discerned based complete dyad-year data).","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"Stinnett, Douglas M., Jaroslav Tir, Philip Schafer, Paul F. Diehl, Charles Gochman (2002). \"Correlates War Project Direct Contiguity Data, Version 3.\" Conflict Management Peace Science 19 (2):58-66.","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":null,"dir":"Reference","previous_headings":"","what":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"complete directed dyad-year data frame Correlates War state system members. offer shortcut various functions working new additions want invest time waiting create_dyadyears() run. general rule, data frame updated every calendar year include recently concluded calendar year.","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"","code":"cow_ddy"},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"data frame following 3 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"Data quick generation create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"complete (believe) data set Correlates War states Gleditsch-Ward states, byproduct full_join() gw_states cow_states leans largely state abbreviation variable.","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"","code":"cow_gw_years"},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"data frame 16936 observations following 6 variables. gwcode Gleditsch-Ward state code stateabb state abbreviation, greatest source agreement data sets gw_statename state name appears Gleditsch-Ward data ccode Correlates War state code cow_statename state name appears Correlates War data year numeric vector year","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"data-raw directory project's Github contains information data created. going use internal stuff. workflow going treat Correlates War state system membership codes \"master\" codes, user can add Gleditsch-Ward identifiers see fit. Data extended 2020, assuming changes state system membership either data set.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"non-directed dyad-year version Correlates War IGOs data. use internally merging IGOs data dyad-year data.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"","code":"cow_igo_ndy"},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"data frame 917695 observations following 4 variables. ccode1 Correlates War state system code first state ccode2 Correlates War state system code second state year year dyadigos sum mutual IGOs state appears full member given year","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"data-raw directory project's Github contains additional information data generated otherwise enormous dyad-year IGOs data provided Correlates War project. Given size data, size limitations R packages CRAN, data provide can simpler summaries. want specifics, need consult underlying raw data provided Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"Pevehouse, Jon C.W., Timothy Nordstrom, Roseanne W McManus, Anne Spencer Jamison, 2020. “Tracking Organizations World: Correlates War IGO Version 3.0 datasets”, Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"state-year version Correlates War IGOs data. use internally merging IGOs data state-year data.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"","code":"cow_igo_sy"},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"data frame 1557 observations following 5 variables. ccode Correlates War state system code state year year sum_igo_full sum IGOs state full member given year sum_igo_associate sum IGOs state just associate member given year sum_igo_observer sum IGOs state just observer given year sum_igo_anytype sum IGOs state member kind given year.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"data-raw directory project's Github contains additional information data generated otherwise enormous dyad-year IGOs data provided Correlates War project. Given size data, size limitations R packages CRAN, data provide can simpler summaries. want specifics, need consult underlying raw data provided Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"Pevehouse, Jon C.W., Timothy Nordstrom, Roseanne W McManus, Anne Spencer Jamison. 2020. “Tracking Organizations World: Correlates War IGO Version 3.0 datasets”, Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Major Powers Data (1816-2016) — cow_majors","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Correlates War major powers data.","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"","code":"cow_majors"},{"path":"http://svmiller.com/reference/cow_majors.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"data frame 14 observations following 8 variables. ccode numeric vector Correlates War country code styear start year major power stmonth start month major power stday start day major power endyear end year major power endmonth end month major power endday end day major power version version identifier","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Data provided \"-\" additional re-cleaning inclusion data set (beyond eliminating state abbreviation).","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"directed dyadic dispute year data derived Correlates War (CoW) Militarized Interstate Dispute (MID) project. Data version 5.0. whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"","code":"cow_mid_ddydisps"},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"data frame 10234 observations following 25 variables. dispnum numeric vector CoW-MID dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year cowmidongoing numeric vector whether dispute ongoing year cowmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? fatality numeric vector fatality level dispute hostlev numeric vector hostility level MID mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID recip numeric vector whether MID reciprocated stmon numeric vector start month MID","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"directed dyadic dispute year data derived Correlates War (CoW) Militarized Interstate Dispute (MID) project. Data version 5.0.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"","code":"cow_mid_dirdisps"},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"data frame 11390 observations following 18 variables. dispnum numeric vector CoW-MID dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year dispongoing numeric vector whether dispute ongoing year disponset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute?","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":null,"dir":"Reference","previous_headings":"","what":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"abbreviated version dispute-level CoW-MID data.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"","code":"cow_mid_disps"},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"data frame 2436 observations following 7 variables. dispnum numeric vector CoW-MID dispute number outcome numeric vector outcome MID styear numeric vector start year MID stmon numeric vector start month MID settle numeric vector dispute settled fatality numeric vector fatality level dispute mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID hiact numeric vector highest action MID hostlev numeric vector hostility level MID recip numeric vector whether MID reciprocated","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"data purposely light information; intended used dispute-level analyses, per se. intended augment directed dyadic dispute-year data adding variables serve exclusion rules whittle data dyadic dispute-year just dyad-year data.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":null,"dir":"Reference","previous_headings":"","what":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"non-directed dyad-year data minimum distance states Correlates War state system 1886 2019. data generated cshapes package.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"","code":"cow_mindist"},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"data frame 817053 observations following 4 variables. ccode1 Correlates War state system code first state ccode2 Correlates War state system code second state year year mindist minimum distance states Jan. 1 year, kilometers","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"data generated cshapes package. Data automatically generated (default) directed dyad-years. elect make non-directed space considerations. Making non-directed dyad-year data directed dyad-year data difficult R. just looks weird see code . Previous versions data minimum distance Dec. 31 referent year. now Jan. 1. data provide elsewhere package understood data start year. process, example, capitals data get merged add_capital_distance() function. However, script generates data set Jan. 1 year Dec. 31. Right now, cshapes appear work system know . Fortunately, package authors made data available.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War National Military Capabilities Data — cow_nmc","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"version 6.0 Correlates War National Military Capabilities data. Data omit state abbreviation version identifier consideration.","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"","code":"cow_nmc"},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"data frame 15171 observations following 9 variables. ccode numeric vector Correlates War country code year year milex estimate military expenditures (thousands). See details section . milper estimate size military personnel (thousands) state irst estimate iron steel production (thousands tons) pec estimate primary energy consumption (thousands coal-ton equivalents) tpop estimate total population size state (thousands) upop estimate urban population size state (thousands). See details section . cinc Composite Index National Capability (\"CINC\") score. See details section .","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"user want little careful data used, beyond typical caveat difficult pin-point many thousands coal-tons state like Baden producing 19th century. First, military expenditures denominated British pounds sterling observations 1816 1913. observations 1914 beyond denominated current United States dollars. according manual. Second, urban population size estimate based , well, estimate size population living area 100,000 people. Third, Composite Index National Capability score calculated state's world share six composite indicators also included data given year. theoretically bound 0 1. state 1 100% responsible 1) military expenditures world, 2) state military, 3) iron steel production, 4) world's primary energy consumption, 5) state world population urban population. Incidentally, maximum scores observed data belong United States 1945.","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"Singer, J. David, Stuart Bremer, John Stuckey. (1972). \"Capability Distribution, Uncertainty, Major Power War, 1820-1965.\" Bruce Russett (ed) Peace, War, Numbers, Beverly Hills: Sage, 19-48. Singer, J. David. 1987. \"Reconstructing Correlates War Dataset Material Capabilities States, 1816-1985\" International Interactions, 14: 115-32.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"state-year level data surplus gross domestic product Correlates War state system members. Data also include population estimates per capita standardization.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"","code":"cow_sdp_gdp"},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"data frame 27753 observations following five variables. ccode numeric vector Correlates War state code year numeric vector year wbgdp2011est numeric vector estimated natural log GDP 2011 USD (log-transformed) wbpopest numeric vector estimated population size (log-transformed) sdpest numeric vector estimated surplus domestic product (log-transformed) wbgdppc2011est numeric vector estimated GDP per capita (log-transformed)","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"extracted actual replication files International Studies Quarterly. data ultimately simulated, user can expect slight differences Correlates War version data (Anders et al. published) Gleditsch-Ward version data (appear one authors vigorously support going forward). Space considerations compel round data three decimal points. \"economic\" data routinely biggest package, decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. original simulations available remote download like. Type ?download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War State System Membership Data (1816-2016) — cow_states","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Correlates War state system membership data.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"","code":"cow_states"},{"path":"http://svmiller.com/reference/cow_states.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"data frame 243 observations following 10 variables. stateabb character vector state abbreviation ccode numeric vector Correlates War country code statenme character vector state name styear start year system stmonth start month system stday start day system endyear end year system endmonth end month system endday end day system version version identifier","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Data provided \"-\" additional re-cleaning inclusion data set.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"state-year-level data national trade Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"","code":"cow_trade_sy"},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"data frame 14410 observations following four variables. ccode Correlates War state system code year year imports total imports state current million USD exports total exports state current million USD","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"data-raw directory project's Github shows data processed.","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"Barbieri, Katherine Omar M.G. Keshk. 2016. Correlates War Project Trade Data Set Codebook, Version 4.0. Online: https://correlatesofwar.org Barbieri, Katherine, Omar M.G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science, 26(5): 471-491.","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"modified version inter-state war data Correlates War project. Data version 4.0. temporal domain 1816-2007. Data functionally directed dyadic war-year.","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"","code":"cow_war_inter"},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"data frame 1932 observations following 15 variables. warnum Correlates War war number ccode1 Correlates War state code side1 ccode2 Correlates War state code side2 year numeric vector year cowinteronset dummy variable whether inter-state war onset (.e. either year StartYear1 StartYear2 raw data) cowinterongoing numeric constant 1 sidea1 numeric vector side war ccode1, either 1 2 sidea2 numeric vector side war ccode2, either 1 2 initiator1 dummy variable equals 1 ccode1 initiated war initiator2 dummy variable equals 1 ccode2 initiated war outcome1 outcome ccode1 numeric vector. Outcomes 1 (winner), 2 (loser), 3 (compromise/tied), 4 (transformed another type war), 5 (ongoing end 2007, observed data), 6 (stalemate), 7 (conflict continues severity war), 8 (changed sides) outcome2 outcome ccode2 numeric vector. Outcomes 1 (winner), 2 (loser), 3 (compromise/tied), 4 (transformed another type war), 5 (ongoing end 2007, observed data), 6 (stalemate), 7 (conflict continues severity war), 8 (changed sides) batdeath1 estimated deaths ccode1 (-9 = unknown) batdeath2 estimated deaths ccode2 (-9 = unknown) resume dummy variable equals 1 conflict resumption episode","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"See data-raw directory data generated. data want , caution using gospel. problems . One: -9s proliferate data battle deaths either side, unhelpful. 10 cases sum battle deaths exactly 1,000 1,001. suspicious. \"side\" variables well-explained---fact explained codebook--- can lead user astray want interpret analogous sidea variables Correlates War Militarized Interstate Dispute data. probably want use initiator variables . , war data routinely betray MID data two speak well . language Sarkees Wayman (2010) use book talk MIDs \"precede\" war \"associated\" war, forgets war data supposed subset MID data. one case (Gulf War), get associated dispute number wrong , one prominent case (War Bosnian Independence), argue MID exists (actually MID#3557).","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"modified version intra-state war data Correlates War project. Data version 4.1. temporal domain 1816-2007.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"","code":"cow_war_intra"},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"data frame 1361 observations following 17 variables. warnum Correlates War war number warname Correlates War war name wartype character vector type war, either \"local issues\" \"central control\" year numeric vector year cowintraonset dummy variable whether civil war onset (.e. either year StartYear1 StartYear2 raw data) cowintraongoing numeric constant 1 resume_combat dummy variable whether resumption conflict (.e. StartYear2 -8) primary_state dummy variable whether state primary state civil war ccodea Correlates War state code participant Side . -8 = applicable (participant state) sidea name participant Side . -8 = applicable (additional party side) ccodeb Correlates War state code participant Side B. -8 = applicable (participant state) sideb name participant Side B. -8 = applicable (additional party side) intnl dummy variable internationalized civil war outcome unordered-categorical variable outcome civil war. Values include 1 (Side wins), 2 (Side B wins), 3 (Compromise), 4 (war transformed another type war), 5 (war ongoing end 2007), 6 (stalemate), 7 (conflict continues severity war) sideadeaths estimated deaths Side participant (-9 = unknown, -8 = applicable) sidebdeaths estimated deaths Side B participant (-9 = unknown, -8 = applicable) ongo2007 dummy variable war ongoing end 2007","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"See data-raw directory data generated. Guinnea-Bissau Civil War (1998, 1999), \"Mane Junta\" accented-e scrubbed coincide CRAN's character requirements.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"Dixon, Jeffrey, Meredith Sarkees. 2016. Guide Intra-State Wars: Examination Civil Wars, 1816-2014. Thousand Oaks, CA: Sage. Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create dyad-years from state system membership data — create_dyadyears","title":"Create dyad-years from state system membership data — create_dyadyears","text":"create_dyadyears() allows dyad-year data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create dyad-years from state system membership data — create_dyadyears","text":"","code":"create_dyadyears(system = \"cow\", mry = TRUE, directed = TRUE, subset_years)"},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create dyad-years from state system membership data — create_dyadyears","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care. directed optional, defaults TRUE. TRUE, function returns -called \"directed\" dyad-year data. directed dyad-year data, France-Germany (220-255) Germany-France (255-220) observationally different. FALSE, function returns non-directed data. non-directed data, France-Germany Germany-France year observation. standard drop cases country code second observation less country code first observation. subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(1816:1820) subset data just dyad-years 1816, 1817, 1818, 1819, 1820. advised easiest subset data full universe dyad-year data created. means , choose, effectively overwrite mry = TRUE argument since mry argument applied expansion state system data, occurs start function.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create dyad-years from state system membership data — create_dyadyears","text":"create_dyadyears() takes state system membership data provided either Correlates War Gleditsch-Ward returns dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create dyad-years from state system membership data — create_dyadyears","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create dyad-years from state system membership data — create_dyadyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create dyad-years from state system membership data — create_dyadyears","text":"","code":"# \\donttest{ # CoW is default, will include years beyond 2016 (most recent CoW update) create_dyadyears() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 3 #> ccode1 ccode2 year #> #> 1 2 20 1920 #> 2 2 20 1921 #> 3 2 20 1922 #> 4 2 20 1923 #> 5 2 20 1924 #> 6 2 20 1925 #> 7 2 20 1926 #> 8 2 20 1927 #> 9 2 20 1928 #> 10 2 20 1929 #> # … with 2,139,260 more rows # Gleditsch-Ward, include most recent years create_dyadyears(system=\"gw\") #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 2,089,816 more rows # Gleditsch-Ward, don't include most recent years create_dyadyears(system=\"gw\", mry=FALSE) #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 1,939,316 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 1,939,306 more rows # Gleditsch-Ward, don't include most recent years, directed = FALSE create_dyadyears(system=\"gw\", mry=FALSE, directed = FALSE) #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 969,658 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 969,648 more rows # }"},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-days from leader data — create_leaderdays","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays() allows generate leader-day data leader-level data provided peacesciencer.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-days from leader data — create_leaderdays","text":"","code":"create_leaderdays(system = \"archigos\", standardize = \"none\")"},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-days from leader data — create_leaderdays","text":"system leader system create leader-days. Right now, \"archigos\" supported. standardize character vector length one: \"cow\", \"gw\", \"none\". \"cow\", function standardizes leader-days just overlap state system membership Correlates War state system (see: cow_states). \"gw\", function standardizes leader-days just overlap state system dates Gleditsch-Ward date (see: gw_states). \"none\", function returns leader-days presented Archigos (nominally denominated Gleditsch-Ward state system codes, necessarily Gleditsch-Ward state system dates). Default \"none\".","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays() takes leader-level data available peacesciencer returns leader-day-level data frame.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays(), writing, supports Archigos data set leaders. envision function mostly internal uses. Basically, create_leaderyears() effectively starts first running version create_leaderdays(). , function ?","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-days from leader data — create_leaderdays","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-days from leader data — create_leaderdays","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-days from leader data — create_leaderdays","text":"","code":"# \\donttest{ create_leaderdays() #> # A tibble: 5,298,380 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,298,370 more rows create_leaderdays(standardize = \"gw\") #> Joining with `by = join_by(gwcode, date)` #> # A tibble: 5,181,021 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,181,011 more rows # }"},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"create_leaderdyadyears() allows created leader dyad-year data Archigos data first introduced described Goemans et al. (2009).","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"","code":"create_leaderdyadyears(directed = TRUE, system = \"gw\")"},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"directed optional, defaults TRUE. TRUE, function returns -called \"directed\" leader dyad-year data. FALSE, function returns non-directed data state codes second leader greater state codes second leader. system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Gleditsch-Ward default.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"create_leaderdyadyears() takes remote data available separate download returns complete leader dyad-year data frame leaders, possible dyads, 1870 2015.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"complete universal leader dyad-year data frame possible dyadic leader pairings 1870 2015. several implications. First: data enormous. output 2 million rows long! Second: time required create data scratch take long normal function call. amounts unholy combination data large CRAN's disk space restrictions (5 MB) time-consuming scratch every time. Thus, data pre-generated stored remotely. Check download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"","code":"if (FALSE) { # download_extdata() # ^ make sure you've run this first. # default is directed create_leaderdyadyears() # non-directed create_leaderdyadyears(directed = FALSE) }"},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-years from leader data — create_leaderyears","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears() allows generate leader-year data leader-level data provided peacesciencer","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-years from leader data — create_leaderyears","text":"","code":"create_leaderyears(system = \"archigos\", standardize = \"none\", subset_years)"},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-years from leader data — create_leaderyears","text":"system leader system create leader-years. Right now, \"archigos\" supported. standardize character vector length one: \"cow\", \"gw\", \"none\". \"cow\", function standardizes leader-years just overlap state system membership Correlates War state system (see: cow_states). \"gw\", function standardizes leader-years just overlap state system dates Gleditsch-Ward date (see: gw_states). \"none\", function returns leader-years presented Archigos (nominally denominated Gleditsch-Ward state system codes, necessarily Gleditsch-Ward state system dates). Default \"none\". subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(2000:2005) subset data just leader-years 2000, 2001, 2002, 2003, 2004, 2005 advised easiest subset data full universe leader-year data created. also agnostic supplied standardize argument.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears() takes leader-level data available peacesciencer returns leader-year-level data frame. minimal output contains observation ID Archigos, year, state code leader (.e. either Correlates War Gleditsch-Ward, depending standardize argument), leader's name Archigos (may help reader ), approximation leader's age, year office leader (running count, starting 1).","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears(), writing, supports Archigos data set leaders. Many leader ages known precision. Many recorded Archigos data. Knowing well years aggregates days, leader age variable gets returned output treated approximation leader's age. mindful leader tenure calculated standardization argument. Archigos leader entries precede state system entry state, otherwise coincide state system dates. example, Lynden Pindling seventh year leader Bahamas (various titles) independence 1973 (became prime minister). Leader tenure tethered state system dates situations like (dates recorded Archigos data). leader tenure variable returned odd effect potentially misstating leader tenure, least making seem unusual. example, Jimmy Carter (USA-1877) president 1977 (year 1), 1978 (year 2), 1979 (year 3), 1980 (year 4), exited January 1981 (year 5). : years aggregates days evident else information perfectly communicated mind. Users R skills can extract underlying information archigos data , perhaps, calculate something like maximum leader tenure (days) either Dec. 31 referent year, leader exit Dec. 31 year, something effect. matter, think least defensible variable present user limitations mind. user interested leader tenure leader-year analysis, variable fine. user interested something like effect fifth year kind leader behavior, want figure something else.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-years from leader data — create_leaderyears","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-years from leader data — create_leaderyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-years from leader data — create_leaderyears","text":"","code":"# \\donttest{ # standardize = 'none' is default create_leaderyears() #> # A tibble: 17,686 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,676 more rows create_leaderyears(standardize = 'gw') #> Joining with `by = join_by(gwcode, date)` #> # A tibble: 17,361 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,351 more rows # }"},{"path":"http://svmiller.com/reference/create_statedays.html","id":null,"dir":"Reference","previous_headings":"","what":"Create state-days from state system membership data — create_statedays","title":"Create state-days from state system membership data — create_statedays","text":"create_statedays() allows create state-day data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create state-days from state system membership data — create_statedays","text":"","code":"create_statedays(system = \"cow\", mry = TRUE)"},{"path":"http://svmiller.com/reference/create_statedays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create state-days from state system membership data — create_statedays","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create state-days from state system membership data — create_statedays","text":"create_statedays() takes state system membership data provided either Correlates War Gleditsch-Ward returns simple state-day data frame.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create state-days from state system membership data — create_statedays","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create state-days from state system membership data — create_statedays","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create state-days from state system membership data — create_statedays","text":"","code":"# \\donttest{ # CoW is default, will include years beyond 2016 (most recent CoW update) create_statedays() #> # A tibble: 6,203,441 × 3 #> ccode statenme date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,203,431 more rows # Gleditsch-Ward, include most recent years create_statedays(system=\"gw\") #> # A tibble: 6,765,801 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,765,791 more rows # Gleditsch-Ward, don't include most recent years create_statedays(system=\"gw\", mry=FALSE) #> # A tibble: 6,448,077 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,448,067 more rows # }"},{"path":"http://svmiller.com/reference/create_stateyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create state-years from state system membership data — create_stateyears","title":"Create state-years from state system membership data — create_stateyears","text":"create_stateyears() allows generate state-year data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create state-years from state system membership data — create_stateyears","text":"","code":"create_stateyears(system = \"cow\", mry = TRUE, subset_years)"},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create state-years from state system membership data — create_stateyears","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care. subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(1816:1820) subset data just state-years 1816, 1817, 1818, 1819, 1820. advised easiest subset data full universe state-year data created. means , choose, effectively overwrite mry = TRUE argument since mry argument applied expansion state system data state-year data.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create state-years from state system membership data — create_stateyears","text":"create_stateyears() takes state system membership data provided either Correlates War Gleditsch-Ward returns simple state-year data frame.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create state-years from state system membership data — create_stateyears","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create state-years from state system membership data — create_stateyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create state-years from state system membership data — create_stateyears","text":"","code":"# CoW is default, will include years beyond 2016 (most recent CoW update) create_stateyears() #> # A tibble: 17,121 × 3 #> ccode statenme year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,111 more rows # Gleditsch-Ward, include most recent years create_stateyears(system=\"gw\") #> # A tibble: 18,637 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 18,627 more rows # Gleditsch-Ward, don't include most recent years create_stateyears(system=\"gw\", mry=FALSE) #> # A tibble: 17,767 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,757 more rows"},{"path":"http://svmiller.com/reference/creg.html","id":null,"dir":"Reference","previous_headings":"","what":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data set state-year estimates ethnic religious fractionalization/polarization, way Composition Religious Ethnic Groups (CREG) project University Illinois. -L-L.","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"","code":"creg"},{"path":"http://svmiller.com/reference/creg.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data frame 11523 observations following 9 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code creg_ccode numeric code state, mostly patterned Correlates War codes important differences. See details section . year year ethfrac estimate ethnic fractionalization index. See details . ethpol estimate ethnic polarization index. See details . relfrac estimate religious fractionalization index. See details . relpol estimate religious polarization index. See details .","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data-raw directory project's Github contains information data created. Pay careful attention assigned CoW/G-W codes. underlying data version 1.02. state codes provided CREG project mostly Correlates War codes, differences. Summarizing differences: state code Serbia 1992 2013 actually Gleditsch-Ward code (340). Russia dissolution Soviet Union (1991-onward) 393 365. Soviet Union 365 code. Yugoslavia 345 code. code Yemen (678) effectively Gleditsch-Ward code spans entire post-World War II temporal domain. Likewise, code post-unification Germany Gleditsch-Ward code (260) well. codebook actually says 265 (East Germany's code), assuredly typo based data. codebook cautions insufficient data ethnic group estimates Cameroon, France, India, Kosovo, Montenegro, Mozambique, Papua New Guinea. French case particularly disappointing missing data function France's constitution modelling issues CREG (per codebook). insufficient data make religious group estimates China, North Korea, short-lived Republic Vietnam. fractionalization estimates familiar Herfindahl-Hirschman concentration index. polarization formula comes way Montalvo Reynal-Querol (2000), though book appear published beyond placement online. recommend Montalvo Reynal-Querol (2005) instead. can cite Alesina (2003) fractionalization measure like. literal sense \"1\", group proportions may sum exactly 1 rounding data. two problem cases data worth mentioning. First, data sets, occasional duplicates group names state-year (example: Afghanistan 1951 ethnic group data United States 1948 religious group data). cases, script make available data-raw directory just select distinct values effectively fixes problem duplicates, appear. Finally, Costa Rica curious problem years religious group data. Costa Rica years group data Protestants, Roman Catholics, \"others.\" 1964 , \"others\" zero. Afterward, small proportion \"others\". However, sum Protestants, Roman Catholics, \"others\" exceeds 1 (pretty clearly) difference sum 1 entirely \"others.\" , drop \"others\" years. think terribly problematic, worth saying .","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"Alesina, Alberto, Arnaud Devleeschauwer, William Easterly, Sergio Kurlat Romain Wacziarg. 2003. \"Fractionalization\". Journal Economic Growth 8: 155-194. Montalvo, Jose G. Marta Reynal-Querol. 2005. \"Ethnic Polarization, Potential Conflict, Civil Wars\" American Economic Review 95(3): 796--816. Nardulli, Peter F., Cara J. Wong, Ajay Singh, Buddy Petyon, Joseph Bajjalieh. 2012. Composition Religious Ethnic Groups (CREG) Project. Cline Center Democracy.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare peacesciencer-specific attributes to data — declare_attributes","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"declare_attributes() allows user declare peacesciencer-specific attributes data bring outside package. allows user use package functions shortcuts, appropriate.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"","code":"declare_attributes(data, data_type, system, conflict_type)"},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"data data frame want peacesciencer-specific attributes data_type optional, character vector length 1 coinciding type data user believes data frame . Options include: 'dyad_year', 'leader_day', 'leader_year', 'leader_dyad_year', 'state_day', 'state_year'. system optional, character vector length 1 coinciding state system data. specified , must 'cow' 'gw'. conflict_type optional, applicable just conflict data \"whittle\" class functions peacesciencer. specified, must character vector length 1 either 'cow' 'gml'.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"declare_attributes() takes data frame adds peacesciencer-specific attributes data frame. allow user take advantage many functions package without starting process one \"create\" functions. nothing declared function, attribute added function just returns original data without change.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"function's documentation include attributes available declared. doubt, list potential attributes grow time, attributes can declared limited just built package point. Users declare one attribute given type (.e. user declare system Correlates War Gleditsch-Ward). idea , basically, allow user use functions peacesciencer data created acquired elsewhere. However, functions provides assurances quality control various merges built elsewhere package. package aggressively tests functions data generated -house. outside data merges, various \"add\" functions may perfectly perform. real way can control since data coming outside package one \"create\" functions. particular case, may much problem. However, user's responsibility quality control situation.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) data.frame(ccode = 2, year = c(1816:1830)) -> usa_years usa_years %>% declare_attributes(data_type = 'state_year', system = 'cow') #> ccode year #> 1 2 1816 #> 2 2 1817 #> 3 2 1818 #> 4 2 1819 #> 5 2 1820 #> 6 2 1821 #> 7 2 1822 #> 8 2 1823 #> 9 2 1824 #> 10 2 1825 #> 11 2 1826 #> 12 2 1827 #> 13 2 1828 #> 14 2 1829 #> 15 2 1830"},{"path":"http://svmiller.com/reference/download_extdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Download Some Extra Data for Peace Science Research — download_extdata","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"download_extdata() leverages R's inst directory flexibility allow download extra data store package.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"","code":"download_extdata(overwrite = FALSE)"},{"path":"http://svmiller.com/reference/download_extdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"overwrite logical, defaults FALSE. FALSE, function checks see already downloaded data , already , nothing. TRUE, function redownloads data.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"download_extdata() downloads extra data stored website (http://svmiller.com) sticks extdata directory package.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"a-description-of-various-data-sets-this-will-download","dir":"Reference","previous_headings":"","what":"A Description of Various Data Sets This Will Download","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Running download_extdata() returns following data stored package's extdata directory.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"correlates-of-war-dyadic-trade-data-set-v-","dir":"Reference","previous_headings":"","what":"Correlates of War Dyadic Trade Data Set (v. 4.0)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed dyad-year-level data dyadic trade Correlates War project. trade values presented rounded three decimal points conserve space. data downloaded function 4.1 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"directed-leader-dyad-year-data-cow-states-","dir":"Reference","previous_headings":"","what":"Directed Leader Dyad-Year Data, 1870-2015 (CoW States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed leader dyad-year data 1870-2015. Data come Archigos data (version 4.1). data standardized just observations leaders states appear CoW state system data. data downloaded function 2 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"directed-leader-dyad-year-data-gleditsch-ward-states-","dir":"Reference","previous_headings":"","what":"Directed Leader Dyad-Year Data, 1870-2015 (Gleditsch-Ward States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed leader dyad-year data 1870-2015. Data come Archigos data (version 4.1). data represent every possible dyadic leader-pairing Archigos data (denominated Gleditsch-Ward system), standardizes leader dyad-years Gleditsch-Ward state system dates. data downloaded function 2.2 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"chance-corrected-measures-of-foreign-policy-similarity-fpsim-v-","dir":"Reference","previous_headings":"","what":"Chance-Corrected Measures of Foreign Policy Similarity (FPSIM, v. 2)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"FPSIM data set provides measures foreign policy similarity dyads based alliance ties (Correlates War, version 4.1) UN General Assembly voting (Voeten, version 17) members Correlates War state system. alliance data cover time period 1816 2012, UN voting data 1946 2015. similarity measures include various versions Ritter Signorino's S (weighted/non-weighted material capabilities; squared/absolute distance metrics) well chance-corrected measures Cohen's (1960) kappa Scott's (1955) pi. measures based alliance data come two versions: one based valued alliance ties based binary alliance ties. Data last updated December 7, 2017, description effectively plagiarized (blessing) Frank Haege's Dataverse. data directed dyad-years 17 columns 1,872,198 observations. almost certainly largest data set nudge/ask download remotely. file containing information 18.6 MB size. reduce size , decimal points also rounded three spots. Haege generated estimates dyadic foreign policy similarity, except taub column. generated separately, .","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"-non-directed-dyadic-minimum-distance-data-plus-cow-states-","dir":"Reference","previous_headings":"","what":"(Non-Directed) Dyadic Minimum Distance Data Plus (CoW States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"non-directed dyadic minimum distance data Schvitz et al. (2022) Correlates War states start 1886 end 2019. Note call \"data plus\", idea informally branding kind augmentation might otherwise cshapes package. data set 4.4 million rows dyadic minimum distance available years. Within year, recorded minimum distance Jan. 1, June 30, Dec. 31 , addition, day within year composition international system (shape state) changed, recorded cshapes. Sometimes changes concern dyadic minimum distance; sometimes . example, League Nations responsible lot shape changes (.e. system entry) CoW state system data year 1920. obviously change dyadic minimum distance U.S. Canada, always zero. Sometimes start year (Jan. 1), midpoint year (June 30), end year (Dec. 31) coincides system change. Often . Note referent day (Jan. 1, June 30, Dec. 31) may appear given year given dyad date exists outside CoW state system membership. example, Canada appear state system member Jan. 10, 1920. goal data set allow quickly generate dyadic minimum distances within peacesciencer's functionality proficient tidyverse verbs. also use highlight often dyadic minimum distance may vary within year given dyad. Despite dimensions data set, big download. data 1.7 MB size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"-non-directed-dyadic-minimum-distance-data-plus-g-w-states-","dir":"Reference","previous_headings":"","what":"(Non-Directed) Dyadic Minimum Distance Data Plus (G-W States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"non-directed dyadic minimum distance data Schvitz et al. (2022) Gleditsch-Ward states start 1886 end 2019. Note call \"data plus\", idea informally branding kind augmentation might otherwise cshapes package. data set 3.7 million rows dyadic minimum distance available years. Within year, recorded minimum distance Jan. 1, June 30, Dec. 31 , addition, day within year composition international system (shape state) changed, recorded cshapes. Sometimes changes concern dyadic minimum distance; sometimes . example, dissolution Soviet Union responsible lot shape changes (.e. system entry) 1991. obviously change dyadic minimum distance U.S. Canada, always zero. Sometimes start year (Jan. 1), midpoint year (June 30), end year (Dec. 31) coincides system change. Often . Note referent day (Jan. 1, June 30, Dec. 31) may appear given year given dyad date exists outside G-W state system membership. example, Haiti disappears state system July 4, 1915 reappears Aug. 15, 1934. means dyadic minimum distance observations U.S., example, Dec. 31, 1915 June 30, 1934. goal data set allow quickly generate dyadic minimum distances within peacesciencer's functionality proficient tidyverse verbs. also use highlight often dyadic minimum distance may vary within year given dyad. Despite dimensions data set, big download. data 1.4 MB size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Barbieri, Katherine, Omar M. G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science. 26(5): 471-491. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83. Haege, Frank. 2011. \"Choice Circumstance? Adjusting Measures Foreign Policy Similarity Chance Agreement.\" Political Analysis 19(3): 287-305. Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"","code":"if (FALSE) { # Here's where the data are going to be downloaded. system.file(\"extdata\", package=\"peacesciencer\") # Now, let's download the data. download_extdata() }"},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":null,"dir":"Reference","previous_headings":"","what":"False Correlates of War Directed Dyad-Years — false_cow_dyads","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"simple data set communicates directed dyads Correlates War data appear year, particular day year. used anti-join create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"","code":"false_cow_dyads"},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"data frame following four variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year in_ps constant equals 1 data appear create_dyadyears() careful remove .","code":""},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"Think directed Suriname Republic Vietnam dyad illustrative . Republic Vietnam exits Correlates War state system April 30, 1975 whereas Suriname enters state system November 25, 1975. appear year, time.","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":null,"dir":"Reference","previous_headings":"","what":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"simple data set communicates directed dyads Gleditsch-Ward data appear year, particular day year. used anti-join create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"","code":"false_gw_dyads"},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"data frame following four variables. gwcode1 numeric vector Gleditsch-Ward state code first state gwcode2 numeric vector Gleditsch-Ward state code second state year numeric vector year in_ps constant equals 1 data appear create_dyadyears() careful remove .","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"Think directed Suriname Republic Vietnam dyad illustrative . Republic Vietnam exits Correlates War state system April 30, 1975 whereas Suriname enters state system November 25, 1975. appear year, time.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter dyad-year data to include just politically relevant dyads — filter_prd","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"filter_prd() filters dyad-year data frame just \"politically relevant.\" useful discarding unnecessary (unwanted) observations just consume space memory.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"","code":"filter_prd(data)"},{"path":"http://svmiller.com/reference/filter_prd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"data dyad-year data frame (either \"directed\" \"non-directed\")","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"filter_prd() takes dyad-year data frame, assuming columns major power status contiguity type, calculates whether dyad \"politically relevant\", subsets data frame just observations.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"\"Political relevance\" can calculated ways. Right now, function considers \"direct\" contiguity Correlates War major power status. can employ maximalist definitions \"direct contiguity\" focus just land-contiguous. function inclusive type contiguity relationship. version 0.5, filter_prd() shortcut add_contiguity() /add_cow_majors() function executed absence data needed create politically relevant dyads. See example means.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"Weede, Erich. 1976. \"Overwhelming preponderance pacifying condition among contiguous Asian dyads.\" Journal Conflict Resolution 20: 395-411. Lemke, Douglas William Reed. 2001. \"Relevance Politically Relevant Dyads.\" Journal Conflict Resolution 45(1): 126-144.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) A <- cow_ddy %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() #> Joining with `by = join_by(ccode1, ccode2, year)` A #> # A tibble: 246,302 × 7 #> ccode1 ccode2 year conttype cowmaj1 cowmaj2 prd #> #> 1 2 20 1920 1 1 0 1 #> 2 2 20 1921 1 1 0 1 #> 3 2 20 1922 1 1 0 1 #> 4 2 20 1923 1 1 0 1 #> 5 2 20 1924 1 1 0 1 #> 6 2 20 1925 1 1 0 1 #> 7 2 20 1926 1 1 0 1 #> 8 2 20 1927 1 1 0 1 #> 9 2 20 1928 1 1 0 1 #> 10 2 20 1929 1 1 0 1 #> # … with 246,292 more rows # you can also use it as a shortcut for the other functions required # to calculate politically relevant dyads. B <- cow_ddy %>% filter_prd() #> Joining with `by = join_by(ccode1, ccode2, year)` B #> # A tibble: 246,302 × 7 #> ccode1 ccode2 year conttype cowmaj1 cowmaj2 prd #> #> 1 2 20 1920 1 1 0 1 #> 2 2 20 1921 1 1 0 1 #> 3 2 20 1922 1 1 0 1 #> 4 2 20 1923 1 1 0 1 #> 5 2 20 1924 1 1 0 1 #> 6 2 20 1925 1 1 0 1 #> 7 2 20 1926 1 1 0 1 #> 8 2 20 1927 1 1 0 1 #> 9 2 20 1928 1 1 0 1 #> 10 2 20 1929 1 1 0 1 #> # … with 246,292 more rows identical(A,B) #> [1] TRUE # }"},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"directed dispute-year data recent version (2.2.1) Gibler-Miller-Little (GML) militarized interstate dispute (MID) data. used internally merging full dyad-year data frames.","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"","code":"gml_dirdisp"},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"data frame 10330 observations following 39 variables. dispnum dispute number ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year midongoing constant 1 ongoing disputes midonset numeric vector equals 1 onset year given dispute sidea1 first state (ccode1) side took first militarized action? sidea2 second state (ccode2) side took first militarized action? revstate1 first state (ccode1) revisionist state dispute? revstate2 second state (ccode2) revisionist state dispute? revtype11 revtype1 value ccode1? revtype12 revtype1 value ccode2? revtype21 revtype2 value ccode1? revtype22 revtype2 value ccode2? fatality1 fatality value ccode1? fatality2 fatality value ccode2? fatalpre1 fatalpre value ccode1? fatalpre2 fatalpre value ccode2? hiact1 hiact value ccode1? hiact2 hiact value ccode2? hostlev1 hostlev value ccode1? hostlev2 hostlev value ccode2? orig1 ccode1 originator (1) dispute joiner (0)? orig2 ccode2 originator (1) dispute joiner (0)? hiact highest level action observed dispute hostlev hostility level action observed dispute mindur minimum length dispute (days) maxdur maximum length dispute (days) outcome dispute-level outcome settle settlement value dispute fatality ordinal fatality level dispute fatalpre fatalities (precision, known) dispute stmon start month dispute (dispute-level) endmon end month dispute (dispute-level) recip dispute reciprocated (.e. Side B also militarized action)? numa number participants Side numb number participants Side B ongo2010 dispute ongoing 2010? version version identifier","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"Data directed dispute-year data made available version 2.1.1 GML MID data. caution using revtype variables. informative. however included legacy reasons.","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"directed leader-dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1 (GML-MID) version 4.1 (Archigos). whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"","code":"gml_mid_ddlydisps"},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"data frame 10708 observations following 12 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad obsid1 character vector leader focal state dyad, avialable obsid2 character vector leader target state dyad, avialable year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? obsid_start1 ID leader dispute onset ccode1 obsid_start2 ID leader dispute onset ccode2 obsid_end1 ID leader dispute conclusion ccode1 obsid_end2 ID leader dispute conclusion ccode2","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind. Data created first selecting unique onsets. , duplicates remained: retaining highest fatality, highest hostility level, highest estimated minimum duration, reciprocated observations unreciprocated observations, , finally, lowest start month. mindful Archigos' leader data nominally denominated Gleditsch-Ward states, standardized Correlates War state system membership well data can allow. missing leaders 1870 Archigos ultimately system.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"directed dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1. whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"","code":"gml_mid_ddydisps"},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"data frame 9262 observations following 25 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? fatality numeric vector fatality level dispute hostlev numeric vector hostility level MID mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID recip numeric vector whether MID reciprocated stmon numeric vector start month MID","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"directed leader-dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1 (GML-MID) version 4.1 (Archigos). data relevant dyadic leader pairings conflict, allowing users employ case exclusion rules data see fit.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"","code":"gml_mid_dirleaderdisps"},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"data frame 11686 observations following 16 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad obsid1 character vector leader focal state dyad, avialable obsid2 character vector leader target state dyad, avialable year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? obsid_start1 ID leader dispute onset ccode1 obsid_start2 ID leader dispute onset ccode2 obsid_end1 ID leader dispute conclusion ccode1 obsid_end2 ID leader dispute conclusion ccode2","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind. mindful Archigos' leader data nominally denominated Gleditsch-Ward states, standardized Correlates War state system membership well data can allow. missing leaders 1870 Archigos ultimately system.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":null,"dir":"Reference","previous_headings":"","what":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"abbreviated version dispute-level Gibler-Miller-Little (GML) MID data.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"","code":"gml_mid_disps"},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"data frame 2436 observations following 7 variables. dispnum numeric vector CoW-MID dispute number styear numeric vector start year MID stmon numeric vector start month MID outcome numeric vector outcome MID settle numeric vector dispute settled fatality numeric vector fatality level dispute mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID hiact numeric vector highest action MID hostlev numeric vector hostility level MID recip numeric vector whether MID reciprocated","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"data purposely light information; intended used dispute-level analyses, per se. intended augment directed dyadic dispute-year data adding variables serve exclusion rules whittle data dyadic dispute-year just dyad-year data.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":null,"dir":"Reference","previous_headings":"","what":"Participant Summaries of the GML-MID Data — gml_part","title":"Participant Summaries of the GML-MID Data — gml_part","text":"participant summaries recent GML-MID data. data also include leaders onset conclusion participant episode GML MID data.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Participant Summaries of the GML-MID Data — gml_part","text":"","code":"gml_part"},{"path":"http://svmiller.com/reference/gml_part.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Participant Summaries of the GML-MID Data — gml_part","text":"data frame 5217 observations following 21 variables. dispnum dispute ID GML MID data ccode Correlates War code participant styear start year participant stmon start month participant stday start day participant endyear end year participant endmon end month participant endday end day participant obsid_start observational ID archigos leader participant onset obsid_end observational ID archigos leader participant conclusion dummy_stday \"dummy\" start day participant. See details . dummy_endday \"dummy\" end day participant. See details . sidea participant Side dispute hiact highest action participant dispute(-episode) orig participant originator? anymiss_leader_start dummy variable disputes equals 1 dispute participant missing leader ID start date. anymiss_leader_end dummy variable disputes equals 1 dispute participant missing leader ID end date. allmiss_leader_start dummy variable disputes equals 1 dispute participants missing leader ID start date. allmiss_leader_end dummy variable disputes equals 1 dispute participants missing leader ID end date.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Participant Summaries of the GML-MID Data — gml_part","text":"Information leaders come Archigos (v. 4.1). GML MID Data version 2.2.1. data-raw directory contains information data generated. invariably going guesswork dates sometimes known precision. Sometimes, dispute coincides even leadership change dates known precision. source script includes discussion cases shows data generated caveats mind. note participants can several episodes within dispute. Sometimes participants switch sides (e.g. Romania World War 2). Sometime participants drop long-running dispute (e.g. Syria, prominently, MID#4182). \"Dummy\" start days end days serve parlor trick assigning disputes leaders leader-level analyses. days known precision, dummy day number. cases, day known precision coincides month leader transition. Thus, start day gets imputed going first month (dummy start day) last month (dummy end day). Cases leader transition (two) month may require sensitive imputing. example, best guess Antonio Guzmán Blanco Venezuela president end MID#1639, given role trying negotiate conclusion dispute. Archigos leaving office 7th, end day gets imputed . , serve parlor trick assigning disputes leaders leader-level analyses. careful using data calculating dispute-participant duration. fact: .","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Participant Summaries of the GML-MID Data — gml_part","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":null,"dir":"Reference","previous_headings":"","what":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"simple data set 71 arms races reported Gibler et al. 2005 article Journal Peace Research.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"","code":"grh_arms_races"},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"data frame following five variables. race_id arms race identifier ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state styear start year arms race endyear end year arms race","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"Data taken appendix Gibler, Rider, Hutchison's 2005 article Journal Peace Research. Read article appendix information coding procedures.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"Gibler, Douglas M., Toby J. Rider, Marc L. Hutchison. 2005. \"Taking Arms Sea Troubles: Conventional Arms Races Periods Rivalry\" Journal Peace Research 42(2): 131--47.","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":null,"dir":"Reference","previous_headings":"","what":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"complete list capitals capital transitions Gleditsch-Ward state system members. use internally calculating capital--capital distances add_capital_distances() function.","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"","code":"gw_capitals"},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"data frame 248 observations following 7 variables. gwcode numeric vector Gleditsch-Ward state code statenme character vector state capital character vector name capital styear character vector start year. See details section information. endyear character vector end year. See details section information. lat numeric vector latitude coordinates capital lng numeric vector longitude coordinates capital","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"convenience, start year states 1816. Samoa, example, state 1816. However, functions use gw_capitals data create observations states exist given point time. data current end 2020. Cases start year 1816 indicate capital transition. example, Brazil's capital moved Rio de Janeiro Brasilia (planned capital) 1960. 25 states data experienced capital transition. recent Burundi 2018. Indonesia, writing, planning capital transition, completed yet. Kazakhstan renamed capital state leader 2019. data retain name Astana. changed event software use records change. capitals data without peculiarities. Prominently, Portugal transferred Portuguese court Lisbon Rio de Janeiro 1808 1821. recorded data. knowledge inter-state conflict data note war dispute , say, Portugal Spain (Portugal country) point time, create weirdness suggest massive distance two countries, like Portugal Spain, otherwise land-contiguous. Spain: republican government moved capital start civil war (1936) Valencia. However, abandoned capital 1937. elect record capital transition. Myanmar: Gleditsch-Ward system stands Myanmar entered bulk 19th century. capitals recorded Myanmar (Burma) coincide capitals Konbaung dynasty. data also (think) reasonable back-dating capitals coincide states transition without necessarily formal capitals first appearance state system membership data. concern Lithuania, Kazakhstan, Philippines. Kaunas initial post-independence capital Lithuania. Almaty initial post-independence capital Kazakhstan. Quezon City initial post-independence capital Philippines. concerns, , one two years three countries.","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"complete (believe) data set Gleditsch-Ward states Correlates War states, byproduct full_join() gw_states cow_states leans largely state abbreviation variable.","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"","code":"gw_cow_years"},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"data frame 18425 observations following 6 variables. gwcode Gleditsch-Ward state code stateabb state abbreviation, greatest source agreement data sets gw_statename state name appears Gleditsch-Ward data ccode Correlates War state code cow_statename state name appears Correlates War data year numeric vector year","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"data-raw directory project's Github contains information data created. going use internal stuff. workflow going treat Gleditsch-Ward state system membership codes \"master\" codes, user can add Correlates War identifiers see fit. Data extended 2020, assuming changes state system membership either data set.","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":null,"dir":"Reference","previous_headings":"","what":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"complete directed dyad-year data frame Gleditsch-Ward state system members. offer shortcut various functions. general rule, data frame updated every calendar year include recently concluded calendar year.","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"","code":"gw_ddy"},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"data frame following 3 variables. gwcode1 numeric vector Correlates War state code first state gwcode2 numeric vector Correlates War state code second state year numeric vector year","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"Data quick generation create_dyadyears(system=\"gw\") function package.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":null,"dir":"Reference","previous_headings":"","what":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"non-directed dyad-year data minimum distance states Gleditsch-Ward state system 1886 2018. data generated cshapes package.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"","code":"gw_mindist"},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"data frame 868813 observations following 4 variables. gwcode1 Gleditsch-Ward state system code first state gwcode2 Gleditsch-Ward state system code second state year year mindist minimum distance states Jan. 1 year, kilometers","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"data generated cshapes package. package authors purport data generated compatible Gleditsch-Ward system. trust ; indeed, Gleditsch one authors cshapes package. Data automatically generated (default) directed dyad-years. elect make non-directed space considerations. Making non-directed dyad-year data directed dyad-year data difficult R. just looks weird see code . Previous versions data minimum distance Dec. 31 referent year. now Jan. 1. data prove elsewhere package understood data start year. process, example, capitals data get merged add_capital_distance() function. However, script generates data set Jan. 1 year Dec. 31. Right now, cshapes appear work system know . Fortunately, package authors made data available.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"state-year level data surplus gross domestic product Correlates War state system members. Data also include population estimates per capita standardization.","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"","code":"gw_sdp_gdp"},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"data frame 27387 observations following five variables. gwcode numeric vector Gleditsch-Ward state code year numeric vector year wbgdp2011est numeric vector estimated natural log GDP 2011 USD (log-transformed) wbpopest numeric vector estimated population size (log-transformed) sdpest numeric vector estimated surplus domestic product (log-transformed) wbgdppc2011est numeric vector estimated GDP per capita (log-transformed)","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"provided Anders separate Github repository project. data ultimately simulated, user can expect slight differences Correlates War version data (Anders et al. published) Gleditsch-Ward version data (appear one authors vigorously support going forward). Space considerations compel round data three decimal points. \"economic\" data routinely biggest package, decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. original simulations available remote download like. Type ?download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":null,"dir":"Reference","previous_headings":"","what":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"independent states Gleditsch Ward's data.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"","code":"gw_states"},{"path":"http://svmiller.com/reference/gw_states.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"data frame 216 observations following 5 variables. gwcode numeric vector Gleditsch-Ward country code stateabb character vector state abbreviation statename character vector state name startdate start date data enddate end date data","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"Data originally provided Gleditsch column names. Column names added light re-cleaning order generate data. \"Wuerttemberg\" \"Cote D'Ivoire\" statename column needed renamed ensure maximal compliance CRAN, raises notes every non-ASCII character appears package. think problematic , , state names never basis something like match merge countrycode.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"Gleditsch, Kristian S. Michael D. Ward. 1999. \"Revised List Independent States since Congress Vienna.\" International Interactions 25(4): 393--413.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"democracy data Correlates War state system members.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"","code":"gwcode_democracy"},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"data frame 18289 observations following 5 variables. gwcode Gleditsch-Ward system code year numeric vector year v2x_polyarchy Varieties Democracy \"polyarchy\" estimate polity2 polity2 score Polity project xm_qudsest extension Unified Democracy Scores (UDS) estimates, made possibly QuickUDS package Xavier Marquez.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"Missing data connote data unavailable various reasons. Either democracy data code , case Polity project, state system member outright evaluated variable. Polity data 2017. Varieties Democracy data version 10. Xavier Marquez' QuickUDS estimates (.e. extensions Pemstein et al. (2010)) come package Marquez makes available Github (https://github.com/xmarquez/QuickUDS).","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":null,"dir":"Reference","previous_headings":"","what":"Historical Index of Ethnic Fractionalization data — hief","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data set state-year estimates ethnic fractionalization.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Historical Index of Ethnic Fractionalization data — hief","text":"","code":"hief"},{"path":"http://svmiller.com/reference/hief.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data frame 8808 observations following 5 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code year year efindex numeric vector estimate ethnic fractionalization","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data-raw directory project's Github contains information data created.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Historical Index of Ethnic Fractionalization data — hief","text":"Drazanova, Lenka. 2020. \"Introducing Historical Index Ethnic Fractionalization (HIEF) Dataset: Accounting Longitudinal Changes Ethnic Diversity.\" Journal Open Humanities Data 6:6 doi: 10.5334/johd.16","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":null,"dir":"Reference","previous_headings":"","what":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"simple data set matches, well one can, leader codes across Archigos 4.1, Archigos 2.9, LEAD data set.","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"","code":"leader_codes"},{"path":"http://svmiller.com/reference/leader_codes.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"data frame following four variables. obsid observation ID Archigos data leadid leader ID version 4.1 Archigos data leadid29 leader ID version 2.9 Archigos data leaderid leader ID LEAD data","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"data treat version 4.1 Archigos data gospel leader data () observation ID (obsid) master code indicating leader tenure period. also builds assumption various observations duplicate LEAD data duplicated. concerns Francisco Aguilar Barquer (appears twice), Emile Reuter (appears twice), Gunnar Thoroddsen (appears three times) LEAD data despite uninterrupted tenures office. None covariates associated leaders change LEAD data, assume duplicates.","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":null,"dir":"Reference","previous_headings":"","what":"Leader Willingness to Use Force — lwuf","title":"Leader Willingness to Use Force — lwuf","text":"estimates leader willingness use force estimated Carter Smith (2020).","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Leader Willingness to Use Force — lwuf","text":"","code":"lwuf"},{"path":"http://svmiller.com/reference/lwuf.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Leader Willingness to Use Force — lwuf","text":"data frame 3409 observations following 9 variables. obsid observational ID archigos theta1_mean mean simulated M1 theta, estimated Carter Smith (2020) theta1_sd standard deviation simulated M1 thetas theta2_mean mean simulated M2 theta, estimated Carter Smith (2020) theta2_sd standard deviation simulated M2 thetas theta3_mean mean simulated M3 theta, estimated Carter Smith (2020) theta3_sd standard deviation simulated M3 thetas theta4_mean mean simulated M4 theta, estimated Carter Smith (2020) theta4_sd standard deviation simulated M4 thetas","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Leader Willingness to Use Force — lwuf","text":"letter published authors contains information thetas refer. \"M1\" theta variation standard Rasch model boilerplate information LEAD data. authors consider \"theoretically relevant\" \"risk-related\" refer conflict risk-taking. \"M2\" theta expands \"M1\" including political orientation psychological characteristics. \"M3\" \"M4\" expand \"M1\" \"M2\" considering 36 variables LEAD data. authors construct include measures, though analyses suggest \"M2\" best-performing measure.","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Leader Willingness to Use Force — lwuf","text":"Carter, Jeff Charles E. Smith, Jr. 2020. \"Framework Measuring Leaders' Willingness Use Force.\" American Political Science Review 114(4): 1352--1358.","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":null,"dir":"Reference","previous_headings":"","what":"Zeev Maoz' Regional/Global Power Data — maoz_powers","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"Zeev Maoz' data states regional global powers given point time. extensions Correlates War major power data, codes \"major\" power without consideration regional global distinctions. Think Austria-Hungary intuitive issue . Austria-Hungary major power Correlates War data, good reason treat Austria-Hungary major power within Europe. Zeev Maoz tries .","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"","code":"maoz_powers"},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"data frame 20 observations following 5 variables. ccode numeric vector Correlates War country code regstdate start date regional power status regenddate end date regional power status globstdate start date global power status globenddate end date global power status","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"Maoz, Zeev. 2010. Network Nations: Evolution, Structure, Impact International Networks, 1816-2001. Cambridge University Press.","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":null,"dir":"Reference","previous_headings":"","what":"A BibTeX Data Frame of Citations — ps_bib","title":"A BibTeX Data Frame of Citations — ps_bib","text":"BibTeX file, loaded data frame, assist user properly citing source material used package.","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A BibTeX Data Frame of Citations — ps_bib","text":"","code":"ps_bib"},{"path":"http://svmiller.com/reference/ps_bib.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A BibTeX Data Frame of Citations — ps_bib","text":"data frame following columns. CATEGORY BibTeX entry type BIBTEXKEY BibTeX unique entry key ADDRESS another BibTeX field ANNOTE another BibTeX field AUTHOR list authors entry BOOKTITLE another BibTeX field, book title (appropriate) CHAPTER another BibTeX field, chapter (appropriate) CROSSREF another BibTeX field EDITION another BibTeX field, edition book (appropriate) EDITOR another BibTeX field, book editor (appropriate) HOWPUBLISHED another BibTeX field INSTITUTION another BibTeX field JOURNAL another BibTeX field, journal name (appropriate) KEY another BibTeX field MONTH another BibTeX field NOTE another BibTeX field NUMBER another BibTeX field, journal volume number (appropriate) ORGANIZATION another BibTeX field PAGES another BibTeX field, pages entry PUBLISHER another BibTeX field, book publisher (appropriate) SCHOOL another BibTeX field SERIES another BibTeX field TITLE another BibTeX field, title entry TYPE another BibTeX field VOLUME another BibTeX field, journal volume (appropriate) YEAR another BibTeX field, year publication KEYWORDS another BibTeX field, used primarily selective filtering package URL another BibTeX field, website (appropriate) OWNER another BibTeX field TIMESTAMP another BibTeX field, used occasionally started populating master file (see old entries ) DOI another BibTeX field, digital object identifier (used rarely) EPRINT another BibTeX field JOURNALTITLE another BibTeX field, think actually BibLaTeX field ISSN another BibTeX field ABSTRACT another BibTeX field, entry abstract (appropriate) DATE.ADDED another BibTeX field DATE.MODIFIED another BibTeX field","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A BibTeX Data Frame of Citations — ps_bib","text":"See data-raw directory data generated. data created bib2df, now package dependency. assume user familiarity BibTeX. entries copy-pasted master bibliography file started 2008 .","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":null,"dir":"Reference","previous_headings":"","what":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"ps_cite() allows user get citations scholarship include papers incorporate functions data package.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"","code":"ps_cite(x, column = \"keywords\")"},{"path":"http://svmiller.com/reference/ps_cite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"x character vector column character vector particular column ps_bib user wants search. default \"keywords\", searches KEYWORDS column ps_bib general search. option \"bibtexkey\", search BIBTEXKEY column ps_bib. Use latter option pairing output ps_version()","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"ps_cite() takes character vector scans ps_bib data package return BibTeX citation (citations) researcher use properly cite material getting package. citations returned full BibTeX entry (entries) can copy-paste BibTeX file.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"base functionality simple pattern-matching keywords ps_bib. simple pattern-matching base R. assume user familiarity BibTeX.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"","code":"# Cite the package ps_cite(\"peacesciencer\") #> @ARTICLE{peacesciencer-package, #> AUTHOR = {Steven V. Miller}, #> JOURNAL = {Conflict Management and Peace Science}, #> TITLE = {peacesciencer}: An R Package for Quantitative Peace Science Research}, #> YEAR = {2022}, #> KEYWORDS = {peacesciencer, add_capital_distance(), add_ccode_to_gw(), add_gwcode_to_cow(), capitals}, #> URL = {http://svmiller.com/peacesciencer/}} #>"},{"path":"http://svmiller.com/reference/ps_data_version.html","id":null,"dir":"Reference","previous_headings":"","what":"The Version Numbers for Data Included in peacesciencer — ps_data_version","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"simple data set communicates version numbers data included package. companion data frame ps_bib, information functions like ps_cite() ps_version(). latter uses data set.","code":""},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"","code":"ps_data_version"},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"data frame following four variables. category category type data data name particular data source coinciding category version version number included peacesciencer data source bibtexkey character key BibTeX key corresponding appropriate citation ps_bib","code":""},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"Version numbers years understood data sources formal version numbering system, per se. Instead, communicate year last update. example, Correlates War formally version number state system data MID data. Likewise, Anders et al. (2020) simulations population surplus/gross domestic product formally versioned, per se. Instead, data published last updated 2020.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Version Information About Data Included in peacesciencer — ps_version","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"ps_version() allows user see version information data included peacesciencer.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"","code":"ps_version(cat)"},{"path":"http://svmiller.com/reference/ps_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"cat category data type user wants, character","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"ps_version() takes character vector scans ps_data_version data package return information particular data versions included peacesciencer well suggested citation key scanning ps_cite(). category specified searching, just returns version information data included functions package.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"base functionality simple pattern-matching keywords ps_data_version. simple pattern-matching base R. assume user familiarity types data included package. searching done category included ps_data_version data. Users may want just minimally run ps_version() argument specified see . Typing unique(ps_data_version$category) may also get started. user can consider companion function ps_cite(). Whereas ps_cite() return appropriate citation use bibliography, may tell version number . example, classic suggested citations Correlates War National Material Capabilities data Singer et al. (1972) Singer (1987), though data included package 30 years older recent citation two. information communicated can/included alongside parenthetical citation. example, contiguity data quite bit current suggested citation Stinnett et al. (2002). Thus, user may want cite data paper something like (Stinnett et al. 2002, v. 3.2).","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"","code":"# What can you search for... unique(ps_data_version$category) #> [1] \"states\" \"leaders\" \"alliance\" #> [4] \"democracy\" \"capitals\" \"contiguity\" #> [7] \"igo\" \"majors\" \"conflict_interstate\" #> [10] \"distance\" \"capabilities\" \"gdp\" #> [13] \"sdp\" \"population\" \"trade\" #> [16] \"conflict_intrastate\" \"fractionalization\" \"polarization\" #> [19] \"terrain\" \"rivalries\" \"dyadic_similarity\" # will show the data versions for everything ps_version() #> # A tibble: 32 × 4 #> category data version bibtexkey #> #> 1 states Correlates of War State System Membership 2016 cowstates2016 #> 2 leaders LEAD 2015 ellisetal2015le… #> 3 leaders Archigos 4.1 goemansetal2009… #> 4 alliance ATOP 5 leedsetal2002at… #> 5 alliance Correlates of War Formal Alliances 4.1 gibler2009ima #> 6 democracy Polity 2017 marshalletal201… #> 7 democracy {QuickUDS} 0.2.3 marquez2016qme #> 8 democracy V-Dem 10 coppedgeetal202… #> 9 capitals {peacesciencer} 2020 peacesciencer-p… #> 10 contiguity Correlates of War Direct Contiguity 3.2 stinnettetal200… #> # … with 22 more rows # will show data versions for particular categories of data ps_version(\"democracy\") #> # A tibble: 3 × 4 #> category data version bibtexkey #> #> 1 democracy Polity 2017 marshalletal2017p #> 2 democracy {QuickUDS} 0.2.3 marquez2016qme #> 3 democracy V-Dem 10 coppedgeetal2020vdem ps_version(\"leaders\") #> # A tibble: 3 × 4 #> category data version bibtexkey #> #> 1 leaders LEAD 2015 ellisetal2015lead #> 2 leaders Archigos 4.1 goemansetal2009ia #> 3 leaders Leader Willingness to Use Force 2020 cartersmith2020fml"},{"path":"http://svmiller.com/reference/rugged.html","id":null,"dir":"Reference","previous_headings":"","what":"Rugged/Mountainous Terrain Data — rugged","title":"Rugged/Mountainous Terrain Data — rugged","text":"data set state-level estimates \"ruggedness\" state's terrain.","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rugged/Mountainous Terrain Data — rugged","text":"","code":"rugged"},{"path":"http://svmiller.com/reference/rugged.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Rugged/Mountainous Terrain Data — rugged","text":"data frame 192 observations following 6 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code rugged terrain ruggedness index newlmtnest (natural log) percentage estimate state's terrain mountainous","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rugged/Mountainous Terrain Data — rugged","text":"data-raw directory project's Github contains information data created. goes without saying data move slowly data really applicable making state--state comparisons states--time comparisons. terrain ruggedness index originally introduced Riley et al. (1999) amended Nunn Puga (2012). mountain terrain data originally created Fearon Laitin (2003) extended amended Gibler Miller (2014). data functionally time-agnostic---use caution state-year analyses---data sets seem benchmark around 1999-2000. sure matters much, matters little margins, suppose, suspect major differences interpretation much \"rugged\" Soviet Union Russia, Yugoslavia Serbia.","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rugged/Mountainous Terrain Data — rugged","text":"Fearon, James D., David Laitin, \"Ethnicity, Insurgency, Civil War\" American Political Science Review 97: 75–90. Gibler, Douglas M. Steven V. Miller. 2014. \"External Territorial Threat, State Capacity, Civil War.\" Journal Peace Research 51(5): 634-646. Nunn, Nathan Diego Puga. 2012. \"Ruggedness: Blessing Bad Geography Africa.\" Review Economics Statistics. 94(1): 20-36. Riley, Shawn J., Stephen D. DeGloria, Robert Elliot. 1999. \"Terrain Ruggedness Index Quantifies Topographic Heterogeneity,” Intermountain Journal Sciences 5: 23–27.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"show_duplicates() shows data duplicated data generated peacesciencer. useful diagnostic tool users --functions peacesciencer.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"","code":"show_duplicates(data)"},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"data dyad-year data frame state-year data frame created peacesciencer.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"show_duplicates() takes dyad-year data frame state-year data frame generated peacesciencer shows observations duplicated unique combination dyad-year state-year, contingent supplied .","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe. data returned also new column called duplicated. Thus, implicit assumption function user column data name interest user. overwritten.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% show_duplicates() #> # A tibble: 1,838 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2981 2 40 1983 1 1 1 0 1 0 #> 2 3058 2 40 1983 1 1 1 0 1 0 #> 3 1554 2 70 1836 1 1 0 1 0 0 #> 4 1555 2 70 1836 1 1 1 0 0 0 #> 5 1556 2 70 1836 1 0 1 0 0 0 #> 6 1548 2 70 1860 1 0 1 0 0 0 #> 7 1549 2 70 1860 1 1 1 0 1 0 #> 8 2347 2 93 1982 1 0 0 1 1 1 #> 9 2977 2 93 1982 1 1 1 0 1 0 #> 10 2741 2 95 1988 1 0 1 0 1 0 #> # … with 1,828 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% show_duplicates() #> # A tibble: 2,152 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2981 2 40 1983 1 1 1 0 0 0 #> 2 3058 2 40 1983 1 1 1 0 1 2 #> 3 69 2 42 1916 1 0 1 0 0 0 #> 4 322 2 42 1916 1 1 1 0 -9 -9 #> 5 1554 2 70 1836 1 1 0 1 0 0 #> 6 1555 2 70 1836 1 1 1 0 0 0 #> 7 1548 2 70 1860 1 0 1 0 0 0 #> 8 1549 2 70 1860 1 1 1 0 -9 -9 #> 9 2 2 200 1902 1 1 1 0 0 0 #> 10 254 2 200 1902 1 1 0 1 0 0 #> # … with 2,142 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2"},{"path":"http://svmiller.com/reference/td_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"simple summary strategic (inter-state) rivalries Thompson Dreyer (2012).","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"","code":"td_rivalries"},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"data frame 197 observations following 10 variables. rivalryno numeric vector rivalry number rivalryname character vector rivalry name ccode1 Correlates War state code state lowest Correlates War state code rivalry ccode2 Correlates War state code state highest Correlates War state code rivalry styear numeric vector start year rivalry endyear numeric vector end year rivalry region character vector region rivalry, per Thompson Dreyer (2012) type1 character vector primary type rivalry (spatial, positional, ideological, interventionary) type2 character vector secondary type rivalry, applicable (spatial, positional, ideological, interventionary) type3 character vector tertiary type rivalry, applicable (spatial, positional, ideological, interventionary)","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"Information gathered appendix Thompson Dreyer (2012). Ongoing rivalries right-bound 2010, date publication Thompson Dreyer's handbook. Users free change like. Data effectively identical strategic_rivalries stevemisc, include behind--scenes processing (described blog post http://svmiller.com) available see project's Github repository. data object also renamed avoid conflict.","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R. David Dreyer. 2012. Handbook International Rivalries. CQ Press.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"simple summary strategic (inter-state) rivalries Thompson et al. (2021). simple spreadsheet entry job (light cleaning) based information provided pages 34 46 book.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"","code":"tss_rivalries"},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"data frame 264 observations following 12 variables. tssr_id numeric vector rivalry number rivalry character vector rivalry name ccode1 Correlates War state code state lowest Correlates War state code rivalry ccode2 Correlates War state code state highest Correlates War state code rivalry start numeric vector start year rivalry end numeric vector end year rivalry positional numeric vector 1 Thompson et al. (2021) say rivalry positional element (NA otherwise) spatial numeric vector 1 Thompson et al. (2021) say rivalry spatial element (NA otherwise) ideological numeric vector 1 Thompson et al. (2021) say rivalry ideological element (NA otherwise) interventionary numeric vector 1 Thompson et al. (2021) say rivalry interventionary element (NA otherwise) principal numeric vector 1 Thompson et al. (2021) say rivalry primary (principal) rivalry rivals (NA otherwise) aprin numeric vector 1 Thompson et al. (2021) say asymmetric principal rivalry (NA otherwise)","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"Information gathered chapter 2 Thompson et al. (2021). Ongoing rivalries right-bound 2020. several cases, start dates 1494 1816 originally \"P\" attached , indicating ongoing particular year. captured \"raw\" spreadsheet included \"data-raw\" directory, though adjusted finished data product. file adjusts assuredly two print errors Thompson et al. (2021). print, Thompson et al. (2021) say Italy-Turkey rivalry extends 1884-1843 say Mauritania-Morocco rivalry extends 1060-1969. meant end year 1943 first case start year 1960 second case. fixed version. Venice never appears data set Correlates War ecosystem data, gave country code 324 sake data (previous Thompson Dreyer (2012) version ). never use , worth saying loud . Thompson et al. (2021) dedicate book expanding various types rivalry. Users know Thompson Dreyer (2012) version see differences . First, rivalries longer formal primary, secondary, tertiary types. Instead, rivalries /markers whether particular element rivalry type present rivalry. read far Thompson et al. (2021), along ordering information Chapter 2, reads like just made informal otherwise formal classification component Thompson Dreyer (2012) rivalry data. Positional rivalries seem informal \"type 1\" Thompson et al. (2021) discuss , dissimilar classic alliance scholarship treats defense \"type 1\" pledge. matter, book already explicit positional spatial rivalries clearly different ideological interventionary rivalries, certainly interventionary rivalries. \"Principal\" \"asymmetric principal\" rivalries new classification Thompson et al. (2021), relative Thompson Dreyer (2012). \"Principal\" rivalries exist 1) two rivals rivalry 2) two rivals elevate rivalry primary rivalry among rivalries. Asymmetric principal rivalries one two rivals sees primary rival. Consider two U.S.-Russian rivalries illustrative. Tge rivalry Soviet Union (tssr_id = 100) primary rivalry U.S. (Soviet Union). However, U.S. presently sees China main rival (tssr_id = 211). ongoing rivalry Russia (tssr_id = 246) one Russia sees U.S. primary rival U.S. see Russia way.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R., Kentaro Sakuwa, Prashant Hosur Suhas. 2021. Analyzing Strategic Rivalries World Politics: Types Rivalry, Regional Variation, Escalation/De-escalation. Springer.","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":null,"dir":"Reference","previous_headings":"","what":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"(kind ) dyadic, mostly state-level data, used internally stuff UCDP armed conflict data","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"","code":"ucdp_acd"},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"data frame 4164 observations following 15 variables. conflict_id conflict identifier, confused episode identifier (think UCDP offers) year numeric vector year gwno_a Gleditsch-Ward state code state side armed conflict gwno_a_2nd Gleditsch-Ward state code state actively supported side armed conflict use troops gwno_b Gleditsch-Ward state code actor side B armed conflict gwno_b_2nd Gleditsch-Ward state code state actively supported side B armed conflict use troops incompatibility character vector main conflict issue (\"territory\", \"government\", \"\") intensity_level numeric vector intensity level calendar year (1 = minor (25-999 deaths), 2 = war (>1,000 deaths)) type_of_conflict character vector type conflict (\"extrasystemic\", \"interstate\", \"intrastate\", \"II\"). \"II\" simple abbreviation \"internationalized intrastate\" start_date date first battle-related death conflict, confused first battle-related death episode start_prec level precision start_date start_date2 date first battle-related death episode, confused first battle-related death conflict start_prec2 level precision start_date2 ep_end dummy variable whether conflict episode ended calendar year observation ep_end_date episode end date, applicable","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"data-raw directory project's Github show processed multiple strings multiple states given side.","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"UCDP Onset Data (v. 19.1) — ucdp_onsets","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"state-year level data armed conflict onsets provided Uppsala Conflict Data Program (UCDP).","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"","code":"ucdp_onsets"},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"data frame 10142 observations following eight variables. gwcode numeric vector Gleditsch-Ward state code year numeric vector year sumnewconf numeric vector sum new conflicts/conflict-dyads sumonset1 numeric vector sum new conflict episodes, whether new conflict one year since last conflict episode sumonset2 numeric vector sum new conflict episodes, whether new conflict two years since last conflict episode sumonset3 numeric vector sum new conflict episodes, whether new conflict three years since last conflict episode sumonset5 numeric vector sum new conflict episodes, whether new conflict five years since last conflict episode sumonset10 numeric vector sum new conflict episodes, whether new conflict 10 years since last conflict episode","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"user want note data provided UCDP technically country-year observations. instead duplicate observations cases new conflicts new conflict episodes. , original data provide information conflict-dyad question duplicates pertain. means data can package's mission provide summary information. user probably recode variables something else may want particular application","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"whittle_conflicts_duration() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest estimated duration.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"","code":"whittle_conflicts_duration(data, durtype = \"mindur\") wc_duration(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"data data frame declared conflict attribute type. durtype duration filter/whittle data. Options include \"mindur\" \"maxdur\". default \"mindur\". ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"whittle_conflicts_duration() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible cut later procedure (whittling onsets whittle_conflicts_onsets(), maybe things extent dispute-level duration heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). conflicts can unknown length often come estimates minimum duration maximum duration. concern durtype parameter function. many/conflicts, certainly thinking inter-state dispute data, dates known precision (day) estimate minimum conflict duration equal estimate maximum conflict duration. conflicts, estimates vary. importantly imply using particular whittle function default (mindur) produce different results using particular whittle function asking retain highest maximum duration (maxdur). Use function mind. wc_duration() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_duration() #> # A tibble: 9,308 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,298 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_duration() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,268 × 20 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,258 more rows, 10 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , mindur , maxdur , and abbreviated variable names #> # ¹​disponset, ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"whittle_conflicts_fatality() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest observed fatality.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"","code":"whittle_conflicts_fatality(data) wc_fatality(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"whittle_conflicts_fatality() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible second cut (whittling onsets whittle_conflicts_onsets() extent dispute-level fatality good heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). writing, Correlates War Gibler-Miller-Little conflict data record -9s fatalities. cases, dispute-level fatality momentarily recoded .5 (.e. fatal, without many fatalities). missing data problem Gibler Miller correct forthcoming publication Journal Conflict Resolution. , function makes kind determination disputes missing fatalities. wc_fatality() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_fatality() #> # A tibble: 9,504 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,494 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_fatality() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,536 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,526 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , fatality , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"whittle_conflicts_hostility() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest observed hostility.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"","code":"whittle_conflicts_hostility(data) wc_hostility(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"whittle_conflicts_hostility() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible second third cut (whittling onsets whittle_conflicts_onsets() extent dispute-level hostility good heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). wc_hostility() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_hostility() #> # A tibble: 9,550 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,540 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_hostility() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,596 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,586 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , hostlev , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Just Dropping Something (","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"whittle_conflicts_jds() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function just drop something, kind nuclear option.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"","code":"whittle_conflicts_jds(data) wc_jds(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"whittle_conflicts_jds() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). really absolute last exclusion rules researcher uses. \"nuclear option\", . Assuming run case exclusion rules isolate onsets severe disputes, remains end duplicates functionally equivalent observations. data duplicates, remaining observations basically . Therefore, just drop something. wc_jds() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_jds() #> # A tibble: 9,284 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,274 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_jds() #> # A tibble: 10,234 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,224 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"whittle_conflicts_reciprocation() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function drop ongoing conflicts presence unique onsets.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"","code":"whittle_conflicts_onsets(data) wc_onsets(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"whittle_conflicts_onsets() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations unique onsets duplicates exist. eliminate duplicates, far , sensible place start.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). wc_onsets() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() #> # A tibble: 9,802 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2 2 200 1902 1 1 1 0 1 1 #> 2 2 200 2 1902 1 1 0 1 1 1 #> 3 3 300 345 1913 1 1 1 0 1 0 #> 4 3 345 300 1913 1 1 0 1 0 1 #> 5 4 200 339 1946 1 1 0 1 0 0 #> 6 4 339 200 1946 1 1 1 0 0 0 #> 7 7 200 651 1951 1 1 1 0 0 1 #> 8 7 200 651 1952 1 0 1 0 0 1 #> 9 7 651 200 1951 1 1 0 1 1 0 #> 10 7 651 200 1952 1 0 0 1 1 0 #> # … with 9,792 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% whittle_conflicts_onsets() #> # A tibble: 10,874 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2 2 200 1902 1 1 1 0 0 0 #> 2 2 200 2 1902 1 1 0 1 0 0 #> 3 3 300 345 1913 1 1 1 0 0 0 #> 4 3 345 300 1913 1 1 0 1 0 0 #> 5 4 200 339 1946 1 1 0 1 2 0 #> 6 4 339 200 1946 1 1 1 0 0 2 #> 7 7 200 651 1951 1 1 1 0 1 2 #> 8 7 200 651 1952 1 0 1 0 1 2 #> 9 7 651 200 1951 1 1 0 1 2 1 #> 10 7 651 200 1952 1 0 0 1 2 1 #> # … with 10,864 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"whittle_conflicts_reciprocation() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations reciprocated (.e. militarized actions sides conflict).","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"","code":"whittle_conflicts_reciprocation(data) wc_recip(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"whittle_conflicts_reciprocation() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations militarized actions sides conflict. eliminate duplicates, far , sensible cut later procedure (whittling onsets whittle_conflicts_onsets() extent dispute-level reciprocation heuristic dispute-level severity/importance (considerations).","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). Scholars free use heuristic whittling conflict-year data coerced true dyad-year data, remiss offer caveat reciprocation variable inter-state dispute data. Namely, noisy scholars often think inter-state dispute data. Reciprocation observed militarized action sides conflict. definition, someone Side militarized action. every state Side B . However, scholars interpret absence militarized responses. forthcoming article Journal Conflict Resolution, Doug Gibler make case reciprocation useful variable maintain can invite errors (often case CoW-MID data) obscure fact states attacked another side routinely fight back. many occasions, also successfully repel attack. Scholars uncritically use variable, certainly hypothesis-testing audience costs, borrowing trouble measure. wc_recip() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_reciprocation() #> # A tibble: 9,640 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,630 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_reciprocation() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,590 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,580 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , recip , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"whittle_conflicts_startmonth() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"","code":"whittle_conflicts_startmonth(data) wc_stmon(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"whittle_conflicts_startmonth() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). really one last exclusion rules researcher uses. substantive reason assume lower start month matters cause isolating \"serious\" \"severe\" disputes presence duplicates. really just way isolating duplicated observation happened first remaining duplicates otherwise similar . wc_stmon() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_startmonth() #> # A tibble: 9,344 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,334 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_startmonth() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,296 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,286 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , stmon , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-110","dir":"Changelog","previous_headings":"","what":"peacesciencer 1.1.0","title":"peacesciencer 1.1.0","text":"Changes include: Package now depends version 1.6.0 {stevemisc}. comes later versions R balk use order() data frames. Changes documentation clarity/presentation. Changes file compression, appropriate. download_extdata() download augmented dyadic minimum distance data CoW G-W states 1886 2019. Add tss_rivalries updated rivalry data 1494 2020. Fixed bug atop_alliance cow_alliance. ’s less peacesciencer bug, per se, raw data presented directed actually directed . now. Fixed bug add_cow_alliance() honor temporal bound alliance data (.e. 1816-2012). b.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-100","dir":"Changelog","previous_headings":"","what":"peacesciencer 1.0.0","title":"peacesciencer 1.0.0","text":"CRAN release: 2022-03-24 version odds ends version accelerated 1.0.0 coincide acceptance manuscript describing package Conflict Management Peace Science. Clarify add_cow_mids() add_gml_mids() default case-exclusion rules dyadic analyses. Assorted documentation upgrades clarity. dyadic foreign policy similarity data now Tau-b estimates. generated , using valued alliance data, used caution (perhaps used ). Check documentation add_fpsim() download_extdata() . Update national material capabilities data (cow_nmc) version 6.0. Update cow_ddy gw_ddy, since ’s 2022 now. Add grh_arms_races arms race data. Amend/update items ps_bib. Change ps_cite() longer depend bib2df. , remove bib2df package dependency.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-070","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.7.0","title":"peacesciencer 0.7.0","text":"CRAN release: 2021-11-11 leader-intensive update. Additions/new features include: LEAD: data set select leader experience attribute descriptions (LEAD). lwuf: data set Carter Smith (2020) measuring leader willingness use force. download_extdata() now also downloads directed leader dyad-year data directed leader dyad-years 1870 2015. data come two forms. One possible (inter-state, leader-overlap) dyadic leader pairings 1870 2015, presented Archigos data. second standardizes data CoW state system data. also downloads directed dyad-yer data chance-corrected measures dyadic foreign policy similarity. Type ?download_extdata() R session updating information. create_leaderdyadyears(): create leader dyad-year data (via archigos) leader dyad-year combinations 1870 2015. function leans remote data available download download_extdata(). function returns either possible Gleditsch-Ward dyadic leader pairings (standardized Gleditsch-Ward state system dates) standardizes Archigos data Correlates War state system member data. gml_part: data set participant summary information GML MID data. add_fpsim() adds estimates dyadic foreign policy similarity dyad-year leader-dyad-year data. add_gml_mids() now works leader-year data. See documentation . add_spells() general peace spell calculations, though package now depend v. 1.3.0 {stevemisc}. add_lwuf() adds estimates leader willingness use force leader-year leader-dyad-year analyses. add_lead() adds leader attributes leader-year leader-dyad-year analyses. gml_mid_dirleaderdisps gml_mid_ddlydisps include data leader dyads conflict. declare_attributes() allows users declare package-specific attributes outside data bring R session. allows user use many shortcuts package data. ps_version() display version information data included package. false_cow_dyads false_gw_dyads list handful dyads appear year, never day year. ’re used anti-joining create_dyadyears(). leader_codes matches, well one can, leader/observation codes Archigos 4.1, Archigos 2.9, LEAD data. changes include: Several functions now leader-year leader-dyad-year corollaries. Examples include add_creg_fractionalization(), add_rugged_terrain(), add_democracy(), . functions, like add_gml_mids(), can anchored explicitly leader-level units analyses. Several functions (e.g. add_sdp_gdp() others like ) fundamentally still state-year dyad-year functions extent leaders still nested states leader-dyads just derivation inter-state dyads (.e. leaders nested states). Use caution mind, though functions still useful leader-level analyses interested covariates making state--state comparisons top leader-level analyses. data cow_sdp_gdp gw_sdp_gdp now rounded three decimal points. “economic” data routinely biggest package, ’s decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. huge reduction disk space. “leader-year” (leader_year) now attribute. appropriate, leader-year state-year functions treated . example, GDP data contained add_sdp_gdp() fundamentally state-year, perhaps leader-year control interest even leaders nested states. “leader-dyad-year” (leader_dyad_year) now attribute. appropriate, leader-year leader-dyad-year functions treated . possible/tractable, leader-dyad-year data explicitly anchored leader-level units analysis (e.g. add_gml_mids(), prominently). create_leaderyears() works observation ID leader ID. Observation IDs unique leader-period, leader IDs . directed leader dyad-year data indexed observation ID leader ID, per se. leaders can multiple terms office. add_peace_years() superseded add_spells(). “superseded” language communicates function still work previous releases, data types supported function, though development stop. add_spells() promises greater functionality. Communicating changes via badges brings lifecycle imported package. archigos data’s ccode renamed gwcode reflect actually Gleditsch-Ward state codes. “whittle” functions now work leader-dyadic conflict data available package. package started taking inventory non-ASCII characters appear package (e.g. spelling “Wuerttemberg” U-umlaut) replacing . functionality issue . problem CRAN raises note every single non-ASCII character sees ’d like avoid CRAN hammer can. create_leaderyears(), create_dyadyears(), create_stateyears() built-argument subsetting years returned function (subset_years). Use discretion.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-060","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.6.0","title":"peacesciencer 0.6.0","text":"CRAN release: 2021-10-13 Extend cow_mindist gw_mindist data, given new {cshapes} updates. Data now run 1886 2019. Create cow_capitals gw_capitals data. Remove capitals data redundancy. capital data sets extended 2020. add_capital_distance() now works Correlates War Gleditsch-Ward data, dyad-year state-year. Fix bug add_atop_alliance() added 0s years ATOP domain. Thanks @joshuaalley pointing . Add/start helper function file. internal functions may need write order reduce potential dependency issues resulting package archival. necessitated Oct. 5, 2021 email Brian Ripley slated removal lubridate. Earlier versions package uncritically leaned lubridate functions either write (.e. year(), now .pshf_year()) already duplicated base functions R (.e. ymd(), wrapper .Date() use ). , lubridate longer requirement package. Upgrade GML conflict data sets 2.2.1. Fix/update documentation . Add dispute-level summary GML conflict data assist user-run whittle functions. gml_mid_disps. Add ps_conflict_type attributes conflict data (e.g. CoW-MID, GML). Add messages case exclusion rules add_cow_mids() add_gml_mids(). Add “whittle” class functions. include whittle_conflicts_onsets(), whittle_conflicts_fatality(), whittle_conflicts_hostility(), whittle_conflicts_duration(), whittle_conflicts_reciprocation(), whittle_conflicts_startmonth(), whittle_conflicts_jds(). admittedly gnarly function names type don’t IDE like RStudio assist . Thus, respective functions come shortcuts wc_ (e.g. wc_onsets()). Check package documentation see . Add show_duplicates() diagnostic tool. function useful users want advanced stuff data created peacesciencer (e.g. merging custom data) want see botched merge creating duplicate observations. Add/update stuff related leaders. archigos data frame now includes information leaders (e.g. name, gender, year birth). create_leaderyears() create leader-year data well. next update expand leader functions. now, ensuing output function treated synonymous state-year data. Add download_extdata() way side-stepping package space limitations. files stored remotely loaded user’s discretion, function . largely brought CoW trade data (cow_trade_ndy), also removed update. data may moved remotely future, though package endeavor keep bare minimum. Importantly, download_extdata() keeps inventory downloading. Data information included therein. develop implicitly assume directory package installed writable user. like 99% users, shouldn’t problem (executing .libPaths() confirm ). reach . Remove country name creg data frame.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-050","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.5.0","title":"peacesciencer 0.5.0","text":"CRAN release: 2021-06-21 Add bib2df package dependency. Force upgraded version {stevemisc} package dependency. Add LazyDataCompression: xz DESCRIPTION Add “system” attributes create_dyadyears(), create_statedays(), create_stateyears(). Add add_cow_wars() function. Add add_ccode_to_gw(). Fix underlying data cow_gw_years. Add gw_cow_years. Add add_strategic_rivalries(). Add add_ucdp_acd(). , update ucdp_acd data functionality. Add add_rugged_terrain(). Add cow_trade_ndy data. , update add_cow_trade() function speed upgrades. Add cow_war_inter, cow_war_intra data. Add creg data. Add gwcode_democracy data. add_democracy() now takes CoW G-W data. Add hief data. Add rugged data. Add td_rivalries data. Add ps_cite() ps_bib. Remove citations. Add log-transformed GDP per capita estimates cow_sdp_gdp gw_sdp_gdp. Update add_sdp_gdp() reflect change. Clarify documentation add_contiguity() non-contiguous dyads 0s 6s. Briefly: don’t think data ordinal don’t encourage researcher think ordinal either. Expand add_peace_years(), now works UCDP conflict data. filter_prd() now shortcut add_contiguity() /add_cow_majors() called near top pipe (.e. user executed commands required calculate politically relevant dyad status). Fix bug add_nmc() (cow_nmc). -9 now explicitly NA, . Fix typos/incomplete information documentation. concerned references scholarship topics. Patch add_peace_years(), can now used anywhere chain commands (instead just last). add_peace_years() also bit “general” includes derivation sbtscs() function {stevemisc} package. Remove mandatory “system” calls add_minimum_distance() add_sdp_gdp(). merges now lean system attributes declared create_dyadyears() create_stateyears(). Remove add_mids(). Use add_gml_mids() instead. Update cow_ddy documentation.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-040","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.4.0","title":"peacesciencer 0.4.0","text":"CRAN release: 2021-05-31 Add cow_mid_ddydisps, cow_mid_dirdisps, cow_mid_disps data. Add gml_mid_ddydisps data. Add add_cow_mids() function. Add add_gml_mids() function. Add add_peace_years() function. Deprecate add_mids(). Use add_gml_mids() instead. Assign ps_data_type == \"dyad_year\" attribute cow_mid_dirdisps gml_dirdisp. allows peacesciencer functions data sets. File compression data files ()","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-030","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.3.0","title":"peacesciencer 0.3.0","text":"CRAN release: 2021-04-28 Add atop_alliance (directed dyad-year) data Add archigos data Add cow_sdp_gdp gw_sdp_gdp data Add ucdp_acd data Add ucdp_onsets data Add add_archigos() function Add add_atop_alliance() function Add add_minimum_distance() function. now, default. must specify “gw” “cow”. Add add_sdp_gdp() function. now, default. must specify “gw” “cow”. Add add_ucdp_onset() function. Add “stops” force correct merge correct system code. applications, Correlates War codes. File compression data files () Fixed bug filter_prd(). Past versions code treated non-contiguous dyads 6s. , ’re 0s. created situations wasn’t filtering anything function. Rename variables cow_alliance distinguish ATOP equivalents.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-020","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.2.0","title":"peacesciencer 0.2.0","text":"CRAN release: 2021-03-05 Fix stupid mistake(s) README. File compression data files. Add Correlates War intergovernmental organizations data. Add function adding Correlates War intergovernmental organizations data. Add Correlates War trade data (state-year dyad-year). Add minimum distance data Add citations data frame assistance properly citing things. Add create_statedays() function.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-010","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.1.0","title":"peacesciencer 0.1.0","text":"CRAN release: 2020-12-19 Initial developmental release","code":""}] +[{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"converting-cow-mid-dyadic-dispute-year-data-into-dyad-year-data","dir":"Articles","previous_headings":"","what":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"First, let’s identify dyad-year duplicates data. absolute data United Kingdom-Soviet Union dyad, six conflicts ongoing /initiated 1920. Next tie United States-Soviet Union dyad 1958, Egypt-Israel dyad (1959, 1960), Syria-Israel dyad (1955). told, 498 dyad-years duplicate dyadic dispute-year data. need whittle one dyad-year data.","code":"cow_mid_dirdisps %>% # make it non-directed for ease of presentation filter(ccode2 > ccode1) %>% group_by(ccode1, ccode2, year) %>% summarize(n = n(), mids = paste0(dispnum, collapse = \", \")) %>% arrange(-n) %>% filter(n > 1) %>% ungroup() #> `summarise()` has grouped output by 'ccode1', 'ccode2'. You can override using #> the `.groups` argument. #> # A tibble: 498 × 5 #> ccode1 ccode2 year n mids #> #> 1 200 365 1920 6 186, 197, 1133, 2363, 2364, 2604 #> 2 2 365 1958 5 125, 173, 608, 2215, 2216 #> 3 651 666 1959 5 3375, 3405, 3419, 3421, 3430 #> 4 651 666 1960 5 3375, 3405, 3419, 3422, 3430 #> 5 652 666 1955 5 3404, 3405, 3416, 3417, 3418 #> 6 2 365 1962 4 61, 1353, 2219, 3361 #> 7 2 365 1967 4 345, 2930, 2931, 2934 #> 8 200 365 1919 4 197, 2363, 2604, 2605 #> 9 651 666 1958 4 3375, 3405, 3419, 3420 #> 10 652 666 1954 4 3403, 3404, 3415, 3417 #> # … with 488 more rows"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"first-select-unique-onsets","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"First: Select Unique Onsets","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"primary aim preserve unique onsets. case United States-United Kingdom dyad 1903 illustrate ’s stake . , United States United Kingdom three MIDs ongoing 1903. Two (MID#0002 MID#0254) began 1902. third, MID#3301, new onset. case, want remove observation MID#0002 MID#0254 keep observation MID3301. United States-United Kingdom Dyadic Dispute-Years 1903 ’s peacesciencer first cut. Grouping dyad-year (.e. group_by(ccode1, ccode2, year)), creates new variable equals 1 number rows dyad-year 1. Maintaining grouped structure, calculates standard deviation disponset variable. Cases standard deviation calculate cases dyad-year duplicate assigned 0. Next, creates simple removeme column equals 1 1) ’s duplicated dyad-year, 2) ’s unique onset, 3) standard deviation greater 0 (.e. least one onset dyad-year). removes cases removeme == 1. Observe fixed USA-United Kingdom observation 1903. fix Italy-France problem 1860, ’s three dispute-years onsets year. France-Italy Dyadic Dispute-Years 1903 just tells us ’re done, knew wouldn’t . need exclusion rules whittle data.","code":"cow_mid_dirdisps %>% filter(ccode1 == 2 & ccode2 == 200 & year == 1903) %>% select(dispnum:disponset) %>% kbl(., caption = \"United States-United Kingdom Dyadic Dispute-Years in 1903\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") cow_mid_dirdisps %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% # Remove anything that's not a unique MID onset mutate(sd = sd(disponset), sd = ifelse(is.na(sd), 0, sd)) %>% mutate(removeme = ifelse(duplicated == 1 & disponset == 0 & sd > 0, 1, 0)) %>% filter(removeme != 1) %>% # remove detritus select(-removeme, -sd) %>% # practice safe group_by() ungroup() -> hold_this # ^ The `hold_this` naming convention is my favorite for intermediate objects. # It's also a bad idea to overwrite data objects that come in this package. hold_this %>% filter(ccode1 == 2 & ccode2 == 200 & year == 1903) %>% select(dispnum:disponset) #> # A tibble: 1 × 6 #> dispnum ccode1 ccode2 year dispongoing disponset #> #> 1 3301 2 200 1903 1 1 hold_this %>% filter(ccode1 == 220 & ccode2 == 325 & year == 1860) %>% select(dispnum:disponset) %>% kbl(., caption = \"France-Italy Dyadic Dispute-Years in 1903\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\")"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"second-keep-the-highest-dispute-level-fatality","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Second: Keep the Highest Dispute-Level Fatality","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"presented opportunity keep one dispute drop another two appear year, researchers likely prefer “serious” one rather one might simple threat use show force. Consider Russia-Ottoman Empire (Turkey) dyad-year 1853. two unique onsets two year. One (MID#0057) became Crimean War, important conflict! (MID#0126) apparent show force fatalities. conditions, ’s easy call keep one fatalities. Russia-Ottoman Empire Dyadic Dispute-Years 1853 one limitation CoW-MID data toward end. obviously know CoW-MID assigns fatalities end dispute participants, ’d way knowing priori many fatalities Russia-Turkey dyad 1853. situation like Belgium-Germany 1939-1940. case, highest action Belgium engaged Germany 1939 mobilization war momentarily eliminated Belgium international system happened next year. also don’t know extent Turkey responsible Russia’s fatalities. Crimean War multilateral war pitting Russians United Kingdom, Austria-Hungary, Italy, Turkey, France. Thus, follows crude, still useful. ’ll use dispute-level fatality information stand-keep duplicate dyad-year observation highest fatality score. ’ll also need take inventory handle cases fatality == -9. forthcoming data release, find cases missing fatalities CoW-MID data mean fatalities half cases. even wars! However, ’d way knowing CoW-MID. ’ll safe recode -9 .5, indicating 0 fatalities “less” fatality level 1 (1-25 deaths) CoW-MID can least confidently say latter happened. fix Russia-Turkey-1853 problem. won’t fix cases multiple disputes initiated year dyad, one died. lot . , ’ll need case exclusion rules.","code":"hold_this %>% filter(ccode1 == 365 & ccode2 == 640 & year == 1853) %>% select(dispnum:disponset, fatality1:fatality2, hiact1, hiact2) %>% kbl(., caption = \"Russia-Ottoman Empire Dyadic Dispute-Years in 1853\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, fatality)) %>% mutate(fatality = ifelse(fatality == -9, .5, fatality)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest fatality filter(fatality == max(fatality)) %>% mutate(fatality = ifelse(fatality == .5, -9, fatality)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 365 & ccode2 == 640 & year == 1853) #> # A tibble: 1 × 20 #> dispnum ccode1 ccode2 year dispongoing dispon…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 57 365 640 1853 1 1 1 0 6 6 #> # … with 10 more variables: fatalpre1 , fatalpre2 , hiact1 , #> # hiact2 , hostlev1 , hostlev2 , orig1 , orig2 , #> # duplicated , fatality , and abbreviated variable names #> # ¹​disponset, ²​fatality1, ³​fatality2"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"third-keep-the-highest-dispute-level-hostility","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Third: Keep the Highest Dispute-Level Hostility","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"next case exclusion rule want continue isolating serious MIDs MIDs lesser severity. Consider case India Pakistan 1963. India-Pakistan Dyadic Dispute-Years 1963 two unique MID onsets 1963 neither fatal, meaning duplicate dyad-year still . However, MID#2630 just threat use force whereas MID#1317 occupation territory (Pakistan India). former threat. latter use. MID#2630 higher hostility level MID ’ll want keep. caveat applies, fatalities, ’ll use dispute-level hostility variable plug-. least fix India-Pakistan observation 1963, others like .","code":"hold_this %>% filter(ccode1 == 750 & ccode2 == 770 & year == 1963) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) %>% kbl(., caption = \"India-Pakistan Dyadic Dispute-Years in 1963\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, hostlev)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest hostlev filter(hostlev == max(hostlev)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 750 & ccode2 == 770 & year == 1963) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) #> # A tibble: 1 × 9 #> dispnum ccode1 ccode2 year disponset fatality1 fatality2 hiact1 hiact2 #> #> 1 1317 750 770 1963 1 0 0 0 14"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"fourth-keep-the-highest-dispute-level-minimum-then-maximum-duration","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Fourth: Keep the Highest Dispute-Level (Minimum, Then Maximum) Duration","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"point, still duplicate dyad-years remaining data, ’ve selected cases fairly similar (least given dispute- participant-level data available). duplicates remain unique onsets fatality levels hostility levels. next available measure approximates dispute severity duration. Consider duplicate observation Colombia-Peru 1852 corresponding MIDs (MID#1506 MID#1523). MIDs look fairly similar. started year. level fatalities (none). hostility level (show force). tough read tea leaves argue alert (hiact: 8) “greater” show force (hiact: 7) even 8 > 7 (.e. CoW-MID action codes never truly ordinal). , ’re multilateral MIDs. MID#1506 pit Venezuela Colombia Chile Peru whereas MID#1523 pit Chile Colombia Peru. even unhelpfully unknown duration . -9s start days . However, MID#1523 highest minimum duration. lasted least 110 days (many 140) whereas MID#1506 minimum duration 63 days (maximum duration 122 days). conditions, keep one minimum duration , duplicates still remain, keep one highest maximum duration. fix Colombia-Peru problem 1852.","code":"haven::read_dta(\"~/Dropbox/data/cow/mid/5/MIDB 5.0.dta\") %>% filter(dispnum %in% c(1506, 1523)) %>% select(dispnum:sidea, fatality, hiact, hostlev) #> # A tibble: 7 × 13 #> dispnum stabb ccode stday stmon styear endday endmon endyear sidea fatality #> #> 1 1506 VEN 101 -9 10 1852 -9 11 1852 1 0 #> 2 1506 CHL 155 14 9 1852 -9 11 1852 0 0 #> 3 1506 PER 135 -9 8 1852 -9 11 1852 0 0 #> 4 1506 COL 100 -9 8 1852 -9 11 1852 1 0 #> 5 1523 PER 135 -9 3 1852 18 7 1852 0 0 #> 6 1523 CHL 155 2 6 1852 2 6 1852 1 0 #> 7 1523 COL 100 -9 3 1852 18 7 1852 1 0 #> # … with 2 more variables: hiact , hostlev hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, mindur, maxdur)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest mindur filter(mindur == max(mindur)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the highest maxdur filter(maxdur == max(maxdur)) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% filter(ccode1 == 135 & ccode2 == 100 & year == 1852) %>% select(dispnum:year, disponset, fatality1, fatality2, hiact1, hiact2) #> # A tibble: 1 × 9 #> dispnum ccode1 ccode2 year disponset fatality1 fatality2 hiact1 hiact2 #> #> 1 1523 135 100 1852 1 0 0 0 8"},{"path":"http://svmiller.com/articles/coerce-dispute-year-dyad-year.html","id":"final-case-exclusions-for-the-cow-mid-data","dir":"Articles","previous_headings":"Converting CoW-MID Dyadic Dispute-Year Data into Dyad-Year Data","what":"Final Case Exclusions for the CoW-MID Data","title":"How `{peacesciencer}` Coerces Dispute-Year Data into Dyad-Year Data","text":"started 498 duplicate directed dyad-years dyadic dispute-year data. ’re now just 24 directed (12 non-directed) dyad-years. glance remaining observations suggest substance similar. example, MID#4428 MID#4430 one-day border fortifications Kyrgyzstan Uzbekistan 2005. MID#2171 MID#2172 one-day threats use force Cyprus Turkey 1965. Duplicate Non-Directed Dyad-Years Still Remaining final case exclusion rules round us home. First, duplicate dyad-years feature case one dispute reciprocated . example, MID#4428 mutual border fortification MID#4430 just one border fortification directed Kyrgyzstan Uzbekistan. Thus, keep one involved least two codable incidents rather MID just one codable incident. reader may object reciprocation feature higher proverbial chain, given prominence audience cost literature. caution . Gibler Miller (also Little) driven home reciprocation variable information-poor variable. minimally tells Side B MID initiated militarized incident involved attack clear initiator. review conflict data, find attacks ambushes initiated Side countered happen half time. , inferences made reciprocation variable among sensitive errors report CoW-MID data. reason, discourage researchers using variable analyses , application, ’s peacesciencer uses dispute-level reciprocation variable near bottom rung case exclusions. Still, ’s . ’re just three duplicate dyad-years now. reason MID#4428 MID#4430 still CoW-MID MID#4428 unreciprocated dispute-level also militarized incident Side B dispute. CoW-MID issue peacesciencer issue. Duplicate Non-Directed Dyad-Years Still Remaining three effectively identical MIDs. start year. fatality-level, hostility-level, duration, either reciprocated -reciprocated (MID#4428/MID#4430 issue notwithstanding). Thus, select one lowest start month. enough eliminate duplicate dyad-years.","code":"hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) %>% filter(ccode2 > ccode1) %>% select(dispnum:disponset, hiact1:hiact2, fatality:maxdur) %>% kbl(., caption = \"Duplicate Non-Directed Dyad-Years Still Remaining\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, recip)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the reciprocated ones, where non-reciprocated ones exist filter(recip == max(recip)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) %>% filter(ccode2 > ccode1) %>% select(dispnum:disponset, hiact1:hiact2, fatality:maxdur) %>% kbl(., caption = \"Duplicate Non-Directed Dyad-Years Still Remaining\", booktabs = TRUE, longtable = TRUE) %>% kable_styling(position = \"center\", full_width = F, bootstrap_options = \"striped\") hold_this %>% left_join(., cow_mid_disps %>% select(dispnum, stmon)) %>% arrange(ccode1, ccode2, year) %>% group_by(ccode1, ccode2, year) %>% mutate(duplicated = ifelse(n() > 1, 1, 0)) %>% group_by(ccode1, ccode2, year, duplicated) %>% # Keep the reciprocated ones, where non-reciprocated ones exist filter(stmon == min(stmon)) %>% arrange(ccode1, ccode2, year) %>% # practice safe group_by() ungroup() -> hold_this #> Joining with `by = join_by(dispnum)` # And we're done hold_this %>% group_by(ccode1, ccode2, year) %>% filter(n() > 1) #> # A tibble: 0 × 25 #> # Groups: ccode1, ccode2, year [0] #> # … with 25 variables: dispnum , ccode1 , ccode2 , year , #> # dispongoing , disponset , sidea1 , sidea2 , #> # fatality1 , fatality2 , fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , fatality , hostlev , mindur , #> # maxdur , recip , stmon "},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-year-data","dir":"Articles","previous_headings":"","what":"State-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"basic form data peacesciencer creates state-year, way create_stateyears(). create_stateyears() two arguments: system mry. system takes either “cow” “gw”, depending whether user wants Correlates War state years Gleditsch-Ward state-years. defaults “cow” absence user-specified override given prominence Correlates War data peace science ecosystem. mry takes logical (TRUE FALSE), depending whether user wants function extend recently concluded calendar year (2022). Correlates War state system data extend end 2016 Gleditsch-Ward state system extend end 2017. argument allow researcher extend data years, (reasonable) assumption fundamental composition changes state system since data sets last updated. mry defaults TRUE absence user-specified override. create Correlates War state-year data 1816 2022. create Gleditsch-Ward state-year data 1816 2017.","code":"create_stateyears() #> # A tibble: 17,121 × 3 #> ccode statenme year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,111 more rows create_stateyears(system = \"gw\", mry = FALSE) #> # A tibble: 17,767 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,757 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"dyad-year-data","dir":"Articles","previous_headings":"","what":"Dyad-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"create_dyadyears() one useful functions peacesciencer, transforming raw Correlates War state system data (cow_states peacesciencer) Gleditsch-Ward state system data (gw_states) possible dyad-years. three arguments. system mry operate create_stateyears(). additional argument—directed—also takes logical (TRUE FALSE). default TRUE, returning directed dyad-year data (useful dyadic conflict analyses initiator/target distinction matters). FALSE returns non-directed dyad-year data, useful cases initiator/target distinction matter researcher cares presence absence conflict. convention non-directed dyad-year data ccode2 > ccode1 underlying code create_dyadyears() simply takes directed dyad-year data chops half rule. Correlates War dyad-years 1816 2022. Gleditsch-Ward dyad-years temporal domain.","code":"create_dyadyears() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 3 #> ccode1 ccode2 year #> #> 1 2 20 1920 #> 2 2 20 1921 #> 3 2 20 1922 #> 4 2 20 1923 #> 5 2 20 1924 #> 6 2 20 1925 #> 7 2 20 1926 #> 8 2 20 1927 #> 9 2 20 1928 #> 10 2 20 1929 #> # … with 2,139,260 more rows create_dyadyears(system = \"gw\") #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 2,089,816 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"major-vs--major-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"Major vs. Major Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"Consider section vignette comparison kind dyad-year data EUGene create user, apparently request. EUGene apparently create types dyad-years specific dyad-year types whereas peacesciencer treats case exclusions can fact given functionality package. example, just major vs. major dyads. simplicity’s sake, directed dyad-years core (captured cow_ddy package shortcut).","code":"cow_ddy %>% add_cow_majors() %>% filter(cowmaj1 == 1 & cowmaj2 == 1) #> # A tibble: 6,140 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 200 1898 1 1 #> 2 2 200 1899 1 1 #> 3 2 200 1900 1 1 #> 4 2 200 1901 1 1 #> 5 2 200 1902 1 1 #> 6 2 200 1903 1 1 #> 7 2 200 1904 1 1 #> 8 2 200 1905 1 1 #> 9 2 200 1906 1 1 #> 10 2 200 1907 1 1 #> # … with 6,130 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"major-vs--any-state-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"Major vs. Any State Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years state major power.","code":"cow_ddy %>% add_cow_majors() %>% filter(cowmaj1 == 1 | cowmaj2 == 1) #> # A tibble: 183,722 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 20 1920 1 0 #> 2 2 20 1921 1 0 #> 3 2 20 1922 1 0 #> 4 2 20 1923 1 0 #> 5 2 20 1924 1 0 #> 6 2 20 1925 1 0 #> 7 2 20 1926 1 0 #> 8 2 20 1927 1 0 #> 9 2 20 1928 1 0 #> 10 2 20 1929 1 0 #> # … with 183,712 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"all-contiguous-dyad-years","dir":"Articles","previous_headings":"Dyad-Year Data","what":"All Contiguous Dyad-Years","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years separated 400 miles water fewer, though documentation add_contiguity() cautions users least little critical contiguity data.","code":"cow_ddy %>% add_contiguity() %>% filter(conttype %in% c(1:5)) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 82,440 × 4 #> ccode1 ccode2 year conttype #> #> 1 2 20 1920 1 #> 2 2 20 1921 1 #> 3 2 20 1922 1 #> 4 2 20 1923 1 #> 5 2 20 1924 1 #> 6 2 20 1925 1 #> 7 2 20 1926 1 #> 8 2 20 1927 1 #> 9 2 20 1928 1 #> 10 2 20 1929 1 #> # … with 82,430 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"all-dyad-years-within-a-set-distance","dir":"Articles","previous_headings":"Dyad-Year Data","what":"All Dyad-Years Within a Set Distance","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"dyad-years minimum distance user-specified threshold (kilometers). function lean add_minimum_distance(), side effect truncating left bound temporal domain —right now—1886. Correlates War dyad-years 1886 2019 separated 1,000 kilometers fewer.","code":"cow_ddy %>% add_minimum_distance() %>% filter(mindist <= 1000) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 167,532 × 4 #> ccode1 ccode2 year mindist #> #> 1 2 20 1921 0 #> 2 2 20 1922 0 #> 3 2 20 1923 0 #> 4 2 20 1924 0 #> 5 2 20 1925 0 #> 6 2 20 1926 0 #> 7 2 20 1927 0 #> 8 2 20 1928 0 #> 9 2 20 1929 0 #> 10 2 20 1930 0 #> # … with 167,522 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"dyadic-dispute-year-data","dir":"Articles","previous_headings":"","what":"Dyadic Dispute-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"Dyadic dispute-year data come pre-processed peacesciencer. Another vignette show transformed true dyad-year data, also available analysis. example, (directed) dyadic dispute-year Gibler-Miller-Little (GML) MID data available gml_dirdisp. , can add information dyadic dispute-years identify contiguity relationships Correlates War major status. Users interested Correlates War MID data available use cow_mid_dirdisps. Future updates may change object names better standardization, now.","code":"gml_dirdisp %>% add_contiguity() %>% add_cow_majors() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 10,276 × 42 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2 2 200 1902 1 1 1 0 1 1 #> 2 2 200 2 1902 1 1 0 1 1 1 #> 3 3 300 345 1913 1 1 1 0 1 0 #> 4 3 345 300 1913 1 1 0 1 0 1 #> 5 4 200 339 1946 1 1 0 1 0 0 #> 6 4 339 200 1946 1 1 1 0 0 0 #> 7 7 200 651 1951 1 1 1 0 0 1 #> 8 7 200 651 1952 1 0 1 0 0 1 #> 9 7 651 200 1951 1 1 0 1 1 0 #> 10 7 651 200 1952 1 0 0 1 1 0 #> # … with 10,266 more rows, 32 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , conttype , …"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-day-data","dir":"Articles","previous_headings":"","what":"State-Day Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer comes create_statedays() function. admittedly proof concept really difficult conjure many daily data sets peace science, certainly coverage 19th century. matter, create_statedays() create data. system mry arguments (defaults) create_stateyears(). Correlates War state-days 1816 2022. Gleditsch-Ward state-days temporal domain. can conjure application user may want think daily conflict episodes within Gleditsch-Ward domain. UCDP armed conflict data precise dates , say, Correlates War MID data, making analysis possible. However, conflict data 1946 reflect peacesciencer something like . require lubridate.","code":"create_statedays() #> # A tibble: 6,203,441 × 3 #> ccode statenme date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,203,431 more rows create_statedays(system = \"gw\") #> # A tibble: 6,765,801 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,765,791 more rows create_statedays(system = \"gw\") %>% filter(year(date) >= 1946) #> # A tibble: 3,998,000 × 3 #> gwcode statename date #> #> 1 2 United States of America 1946-01-01 #> 2 2 United States of America 1946-01-02 #> 3 2 United States of America 1946-01-03 #> 4 2 United States of America 1946-01-04 #> 5 2 United States of America 1946-01-05 #> 6 2 United States of America 1946-01-06 #> 7 2 United States of America 1946-01-07 #> 8 2 United States of America 1946-01-08 #> 9 2 United States of America 1946-01-09 #> 10 2 United States of America 1946-01-10 #> # … with 3,997,990 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-month-data","dir":"Articles","previous_headings":"","what":"State-Month Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"State-months simple aggregations state-days. can accomplish extra commands create_statedays().","code":"create_statedays(system = \"gw\") %>% mutate(year = year(date), month = month(date)) %>% distinct(gwcode, statename, year, month) #> # A tibble: 222,370 × 4 #> gwcode statename year month #> #> 1 2 United States of America 1816 1 #> 2 2 United States of America 1816 2 #> 3 2 United States of America 1816 3 #> 4 2 United States of America 1816 4 #> 5 2 United States of America 1816 5 #> 6 2 United States of America 1816 6 #> 7 2 United States of America 1816 7 #> 8 2 United States of America 1816 8 #> 9 2 United States of America 1816 9 #> 10 2 United States of America 1816 10 #> # … with 222,360 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"state-quarter-data","dir":"Articles","previous_headings":"","what":"State-Quarter Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"assumption worth belaboring “quarter” look like general context, might look something like . , aggregation create_statedays().","code":"create_statedays(system = \"gw\") %>% mutate(year = year(date), month = month(date)) %>% filter(month %in% c(1, 4, 7, 10)) %>% mutate(quarter = case_when( month == 1 ~ \"Q1\", month == 4 ~ \"Q2\", month == 7 ~ \"Q3\", month == 10 ~ \"Q4\" )) %>% distinct(gwcode, statename, year, quarter) #> # A tibble: 74,079 × 4 #> gwcode statename year quarter #> #> 1 2 United States of America 1816 Q1 #> 2 2 United States of America 1816 Q2 #> 3 2 United States of America 1816 Q3 #> 4 2 United States of America 1816 Q4 #> 5 2 United States of America 1817 Q1 #> 6 2 United States of America 1817 Q2 #> 7 2 United States of America 1817 Q3 #> 8 2 United States of America 1817 Q4 #> 9 2 United States of America 1818 Q1 #> 10 2 United States of America 1818 Q2 #> # … with 74,069 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"leader-day-leader-month-leader-year-data","dir":"Articles","previous_headings":"","what":"Leader-Day (Leader-Month, Leader-Year) Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer leader-level units analysis well, can easily created modified Archigos (archigos) data peacesciencer. data version 4.1. create_leaderdays() create leader-day data archigos. want note one thing leader-level functions package. Whereas Correlates War state system membership often default system lot functions (prominently create_stateyears() create_dyadyears()), Gleditsch-Ward system default system state system around Archigos project created leader data. Moreover, leader data aren’t exactly tethered Gleditsch-Ward state system dates either (e.g. leader entries Gleditsch-Ward states aren’t system yet). case like , can standardize leader data either Correlates War system Gleditsch-Ward system standardize argument. default, option “none” (.e. return available leader days recorded Archigos data). “cow” “gw” standardizes leader data Correlates War state system membership Gleditsch-Ward state system membership, respectively. user may want think additional post-processing top , enough get started. , process creates state-months can create something like leader-months. leader-years, pre-packaged peacesciencer function. package also adds information leader gender, approximation leader’s age year (.e. year - yrborn), running count (starting 1) leader’s tenure (years).","code":"archigos #> # A tibble: 3,409 × 11 #> obsid gwcode leadid leader yrborn gender startdate enddate entry exit #> #> 1 USA-1869 2 81dcc… Grant 1822 M 1869-03-04 1877-03-04 Regu… Regu… #> 2 USA-1877 2 81dcc… Hayes 1822 M 1877-03-04 1881-03-04 Regu… Regu… #> 3 USA-188… 2 81dcf… Garfi… 1831 M 1881-03-04 1881-09-19 Regu… Irre… #> 4 USA-188… 2 81dcf… Arthur 1829 M 1881-09-19 1885-03-04 Regu… Regu… #> 5 USA-1885 2 34fb1… Cleve… 1837 M 1885-03-04 1889-03-04 Regu… Regu… #> 6 USA-1889 2 81dcf… Harri… 1833 M 1889-03-04 1893-03-04 Regu… Regu… #> 7 USA-1893 2 34fb1… Cleve… 1837 M 1893-03-04 1897-03-04 Regu… Regu… #> 8 USA-1897 2 81dcf… McKin… 1843 M 1897-03-04 1901-09-14 Regu… Irre… #> 9 USA-1901 2 81dd2… Roose… 1858 M 1901-09-14 1909-03-04 Regu… Regu… #> 10 USA-1909 2 81dd2… Taft 1857 M 1909-03-04 1913-03-04 Regu… Regu… #> # … with 3,399 more rows, and 1 more variable: exitcode create_leaderdays() #> # A tibble: 5,298,380 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,298,370 more rows create_leaderdays(standardize = \"cow\") #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, date)` #> # A tibble: 4,824,967 × 5 #> obsid ccode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 4,824,957 more rows create_leaderdays() %>% mutate(year = year(date), month = month(date)) %>% group_by(gwcode, obsid, year, month) %>% slice(1) #> # A tibble: 177,128 × 7 #> # Groups: gwcode, obsid, year, month [177,128] #> obsid gwcode leader date yrinoffice year month #> #> 1 USA-1869 2 Grant 1869-03-04 1 1869 3 #> 2 USA-1869 2 Grant 1869-04-01 1 1869 4 #> 3 USA-1869 2 Grant 1869-05-01 1 1869 5 #> 4 USA-1869 2 Grant 1869-06-01 1 1869 6 #> 5 USA-1869 2 Grant 1869-07-01 1 1869 7 #> 6 USA-1869 2 Grant 1869-08-01 1 1869 8 #> 7 USA-1869 2 Grant 1869-09-01 1 1869 9 #> 8 USA-1869 2 Grant 1869-10-01 1 1869 10 #> 9 USA-1869 2 Grant 1869-11-01 1 1869 11 #> 10 USA-1869 2 Grant 1869-12-01 1 1869 12 #> # … with 177,118 more rows create_leaderyears() #> # A tibble: 17,686 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,676 more rows"},{"path":"http://svmiller.com/articles/different-data-types.html","id":"leader-dyad-year-data","dir":"Articles","previous_headings":"","what":"Leader Dyad-Year Data","title":"Create Different Kinds of Data in `{peacesciencer}`","text":"peacesciencer can also create leader dyad-year data way create_leaderdyadyears(). can see underlying code creating data. ’s lot code, take lot time run scratch, ensuing output large store R data object package CRAN hard-caps package size 5 MB. Instead, users want data first run download_extdata() first install update package. Therein, can run create_leaderdyadyears() create full universe leader dyad-year data.","code":"# create_leaderdyadyears() is effectively doing this. # Let's do the G-W leader dyad-year data for illustration's sake. # `download_extdata()` will download these data into the package directory. # Thus, it is *not* downloading the data fresh each time. the_url <- \"http://svmiller.com/R/peacesciencer/gw_dir_leader_dyad_years.rds\" readRDS(url(the_url)) %>% declare_attributes(data_type = \"leader_dyad_year\", system = \"gw\") #> # A tibble: 2,336,990 × 11 #> year obsid1 obsid2 gwcode1 gwcode2 gender1 gender2 leade…¹ leade…² yrino…³ #> #> 1 1870 AFG-1868 AUH-1… 700 300 M M 45 40 3 #> 2 1870 AFG-1868 BAV-1… 700 245 M M 45 39 3 #> 3 1870 AFG-1868 BRA-1… 700 140 M M 45 45 3 #> 4 1870 AFG-1868 CHN-1… 700 710 M M 45 35 3 #> 5 1870 AFG-1868 COS-1… 700 94 M M 45 39 3 #> 6 1870 AFG-1868 ECU-1… 700 130 M M 45 49 3 #> 7 1870 AFG-1868 GMY-1… 700 255 M M 45 73 3 #> 8 1870 AFG-1868 GRC-1… 700 350 M M 45 25 3 #> 9 1870 AFG-1868 IRN-1… 700 630 M M 45 39 3 #> 10 1870 AFG-1868 JPN-1… 700 740 M M 45 18 3 #> # … with 2,336,980 more rows, 1 more variable: yrinoffice2 , and #> # abbreviated variable names ¹​leaderage1, ²​leaderage2, ³​yrinoffice1 # ^ compare with: # download_extdata() # create_leaderdyadyears()"},{"path":"http://svmiller.com/articles/joins.html","id":"left-outer-join","dir":"Articles","previous_headings":"","what":"Left (Outer) Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"first type join important type join function peacesciencer. Indeed, almost every function package deals adding variables type data created peacesciencer includes . “left join” (left_join() dplyr), alternatively known “outer join” “left outer join” SQL context, type “mutating join” tidyverse context. plain English, left_join() assumes two data objects—“left” object (x) “right” object (y)—returns rows left object (x) matching information right object (y) set common matching keys (columns x y). simple example works peacesciencer context. Assume simple state-year data set United States (ccode: 2), Canada (ccode: 20), United Kingdom (ccode: 200) years 2016 2020. Recreating simple kind data problem R serve “left object” (x) simple example. Let’s assume ’re building toward kind state-year analysis describe manuscript accompanying package. example, canonical civil conflict analysis Fearon Laitin (2003) outcome varies year, several independent variables time-invariant serve variables making state--state comparisons model civil war onset (e.g ethnic fractionalization, religious fractionalization, terrain ruggedness). similar manner, basic ranking United States, Canada, United Kingdom case. Minimally, United States scores “low”, Canada scores “medium”, United Kingdom scores “high” metric. variation time simple example. “right object” (y) want add “left object” serves main data frame. Notice x variable ranking information want. , however, matching observations state identifiers corresponding Correlates War state codes U.S., Canada, United Kingdom. left join (left_join()) merges y x, returning rows x matching information y based columns share common (: ccode). obviously simple example, scales well even additional complexity. example, let’s assume added simple five-year panel Australia (ccode: 900) “left object” (x). However, corresponding information Australia “right object” (y). left join produce circumstances. ranking Australia simple example, left join returns NAs (.e. missing values) Australia. original number rows x conditions unaffected. happen observation y corresponding match x? example, let’s assume y data also included ranking Denmark (ccode: 390), though Denmark appear x. happen circumstances. Notice output left join identical output . Australia x, y. Thus, rows Australia returned absence ranking information Australia y means variable NA Australia merge. Denmark y, x. left join returns rows x matching information y, absence observations Denmark x means nowhere ranking information go merge. Thus, Denmark’s ranking ignored.","code":"tibble(ccode = c(2, 20, 200)) %>% # rowwise() is a great trick for nesting sequences in tibbles # This parlor trick, for example, generates state-year data out of raw state # data in create_stateyears() rowwise() %>% # create a sequence as a nested column mutate(year = list(seq(2016, 2020))) %>% # unnest the column unnest(year) -> x x #> # A tibble: 15 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 tibble(ccode = c(2, 20, 200), ranking = c(\"low\", \"medium\", \"high\")) -> y y #> # A tibble: 3 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high # alternatively, as I tend to do it: x %>% left_join(., y) left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 15 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high tibble(ccode = 900, year = c(2016:2020)) %>% bind_rows(x, .) -> x x #> # A tibble: 20 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 #> 16 900 2016 #> 17 900 2017 #> 18 900 2018 #> 19 900 2019 #> 20 900 2020 left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 20 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high #> 16 900 2016 NA #> 17 900 2017 NA #> 18 900 2018 NA #> 19 900 2019 NA #> 20 900 2020 NA tibble(ccode = 390, ranking = \"high\") %>% bind_rows(y, .) -> y y #> # A tibble: 4 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high #> 4 390 high left_join(x, y) #> Joining with `by = join_by(ccode)` #> # A tibble: 20 × 3 #> ccode year ranking #> #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2017 high #> 13 200 2018 high #> 14 200 2019 high #> 15 200 2020 high #> 16 900 2016 NA #> 17 900 2017 NA #> 18 900 2018 NA #> 19 900 2019 NA #> 20 900 2020 NA"},{"path":"http://svmiller.com/articles/joins.html","id":"why-the-left-join-in-particular","dir":"Articles","previous_headings":"Left (Outer) Join","what":"Why the Left Join, in Particular?","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"interested user may ask ’s special kind join appears everywhere peacesciencer. One reply use left_join() part matter taste. just well vignette reference “right join”, mirror join “left join.” right join dplyr’s right_join(x,y) returns records y matching rows x common columns, though equivalency depend reversing order x y (.e. left_join(x, y) produces information right_join(y, x)). arrangement columns differ left_join() right_join() simple application even underlying information . Ultimately, tend think “left-handed” comes data management instruct students introduce data transformation R. like intuition, especially pipe-based workflow, start master data object top pipe keep “left” add information . benefit keeping units analysis (e.g. state-years simple setup) first columns user sees well. preferred approach data transformation left_join() recurs peacesciencer result. Beyond matter taste, left join everywhere peacesciencer project endeavors hard recreate appropriate universe cases interest user allow user add stuff see fit. create_stateyears() create entire universe state-years 1816 present state-year analysis. create_dyadyears() create entire universe dyad-years 1816 present dyad-year analysis. logic, implemented peacesciencer’s multiple functions, type data user wants create created . user want expand data , though user may want something like reduce full universe 1816-2020 state-years just 1946-2010. However, universe partially discarded, universe augmented expanded. mind, every function’s use left join assumes data object receives represents full universe cases interest researcher. left join just adding information , based matching information one many data sets. done carefully, left join dutiful way adding information data set without changing number rows original data set. number columns obviously expand, number rows unaffected.","code":""},{"path":"http://svmiller.com/articles/joins.html","id":"potential-problems-of-the-left-join","dir":"Articles","previous_headings":"Left (Outer) Join","what":"Potential Problems of the Left Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"“done carefully” heavy-lifting last sentence. , let explain situations left join produce problems researcher (even join supposed operational standpoint). first less problem, least implemented peacesciencer, caution. example, panel consists just U.S., Canada, United Kingdom, Australia. happen ranking Denmark, Denmark wasn’t panel (effectively, exclusively) Anglophone states. Therefore, row created Denmark. important left join create rows Denmark, first place (.e. panel Denmark x merge). case, left join behaving . Denmark panel trying match information . peacesciencer circumvents issue creating universal data (e.g. state-years, dyad-years, available leader-years) user free subset see fit. Users run one “create” functions (e.g. create_stateyears(), create_dyadyears()) top script adding information left join, implemented everywhere package, building assumption universe cases interest user represented “left object” left outer join. Basically, expect left join create new rows x situation state represented y x. . type join assumes universe cases interest researcher already appear “left object.” second situation bigger problem. Sometimes, often bouncing information denominated Correlates War states Gleditsch-Ward states, unwanted duplicate observation data frame merged primary data interest user. Let’s go back simple example x y . Everything performs nicely, though Australia (x) ranking Denmark (y) panel state-years wasn’t part original universe cases interest us. Let’s assume, however, mistakenly entered United Kingdom twice y. know data supposed simple state-level rankings. state supposed just . United Kingdom appears twice. left join y2 x, get unwelcome result. United Kingdom duplicated yearly observations. doesn’t matter duplicate ranking y2 UK . messier, sure, ranking different duplicate observation, matters duplicated. panel like , user careful effect overweighting observations duplicate. simple example like , subsetting just complete cases (.e. Australia ranking), UK 50% observations despite fact just third observations. ’s ideal researcher. peacesciencer goes beyond make sure doesn’t happen data creates. Functions aggressively tested make sure nothing duplicates, various parlor tricks (prominently group-slices) used internally cull duplicate observations. release function makes prominent use left join done assurance doesn’t create duplicate. matter, biggest peril left join researcher may want duplicate peacesciencer . Always inspect data merge, output.","code":"x #> # A tibble: 20 × 2 #> ccode year #> #> 1 2 2016 #> 2 2 2017 #> 3 2 2018 #> 4 2 2019 #> 5 2 2020 #> 6 20 2016 #> 7 20 2017 #> 8 20 2018 #> 9 20 2019 #> 10 20 2020 #> 11 200 2016 #> 12 200 2017 #> 13 200 2018 #> 14 200 2019 #> 15 200 2020 #> 16 900 2016 #> 17 900 2017 #> 18 900 2018 #> 19 900 2019 #> 20 900 2020 y #> # A tibble: 4 × 2 #> ccode ranking #> #> 1 2 low #> 2 20 medium #> 3 200 high #> 4 390 high tibble(ccode = 200, ranking = \"high\") %>% bind_rows(y, .) -> y2 left_join(x, y2) %>% data.frame #> Joining with `by = join_by(ccode)` #> Warning in left_join(x, y2): Detected an unexpected many-to-many relationship between `x` and `y`. #> ℹ Row 11 of `x` matches multiple rows in `y`. #> ℹ Row 1 of `y` matches multiple rows in `x`. #> ℹ If a many-to-many relationship is expected, set `relationship = #> \"many-to-many\"` to silence this warning. #> ccode year ranking #> 1 2 2016 low #> 2 2 2017 low #> 3 2 2018 low #> 4 2 2019 low #> 5 2 2020 low #> 6 20 2016 medium #> 7 20 2017 medium #> 8 20 2018 medium #> 9 20 2019 medium #> 10 20 2020 medium #> 11 200 2016 high #> 12 200 2016 high #> 13 200 2017 high #> 14 200 2017 high #> 15 200 2018 high #> 16 200 2018 high #> 17 200 2019 high #> 18 200 2019 high #> 19 200 2020 high #> 20 200 2020 high #> 21 900 2016 #> 22 900 2017 #> 23 900 2018 #> 24 900 2019 #> 25 900 2020 "},{"path":"http://svmiller.com/articles/joins.html","id":"semi-join","dir":"Articles","previous_headings":"","what":"Semi-Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"“semi-join” (semi_join() dplyr) returns rows left object (x) matching values right object (y). type “filtering join”, affects observations variables. appears just twice peacesciencer, serving final join create_leaderdays() create_leaderyears(). cases, serves means standardizing leader data (denominated Gleditsch-Ward system, necessarily Gleditsch-Ward system dates) Correlates War Gleditsch-Ward system. basic example semi-join context, illustration kind difficulties manifest standardizing Archigos’ leader data Correlates War state system. Assume simple state system just two states—“Lincoln” “Morrill”—two-week period start 1975 (Jan. 1, 1975 Jan. 14, 1975). simple system, “Lincoln” state full two week period (Jan. 1-Jan.14) whereas “Morrill” state just first seven days (Jan. 1-Jan. 7) , let’s say, “Lincoln” occupied “Morrill” ended statehood. also happened leader data two states. two week period, leader data suggests “Lincoln” just one continuous leader—“Archie”—whereas “Morrill” three. “Brian” leader “Morrill” retired office replaced “Cornelius.” However, deposed “Lincoln” invaded “Morrill” replaced puppet head state, “Pete.” data look like . can use basic rowwise() transformation recast data daily, resulting state-day data leader-day data. wanted standardize leader-day data state system data, semi-join leader-day data (left object) state-day object (right object), returning just leader-day data valid days state system data. Notice Pete drops data , simple example, Pete puppet head state installed Archie “Lincoln” invaded occupied “Morrill”. semi-join simply standardizing leader data state system data, effectively ’s happening semi-joins create_leaderdays() (aggregation function: create_leaderyears()).","code":"tibble(code = c(\"Lincoln\", \"Morrill\"), stdate = make_date(1975, 01, 01), enddate = c(make_date(1975, 01, 14), make_date(1975, 01, 07))) -> state_system state_system #> # A tibble: 2 × 3 #> code stdate enddate #> #> 1 Lincoln 1975-01-01 1975-01-14 #> 2 Morrill 1975-01-01 1975-01-07 tibble(code = c(\"Lincoln\", \"Morrill\", \"Morrill\", \"Morrill\"), leader = c(\"Archie\", \"Brian\", \"Cornelius\", \"Pete\"), stdate = c(make_date(1975, 01, 01), make_date(1975, 01, 01), make_date(1975, 01, 04), make_date(1975, 01, 08)), enddate = c(make_date(1975, 01, 14), make_date(1975, 01, 04), make_date(1975, 01, 08), make_date(1975, 01, 14))) -> leaders leaders #> # A tibble: 4 × 4 #> code leader stdate enddate #> #> 1 Lincoln Archie 1975-01-01 1975-01-14 #> 2 Morrill Brian 1975-01-01 1975-01-04 #> 3 Morrill Cornelius 1975-01-04 1975-01-08 #> 4 Morrill Pete 1975-01-08 1975-01-14 state_system %>% rowwise() %>% mutate(date = list(seq(stdate, enddate, by = '1 day'))) %>% unnest(date) %>% select(code, date) -> state_days state_days %>% data.frame #> code date #> 1 Lincoln 1975-01-01 #> 2 Lincoln 1975-01-02 #> 3 Lincoln 1975-01-03 #> 4 Lincoln 1975-01-04 #> 5 Lincoln 1975-01-05 #> 6 Lincoln 1975-01-06 #> 7 Lincoln 1975-01-07 #> 8 Lincoln 1975-01-08 #> 9 Lincoln 1975-01-09 #> 10 Lincoln 1975-01-10 #> 11 Lincoln 1975-01-11 #> 12 Lincoln 1975-01-12 #> 13 Lincoln 1975-01-13 #> 14 Lincoln 1975-01-14 #> 15 Morrill 1975-01-01 #> 16 Morrill 1975-01-02 #> 17 Morrill 1975-01-03 #> 18 Morrill 1975-01-04 #> 19 Morrill 1975-01-05 #> 20 Morrill 1975-01-06 #> 21 Morrill 1975-01-07 leaders %>% rowwise() %>% mutate(date = list(seq(stdate, enddate, by = '1 day'))) %>% unnest(date) %>% select(code, leader, date) -> leader_days leader_days %>% data.frame #> code leader date #> 1 Lincoln Archie 1975-01-01 #> 2 Lincoln Archie 1975-01-02 #> 3 Lincoln Archie 1975-01-03 #> 4 Lincoln Archie 1975-01-04 #> 5 Lincoln Archie 1975-01-05 #> 6 Lincoln Archie 1975-01-06 #> 7 Lincoln Archie 1975-01-07 #> 8 Lincoln Archie 1975-01-08 #> 9 Lincoln Archie 1975-01-09 #> 10 Lincoln Archie 1975-01-10 #> 11 Lincoln Archie 1975-01-11 #> 12 Lincoln Archie 1975-01-12 #> 13 Lincoln Archie 1975-01-13 #> 14 Lincoln Archie 1975-01-14 #> 15 Morrill Brian 1975-01-01 #> 16 Morrill Brian 1975-01-02 #> 17 Morrill Brian 1975-01-03 #> 18 Morrill Brian 1975-01-04 #> 19 Morrill Cornelius 1975-01-04 #> 20 Morrill Cornelius 1975-01-05 #> 21 Morrill Cornelius 1975-01-06 #> 22 Morrill Cornelius 1975-01-07 #> 23 Morrill Cornelius 1975-01-08 #> 24 Morrill Pete 1975-01-08 #> 25 Morrill Pete 1975-01-09 #> 26 Morrill Pete 1975-01-10 #> 27 Morrill Pete 1975-01-11 #> 28 Morrill Pete 1975-01-12 #> 29 Morrill Pete 1975-01-13 #> 30 Morrill Pete 1975-01-14 leader_days %>% semi_join(., state_days) %>% data.frame #> Joining with `by = join_by(code, date)` #> code leader date #> 1 Lincoln Archie 1975-01-01 #> 2 Lincoln Archie 1975-01-02 #> 3 Lincoln Archie 1975-01-03 #> 4 Lincoln Archie 1975-01-04 #> 5 Lincoln Archie 1975-01-05 #> 6 Lincoln Archie 1975-01-06 #> 7 Lincoln Archie 1975-01-07 #> 8 Lincoln Archie 1975-01-08 #> 9 Lincoln Archie 1975-01-09 #> 10 Lincoln Archie 1975-01-10 #> 11 Lincoln Archie 1975-01-11 #> 12 Lincoln Archie 1975-01-12 #> 13 Lincoln Archie 1975-01-13 #> 14 Lincoln Archie 1975-01-14 #> 15 Morrill Brian 1975-01-01 #> 16 Morrill Brian 1975-01-02 #> 17 Morrill Brian 1975-01-03 #> 18 Morrill Brian 1975-01-04 #> 19 Morrill Cornelius 1975-01-04 #> 20 Morrill Cornelius 1975-01-05 #> 21 Morrill Cornelius 1975-01-06 #> 22 Morrill Cornelius 1975-01-07"},{"path":"http://svmiller.com/articles/joins.html","id":"anti-join","dir":"Articles","previous_headings":"","what":"Anti-Join","title":"A Discussion of Various Joins in `{peacesciencer}`","text":"anti-join another type filtering join, returning rows left object (x) without match right object (y). type join appears just peacesciencer. Prominently, peacesciencer prepares presents two data sets package—false_cow_dyads false_gw_dyads—represent directed dyad-years Correlates War Gleditsch-Ward systems active year, never time year. dyads context. created two scripts , year respective state system data, creates every possible daily dyadic pairing truncates dyads just least one day overlap. computationally demanding procedure compared peacesciencer (creates every possible dyadic pair given year, given state system data supplied ). However, creates possibility false dyads given year showed overlap. Consider case Suriname (115) Republic Vietnam (817) 1975 illustrative . Notice Suriname Republic Vietnam active 1975. Suriname appears Nov. 25, 1975 whereas Republic Vietnam exits April 30, 1975. However, daily overlap two exist point day 1975. false dyads. anti_join() used create_dyadyears() function remove observations presenting user. simple example anti-join examples mind.","code":"false_cow_dyads #> # A tibble: 60 × 4 #> ccode1 ccode2 year in_ps #> #> 1 115 817 1975 1 #> 2 210 255 1945 1 #> 3 211 255 1945 1 #> 4 223 678 1990 1 #> 5 223 680 1990 1 #> 6 255 210 1945 1 #> 7 255 211 1945 1 #> 8 255 260 1990 1 #> 9 255 265 1990 1 #> 10 255 290 1945 1 #> # … with 50 more rows false_gw_dyads #> # A tibble: 38 × 4 #> gwcode1 gwcode2 year in_ps #> #> 1 99 100 1830 1 #> 2 99 211 1830 1 #> 3 100 99 1830 1 #> 4 100 615 1830 1 #> 5 115 817 1975 1 #> 6 211 99 1830 1 #> 7 211 615 1830 1 #> 8 255 850 1945 1 #> 9 300 305 1918 1 #> 10 300 345 1918 1 #> # … with 28 more rows check_both <- function(x) { gw_states %>% mutate(data = \"G-W\") %>% filter(gwcode %in% x) -> gwrows cow_states %>% mutate(startdate = ymd(paste0(styear,\"/\",stmonth, \"/\", stday)), enddate = ymd(paste0(endyear,\"/\",endmonth,\"/\",endday))) %>% select(stateabb:statenme, startdate, enddate) %>% mutate(data = \"CoW\") %>% rename(statename = statenme) %>% filter(ccode %in% x) -> cowrows dat <- bind_rows(gwrows, cowrows) %>% select(gwcode, ccode, stateabb, everything()) return(dat) } check_both(c(115, 817)) #> # A tibble: 4 × 7 #> gwcode ccode stateabb statename startdate enddate data #> #> 1 115 NA SUR Surinam 1975-11-25 2017-12-31 G-W #> 2 817 NA RVN Vietnam, Republic of 1954-05-01 1975-04-30 G-W #> 3 NA 115 SUR Suriname 1975-11-25 2016-12-31 CoW #> 4 NA 817 RVN Republic of Vietnam 1954-06-04 1975-04-30 CoW valid_dyads <- tibble(ccode1 = c(2, 20, 200), ccode2 = c(20, 200, 900), year = c(2016, 2017, 2018)) valid_dyads %>% bind_rows(., false_cow_dyads %>% select(ccode1:year)) -> valid_and_invalid valid_and_invalid #> # A tibble: 63 × 3 #> ccode1 ccode2 year #> #> 1 2 20 2016 #> 2 20 200 2017 #> 3 200 900 2018 #> 4 115 817 1975 #> 5 210 255 1945 #> 6 211 255 1945 #> 7 223 678 1990 #> 8 223 680 1990 #> 9 255 210 1945 #> 10 255 211 1945 #> # … with 53 more rows valid_and_invalid %>% # remove those invalid dyads-years anti_join(., false_cow_dyads) #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 3 × 3 #> ccode1 ccode2 year #> #> 1 2 20 2016 #> 2 20 200 2017 #> 3 200 900 2018"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"create-a-new-state-variable","dir":"Articles","previous_headings":"","what":"Create a “New State” Variable","title":"Various Parlor Tricks in `{peacesciencer}`","text":"manuscript includes partial replication state-year civil conflict analysis analogous Fearon Laitin (2003) Gibler Miller (2014). analyses include “new state” variable, arguing states within first two years existence likely experience civil war onset. partial replication include . easiest way create variable group_by() mutate based row number group, group_by() unfortunate side effect erasing attributes data (.e. ps_system ps_type attributes). break peacesciencer pipe. want variable, recommend creating merging variable creating bulk data. ’s ’d .","code":"# Hypothetical main data create_stateyears(system = 'gw') %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd(type = \"intrastate\") %>% add_peace_years() -> Data #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(gwcode, year)` # Add in new state variable after the fact create_stateyears(system = 'gw') %>% group_by(gwcode) %>% mutate(newstate = ifelse(row_number() <= 2, 1, 0)) %>% left_join(Data, .) %>% select(gwcode:ucdponset, newstate, everything()) -> Data #> Joining with `by = join_by(gwcode, statename, year)` # Proof of concept: Here's India Data %>% filter(gwcode == 750) #> # A tibble: 73 × 9 #> gwcode statename year ucdpongoing ucdponset newstate maxin…¹ confl…² ucdps…³ #> #> 1 750 India 1947 0 0 1 NA NA 0 #> 2 750 India 1948 1 1 1 2 227 1 #> 3 750 India 1949 1 0 0 2 227 0 #> 4 750 India 1950 1 0 0 2 227 0 #> 5 750 India 1951 1 0 0 2 227 0 #> 6 750 India 1952 0 0 0 NA NA 0 #> 7 750 India 1953 0 0 0 NA NA 1 #> 8 750 India 1954 0 0 0 NA NA 2 #> 9 750 India 1955 0 0 0 NA NA 3 #> 10 750 India 1956 1 1 0 1 251 4 #> # … with 63 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids, ³​ucdpspell # And here's Belize Data %>% filter(gwcode == 80) #> # A tibble: 39 × 9 #> gwcode statename year ucdpongoing ucdponset newstate maxin…¹ confl…² ucdps…³ #> #> 1 80 Belize 1981 0 0 1 NA NA 0 #> 2 80 Belize 1982 0 0 1 NA NA 1 #> 3 80 Belize 1983 0 0 0 NA NA 2 #> 4 80 Belize 1984 0 0 0 NA NA 3 #> 5 80 Belize 1985 0 0 0 NA NA 4 #> 6 80 Belize 1986 0 0 0 NA NA 5 #> 7 80 Belize 1987 0 0 0 NA NA 6 #> 8 80 Belize 1988 0 0 0 NA NA 7 #> 9 80 Belize 1989 0 0 0 NA NA 8 #> 10 80 Belize 1990 0 0 0 NA NA 9 #> # … with 29 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids, ³​ucdpspell"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"code-capabilitiesdevelopmentmilitarization-as-bremer-1992-did","dir":"Articles","previous_headings":"","what":"Code Capabilities/Development/Militarization as Bremer (1992) Did","title":"Various Parlor Tricks in `{peacesciencer}`","text":"manuscript includes replication Bremer’s (1992) “dangerous dyads” design, albeit one leverages newer/better data sources unavailable Bremer time. convenience’s sake, replication used approaches estimating Bremer’s variables, including “weak-link” mechanisms Dixon (1994) introduced seminal work democratic conflict resolution. user wanted recreate covariates Bremer (1992) , . covariates question concern information grabbed Correlates War national material capabilities data set.1 example, user guide recreates “relative power” variable proportion lower composite index national capabilities (CINC) variable higher one. Bremer opts different approach, defining “relative power” variable three-part ordinal category powerful side CINC score 1) 10 times higher less powerful side, 2) three times higher side, 3) less three times higher side. exact passage p. 322. Based CINC scores, computed larger--smaller capability ratios dyad-years classified three groups. capability ratio less equal three, dyad considered constitute case small power difference. ratio larger 10, power difference coded large, whereas ratio 3 10 coded medium power difference. either CINC scores missing (equal zero) ratio calculation, power difference score dyad coded missing also. easy case_when() function, also ’ve consumed space words manuscript allocated journal space allow. ’s added difficulty making sure identify side non-directed dyad-year powerful. Next, manuscript codes Bremer’s (1992) development/“advanced economies” measure using weak-link lower GDP per capita dyad using simulations Anders et al. (2020). defense, exactly kind data Bremer wishes available . says footnote 26 page 324. optimistic assumptions data availability, estimate number dyad-years relevant data [GNP GDP per capita] assembled less 20% total dyad-years consideration. realistic estimate might low 10%. Clearly, ability test generalization 80% 90% needed data missing limited, especially case, missing data concentrated heavily pre-World War II era less advanced states. Given limitation, Bremer uses approach coding development/“advanced economies” measure. economically advanced state characterized possessing share system-wide economic capability greater share system-wide demographic capability. Hence, years found true, classified state advanced; otherwise, less advanced. next step involved examining pair states year assigning one three groups: advanced (7,160 dyad-years), one advanced (61,823 dyad-years), less advanced (128,939 dyad-years). Replicating approach going require group-summaries raw national material capabilities data, outside peacesciencer’s core functionality. Bremer’s wording little vague; doesn’t explain variable, variables, comprise “economic capability” “demographic capability.” Let’s assume “demographic capability” just total population variable whereas “economic capability” variables include iron steel production primary energy consumption. variable look something like . Now, let’s merge Bremer data frame created. ’ll make ordinal variable well 2, 1, 0 ordering scheme. Finally, manuscript creates militarization measure weak-link uses data military personnel total population. Bremer opts approach similar development indicator uses. Instead, relied material capabilities data set discussed , classified state militarized share system-wide military capabilities greater share system-wide demographic capabilities. classified less militarized true. classification dyad-year based whether , one, neither two states making dyad militarized year. reads like ’s , reiterating ’m assuming ’s using just total population variable measure “demographic capability.” Let’s merge Bremer data created inspect output. wanted perfectly recreate data Bremer (1992) almost 30 years ago, ’s ’d peacesciencer (albeit newer data). Still, think data innovations followed Bremer (1992) merit approach employed manuscript.","code":"cow_ddy %>% # built-in data set for convenience filter(ccode2 > ccode1) %>% # make it non-directed # add CINC scores add_nmc() %>% # select just what we want select(ccode1:year, cinc1, cinc2) -> Bremer Bremer %>% # create a three-item ordinal relative power category with values 2, 1, and 0 mutate(relpow = case_when( (cinc1 > cinc2) & (cinc1 > 10*cinc2) ~ 2, (cinc1 > cinc2) & ((cinc1 > 3*cinc2) & (cinc1 < 10*cinc2)) ~ 1, (cinc1 > cinc2) & (cinc1 <= 3*cinc2) ~ 0, # copy-paste, re-arrange (cinc2 > cinc1) & (cinc2 > 10*cinc1) ~ 2, (cinc2 > cinc1) & ((cinc2 > 3*cinc1) & (cinc2 < 10*cinc1))~ 1, (cinc2 > cinc1) & (cinc2 <= 3*cinc1) ~ 0, TRUE ~ NA_real_ )) -> relpow_example # Let's inspect the output. relpow_example %>% na.omit %>% mutate(whichside = ifelse(cinc1 > cinc2, \"ccode1 > ccode2\", \"ccode2 >= ccode1\")) %>% group_split(whichside, relpow) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> cinc1 : double #> cinc2 : double #> relpow : double #> whichside: character #> > #> >[6]> #> [[1]] #> # A tibble: 132,639 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1892 0.173 0.173 0 ccode1 > ccode2 #> 2 2 200 1897 0.169 0.166 0 ccode1 > ccode2 #> 3 2 200 1898 0.197 0.157 0 ccode1 > ccode2 #> 4 2 200 1899 0.185 0.169 0 ccode1 > ccode2 #> 5 2 200 1900 0.188 0.178 0 ccode1 > ccode2 #> 6 2 200 1901 0.203 0.174 0 ccode1 > ccode2 #> 7 2 200 1902 0.208 0.161 0 ccode1 > ccode2 #> 8 2 200 1903 0.210 0.143 0 ccode1 > ccode2 #> 9 2 200 1904 0.205 0.135 0 ccode1 > ccode2 #> 10 2 200 1905 0.214 0.121 0 ccode1 > ccode2 #> # … with 132,629 more rows #> #> [[2]] #> # A tibble: 114,225 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 70 1831 0.0420 0.00945 1 ccode1 > ccode2 #> 2 2 70 1832 0.0445 0.00963 1 ccode1 > ccode2 #> 3 2 70 1833 0.0481 0.00958 1 ccode1 > ccode2 #> 4 2 70 1834 0.0478 0.00971 1 ccode1 > ccode2 #> 5 2 70 1835 0.0485 0.00980 1 ccode1 > ccode2 #> 6 2 70 1836 0.0510 0.00941 1 ccode1 > ccode2 #> 7 2 70 1837 0.0535 0.00975 1 ccode1 > ccode2 #> 8 2 70 1838 0.0533 0.00966 1 ccode1 > ccode2 #> 9 2 70 1839 0.0508 0.00948 1 ccode1 > ccode2 #> 10 2 70 1840 0.0495 0.00898 1 ccode1 > ccode2 #> # … with 114,215 more rows #> #> [[3]] #> # A tibble: 198,867 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 20 1920 0.290 0.0101 2 ccode1 > ccode2 #> 2 2 20 1921 0.253 0.0105 2 ccode1 > ccode2 #> 3 2 20 1922 0.256 0.00841 2 ccode1 > ccode2 #> 4 2 20 1923 0.272 0.00986 2 ccode1 > ccode2 #> 5 2 20 1924 0.254 0.00889 2 ccode1 > ccode2 #> 6 2 20 1925 0.254 0.00870 2 ccode1 > ccode2 #> 7 2 20 1926 0.263 0.00924 2 ccode1 > ccode2 #> 8 2 20 1927 0.239 0.00937 2 ccode1 > ccode2 #> 9 2 20 1928 0.240 0.00970 2 ccode1 > ccode2 #> 10 2 20 1929 0.240 0.00980 2 ccode1 > ccode2 #> # … with 198,857 more rows #> #> [[4]] #> # A tibble: 141,100 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1861 0.144 0.258 0 ccode2 >= ccode1 #> 2 2 200 1862 0.176 0.251 0 ccode2 >= ccode1 #> 3 2 200 1863 0.179 0.251 0 ccode2 >= ccode1 #> 4 2 200 1864 0.193 0.243 0 ccode2 >= ccode1 #> 5 2 200 1865 0.135 0.256 0 ccode2 >= ccode1 #> 6 2 200 1866 0.0982 0.248 0 ccode2 >= ccode1 #> 7 2 200 1867 0.114 0.253 0 ccode2 >= ccode1 #> 8 2 200 1868 0.107 0.253 0 ccode2 >= ccode1 #> 9 2 200 1869 0.108 0.246 0 ccode2 >= ccode1 #> 10 2 200 1870 0.0990 0.242 0 ccode2 >= ccode1 #> # … with 141,090 more rows #> #> [[5]] #> # A tibble: 133,564 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 2 200 1816 0.0397 0.337 1 ccode2 >= ccode1 #> 2 2 200 1817 0.0358 0.328 1 ccode2 >= ccode1 #> 3 2 200 1818 0.0361 0.329 1 ccode2 >= ccode1 #> 4 2 200 1819 0.0371 0.317 1 ccode2 >= ccode1 #> 5 2 200 1820 0.0371 0.317 1 ccode2 >= ccode1 #> 6 2 200 1821 0.0342 0.317 1 ccode2 >= ccode1 #> 7 2 200 1822 0.0329 0.311 1 ccode2 >= ccode1 #> 8 2 200 1823 0.0331 0.318 1 ccode2 >= ccode1 #> 9 2 200 1824 0.0330 0.330 1 ccode2 >= ccode1 #> 10 2 200 1825 0.0342 0.331 1 ccode2 >= ccode1 #> # … with 133,554 more rows #> #> [[6]] #> # A tibble: 235,749 × 7 #> ccode1 ccode2 year cinc1 cinc2 relpow whichside #> #> 1 20 200 1920 0.0101 0.128 2 ccode2 >= ccode1 #> 2 20 200 1922 0.00841 0.0945 2 ccode2 >= ccode1 #> 3 20 200 1923 0.00986 0.0990 2 ccode2 >= ccode1 #> 4 20 200 1924 0.00889 0.107 2 ccode2 >= ccode1 #> 5 20 200 1925 0.00870 0.0956 2 ccode2 >= ccode1 #> 6 20 200 1939 0.00909 0.0997 2 ccode2 >= ccode1 #> 7 20 255 1934 0.00891 0.0891 2 ccode2 >= ccode1 #> 8 20 255 1935 0.00874 0.103 2 ccode2 >= ccode1 #> 9 20 255 1936 0.00865 0.115 2 ccode2 >= ccode1 #> 10 20 255 1937 0.00893 0.118 2 ccode2 >= ccode1 #> # … with 235,739 more rows cow_nmc %>% group_by(year) %>% # calculate year proportions mutate(prop_tpop = tpop/sum(tpop, na.rm=T), prop_irst = irst/sum(irst, na.rm=T), prop_pec = pec/sum(pec, na.rm=T)) %>% ungroup() %>% # standardize an \"economic capability\" measure # then make an advanced dummy mutate(econcap = (prop_irst + prop_pec)/2, advanced = ifelse(econcap > prop_tpop, 1, 0)) %>% select(ccode, year, prop_tpop:ncol(.)) -> Advanced Advanced #> # A tibble: 15,951 × 7 #> ccode year prop_tpop prop_irst prop_pec econcap advanced #> #> 1 2 1816 0.0398 0.0954 0.00966 0.0525 1 #> 2 2 1817 0.0404 0.0938 0.0103 0.0520 1 #> 3 2 1818 0.0411 0.102 0.0110 0.0564 1 #> 4 2 1819 0.0416 0.101 0.0104 0.0555 1 #> 5 2 1820 0.0422 0.113 0.0105 0.0617 1 #> 6 2 1821 0.0430 0.0927 0.0108 0.0518 1 #> 7 2 1822 0.0431 0.0950 0.0109 0.0530 1 #> 8 2 1823 0.0439 0.0933 0.0111 0.0522 1 #> 9 2 1824 0.0447 0.0861 0.0122 0.0491 1 #> 10 2 1825 0.0453 0.0891 0.0129 0.0510 1 #> # … with 15,941 more rows Bremer %>% left_join(., Advanced %>% select(ccode, year, advanced) %>% rename(ccode1 = ccode, advanced1 = advanced)) %>% left_join(., Advanced %>% select(ccode, year, advanced) %>% rename(ccode2 = ccode, advanced2 = advanced)) %>% mutate(advancedcat = case_when( advanced1 == 1 & advanced2 == 1 ~ 2, (advanced1 == 1 & advanced2 == 0) | (advanced1 == 0 & advanced2 == 1) ~ 1, advanced1 == 0 & advanced2 == 0 ~ 0 )) -> Bremer #> Joining with `by = join_by(ccode1, year)` #> Joining with `by = join_by(ccode2, year)` # Let's inspect the output Bremer %>% na.omit %>% group_split(advancedcat) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> cinc1 : double #> cinc2 : double #> advanced1 : double #> advanced2 : double #> advancedcat: double #> > #> >[3]> #> [[1]] #> # A tibble: 538,707 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 31 40 1986 0.0000349 0.00326 0 0 0 #> 2 31 40 1987 0.0000349 0.00328 0 0 0 #> 3 31 40 1988 0.0000460 0.00334 0 0 0 #> 4 31 40 1989 0.0000584 0.00335 0 0 0 #> 5 31 40 1990 0.0000511 0.00325 0 0 0 #> 6 31 40 1991 0.0000432 0.00330 0 0 0 #> 7 31 40 1992 0.0000444 0.00271 0 0 0 #> 8 31 40 1993 0.0000479 0.00265 0 0 0 #> 9 31 40 1994 0.0000365 0.00198 0 0 0 #> 10 31 40 1995 0.0000355 0.00161 0 0 0 #> # … with 538,697 more rows #> #> [[2]] #> # A tibble: 344,483 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 2 31 1986 0.135 0.0000349 1 0 1 #> 2 2 31 1987 0.134 0.0000349 1 0 1 #> 3 2 31 1988 0.134 0.0000460 1 0 1 #> 4 2 31 1989 0.148 0.0000584 1 0 1 #> 5 2 31 1990 0.141 0.0000511 1 0 1 #> 6 2 31 1991 0.137 0.0000432 1 0 1 #> 7 2 31 1992 0.148 0.0000444 1 0 1 #> 8 2 31 1993 0.153 0.0000479 1 0 1 #> 9 2 31 1994 0.146 0.0000365 1 0 1 #> 10 2 31 1995 0.140 0.0000355 1 0 1 #> # … with 344,473 more rows #> #> [[3]] #> # A tibble: 54,945 × 8 #> ccode1 ccode2 year cinc1 cinc2 advanced1 advanced2 advancedcat #> #> 1 2 20 1920 0.290 0.0101 1 1 2 #> 2 2 20 1921 0.253 0.0105 1 1 2 #> 3 2 20 1922 0.256 0.00841 1 1 2 #> 4 2 20 1923 0.272 0.00986 1 1 2 #> 5 2 20 1924 0.254 0.00889 1 1 2 #> 6 2 20 1925 0.254 0.00870 1 1 2 #> 7 2 20 1926 0.263 0.00924 1 1 2 #> 8 2 20 1927 0.239 0.00937 1 1 2 #> 9 2 20 1928 0.240 0.00970 1 1 2 #> 10 2 20 1929 0.240 0.00980 1 1 2 #> # … with 54,935 more rows cow_nmc %>% group_by(year) %>% # calculate year proportions mutate(prop_tpop = tpop/sum(tpop, na.rm=T), prop_milex = milex/sum(milex, na.rm=T), prop_milper = milper/sum(milper, na.rm=T)) %>% ungroup() %>% # standardize a \"military capability\" measure # then make an advanced dummy mutate(militcap = (prop_milper + prop_milex)/2, militarized = ifelse(militcap > prop_tpop, 1, 0)) %>% select(ccode, year, prop_tpop:ncol(.)) -> Militarized Militarized #> # A tibble: 15,951 × 7 #> ccode year prop_tpop prop_milex prop_milper militcap militarized #> #> 1 2 1816 0.0398 0.0682 0.00859 0.0384 0 #> 2 2 1817 0.0404 0.0451 0.00827 0.0267 0 #> 3 2 1818 0.0411 0.0370 0.00832 0.0227 0 #> 4 2 1819 0.0416 0.0449 0.00709 0.0260 0 #> 5 2 1820 0.0422 0.0310 0.00733 0.0192 0 #> 6 2 1821 0.0430 0.0345 0.00486 0.0197 0 #> 7 2 1822 0.0431 0.0249 0.00417 0.0146 0 #> 8 2 1823 0.0439 0.0249 0.00534 0.0151 0 #> 9 2 1824 0.0447 0.0295 0.00474 0.0171 0 #> 10 2 1825 0.0453 0.0321 0.00511 0.0186 0 #> # … with 15,941 more rows Bremer %>% left_join(., Militarized %>% select(ccode, year, militarized) %>% rename(ccode1 = ccode, militarized1 = militarized)) %>% left_join(., Militarized %>% select(ccode, year, militarized) %>% rename(ccode2 = ccode, militarized2 = militarized)) %>% mutate(militcat = case_when( militarized1 == 1 & militarized2 == 1 ~ 2, (militarized1 == 1 & militarized2 == 0) | (advanced1 == 0 & militarized2 == 1) ~ 1, militarized1 == 0 & militarized2 == 0 ~ 0 )) -> Bremer #> Joining with `by = join_by(ccode1, year)` #> Joining with `by = join_by(ccode2, year)` Bremer %>% select(ccode1:year, militarized1:ncol(.)) %>% na.omit %>% group_split(militcat) #> tbl_df< #> ccode1 : double #> ccode2 : double #> year : double #> militarized1: double #> militarized2: double #> militcat : double #> > #> >[3]> #> [[1]] #> # A tibble: 303,368 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1923 0 0 0 #> 2 2 20 1925 0 0 0 #> 3 2 20 1926 0 0 0 #> 4 2 20 1927 0 0 0 #> 5 2 20 1928 0 0 0 #> 6 2 20 1929 0 0 0 #> 7 2 20 1930 0 0 0 #> 8 2 20 1931 0 0 0 #> 9 2 20 1932 0 0 0 #> 10 2 20 1933 0 0 0 #> # … with 303,358 more rows #> #> [[2]] #> # A tibble: 340,196 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1920 1 0 1 #> 2 2 20 1921 1 0 1 #> 3 2 20 1922 1 0 1 #> 4 2 20 1924 1 0 1 #> 5 2 20 1947 1 0 1 #> 6 2 20 1948 1 0 1 #> 7 2 20 1949 1 0 1 #> 8 2 20 1950 1 0 1 #> 9 2 20 1971 1 0 1 #> 10 2 20 1973 1 0 1 #> # … with 340,186 more rows #> #> [[3]] #> # A tibble: 112,758 × 6 #> ccode1 ccode2 year militarized1 militarized2 militcat #> #> 1 2 20 1942 1 1 2 #> 2 2 20 1943 1 1 2 #> 3 2 20 1944 1 1 2 #> 4 2 20 1945 1 1 2 #> 5 2 20 1946 1 1 2 #> 6 2 20 1951 1 1 2 #> 7 2 20 1952 1 1 2 #> 8 2 20 1953 1 1 2 #> 9 2 20 1954 1 1 2 #> 10 2 20 1955 1 1 2 #> # … with 112,748 more rows"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"get-multiple-peace-years-in-one-fell-swoop","dir":"Articles","previous_headings":"","what":"Get Multiple Peace Years in One Fell Swoop","title":"Various Parlor Tricks in `{peacesciencer}`","text":"add_peace_years() designed work generally, based data/functions included package. example, assume wanted dyad-year analysis comparing Correlates War (CoW) Militarized Interstate Dispute (MID) Gibler-Miller-Little conflict data. Just add pipe ask peace-years. can state-year data well. example, can compare CoW UCDP code civil wars differently since 1946. note, however, nature different state systems used data sets means ’ll treat one master merge codes .","code":"cow_ddy %>% # non-directed, politically relevant, for convenience filter(ccode2 > ccode1) %>% filter_prd() %>% add_cow_mids(keep = NULL) %>% add_gml_mids(keep = NULL) %>% add_peace_years() -> NDY #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles #> dispute-year data into dyad-year data by first selecting on unique onsets. #> Thereafter, where duplicates remain, it whittles dispute-year data into #> dyad-year data in the following order: 1) retaining highest `fatality`, 2) #> retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) #> retaining highest estimated `maxdur`, 5) retaining reciprocated over #> non-reciprocated observations, 6) retaining the observation with the lowest #> start month, and, where duplicates still remained (and they don't), 7) forcibly #> dropping all duplicates for observations that are otherwise very similar. See: #> http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Dyadic data are non-directed and initiation variables make no sense in this #> context. #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles #> dispute-year data into dyad-year data by first selecting on unique onsets. #> Thereafter, where duplicates remain, it whittles dispute-year data into #> dyad-year data in the following order: 1) retaining highest `fatality`, 2) #> retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) #> retaining highest estimated `maxdur`, 5) retaining reciprocated over #> non-reciprocated observations, 6) retaining the observation with the lowest #> start month, and, where duplicates still remained (and they don't), 7) forcibly #> dropping all duplicates for observations that are otherwise very similar. See: #> http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(year, dyad)` #> Joining with `by = join_by(year, dyad)` # Here's a snapshot of U.S-Cuba from 1980-89 for illustration sake. NDY %>% filter(ccode1 == 2 & ccode2 == 40) %>% select(ccode1:year, cowmidongoing, gmlmidongoing, cowmidspell:gmlmidspell) %>% filter(year >= 1980) #> # A tibble: 37 × 7 #> ccode1 ccode2 year cowmidongoing gmlmidongoing cowmidspell gmlmidspell #> #> 1 2 40 1980 0 0 0 0 #> 2 2 40 1981 1 1 1 1 #> 3 2 40 1982 0 0 0 0 #> 4 2 40 1983 1 1 1 1 #> 5 2 40 1984 0 0 0 0 #> 6 2 40 1985 0 0 1 1 #> 7 2 40 1986 0 1 2 2 #> 8 2 40 1987 1 1 3 0 #> 9 2 40 1988 0 0 0 0 #> 10 2 40 1989 0 0 1 1 #> # … with 27 more rows create_stateyears(system = 'gw') %>% filter(between(year, 1946, 2019)) %>% add_ccode_to_gw() %>% add_ucdp_acd(type = \"intrastate\", only_wars = TRUE) %>% add_cow_wars(type = \"intra\") %>% # select just a few things select(gwcode, ccode, year, statename, ucdpongoing, ucdponset, cowintraongoing, cowintraonset) %>% add_peace_years() %>% select(gwcode:statename, ucdpspell, cowintraspell, everything()) %>% # India is illustrative of how the two differ. # UCDP has an intra-state conflict to the level of war early # into its existence. CoW does not. filter(gwcode == 750) #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(year, ccode)` #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, year)` #> # A tibble: 73 × 10 #> gwcode ccode year statename ucdpsp…¹ cowin…² ucdpo…³ ucdpo…⁴ cowin…⁵ cowin…⁶ #> #> 1 750 750 1947 India 0 0 0 0 0 0 #> 2 750 750 1948 India 1 1 1 1 0 0 #> 3 750 750 1949 India 0 2 1 0 0 0 #> 4 750 750 1950 India 0 3 1 0 0 0 #> 5 750 750 1951 India 0 4 1 0 0 0 #> 6 750 750 1952 India 0 5 0 0 0 0 #> 7 750 750 1953 India 1 6 0 0 0 0 #> 8 750 750 1954 India 2 7 0 0 0 0 #> 9 750 750 1955 India 3 8 0 0 0 0 #> 10 750 750 1956 India 4 9 0 0 0 0 #> # … with 63 more rows, and abbreviated variable names ¹​ucdpspell, #> # ²​cowintraspell, ³​ucdpongoing, ⁴​ucdponset, ⁵​cowintraongoing, ⁶​cowintraonset"},{"path":"http://svmiller.com/articles/parlor-tricks.html","id":"measure-leader-tenure-in-days","dir":"Articles","previous_headings":"","what":"Measure Leader Tenure in Days","title":"Various Parlor Tricks in `{peacesciencer}`","text":"create_leaderyears(), default, returns estimate leader-tenure unique calendar year leader. think reasonable thing include, benchmarking years internal lifting elsewhere function generates leader-year data leader-day data Archigos. However, can lead peculiar observations may square knee-jerk think leader tenure. illustrate mean case Jimmy Carter leader-year data standardized Correlates War state system membership. Jimmy Carter took office January 1977 (year 1) tenure 1978 (year 2), 1979 (year 3), 1980 (year 4), exited office January 1981 (year 5). know presidents American context four-year terms. output suggests five years. problematic research design, especially one may interested happens leader behavior certain amount time office, user can something like generate estimates leader tenure given year day. Basically, core leader-year generated, user can use create_leaderdays() function summarize leader tenure year minimum number days leader office year maximum number days leader office year. ’s look like case Jimmy Carter. measure might useful. Basically, Jimmy Carter new leader 1977 (min_daysoffice = 1). 1978, almost year belt (.e. Jan. 1, 1978 347th day office). time left office 1981, completed 1,462 days job. create_leaderyears() elects create information user. matter, take much effort user create kind information wanted.","code":"leader_years <- create_leaderyears(standardize = 'cow') #> Joining with `by = join_by(gwcode, year)` #> Joining with `by = join_by(ccode, date)` leader_years %>% filter(obsid == \"USA-1977\") #> # A tibble: 5 × 7 #> obsid leader ccode gender leaderage year yrinoffice #> #> 1 USA-1977 Carter 2 M 53 1977 1 #> 2 USA-1977 Carter 2 M 54 1978 2 #> 3 USA-1977 Carter 2 M 55 1979 3 #> 4 USA-1977 Carter 2 M 56 1980 4 #> 5 USA-1977 Carter 2 M 57 1981 5 # don't standardize the leader-days for this use, just to be safe. create_leaderdays(standardize = 'none') %>% # extract year from date mutate(year = lubridate::year(date)) %>% # group by leader group_by(obsid) %>% # count days in office, for leader tenure mutate(daysinoffice = seq(1:n())) %>% # group-by leader and year group_by(obsid, year) %>% # how long was the minimum (maximum) days in office for the leader in the year? summarize(min_daysoffice = min(daysinoffice), max_dayoffice = max(daysinoffice)) %>% #practice safe group-by, and assign to object ungroup() -> leader_tenures #> `summarise()` has grouped output by 'obsid'. You can override using the #> `.groups` argument. # add this information to our data leader_years %>% left_join(., leader_tenures) -> leader_years #> Joining with `by = join_by(obsid, year)` leader_years %>% filter(obsid == \"USA-1977\") #> # A tibble: 5 × 9 #> obsid leader ccode gender leaderage year yrinoffice min_daysoffice max_d…¹ #> #> 1 USA-1977 Carter 2 M 53 1977 1 1 346 #> 2 USA-1977 Carter 2 M 54 1978 2 347 711 #> 3 USA-1977 Carter 2 M 55 1979 3 712 1076 #> 4 USA-1977 Carter 2 M 56 1980 4 1077 1442 #> 5 USA-1977 Carter 2 M 57 1981 5 1443 1462 #> # … with abbreviated variable name ¹​max_dayoffice"},{"path":"http://svmiller.com/articles/state-systems.html","id":"where-the-systems-conflict-with-each-other","dir":"Articles","previous_headings":"","what":"Where the Systems Conflict With Each Other","title":"A Discussion of the Two State Systems (CoW, G-W) in `{peacesciencer}`","text":"large, user might see differences two systems overstate differences see, least practical concerns. example, CoW treats Canada independent state starting 1920 (coinciding founding membership League Nations, one coding criteria) whereas G-W Canada independent state starting 1867 (coinciding British North America Act, 1867). However, code Canada (20) identical systems Canada never period disappeared either system. cases simple; one temporal domain subset system’s temporal domain particular state. differences note. G-W states CoW doesn’t (e.g. Transvaal Orange Free State) CoW states G-W don’t (e.g. Sao Tome Principe Seychelles). cases simple; corresponding state code entity system. commonality apparent differences (least think), lot differences pose real problem integrating one . Yet, also true differ, sometimes really differ. Trying integrate one amounts collision. example two systems collide . Yemeni unification one several points divergence two systems. Unlike, say, dissolution Yugoslavia, CoW G-W agreement unification took place (22 May 1990). However, disagree means data entry. unaware either G-W CoW discussing exact case, difference interpretation mirrors (likely) see unification Germany year. CoW seems interpret Yemeni unification creation unseen, entirely new Yemeni state just simple integration one . Thus, newly formed Republic Yemen (“Yemen”) gets new state code.2 G-W seem interpret unification less case formation new state, demise People’s Democratic Republic Yemen (“South Yemen”) integration Yemen Arab Republic (“North Yemen”). new code new entity, just continuation “Yemen (Arab Republic Yemen)” demise “Yemen, People’s Republic .” might seem like ’s distinction without much difference, matter standard peace science data. , example, happen merge G-W codes CoW state-year data cases. G-W code 678 going duplicated twice data. G-W code 678 1990 refers Yemen Arab Republic unification, Yemen unification. CoW sees two states G-W sees one. state-day data, problem. state-year data, becomes problem aggregation time results duplicate entries code merged data. Worse yet, easy way around ’s unique issue arises trying integrate two different state systems . another case systems collide : Serbia Yugoslavia. case, state systems differ major ways classifying entities dates. main difference interpret Yugoslavia . Unlike case Yemen, G-W discuss Yugoslavia bit 1999 article. one passage page 397. Yugoslavia appears COW-list continuously 1878 1941. However,Serbian government fled German invasion 1915. new kingdom Serbia, Croatia, Montenegro proclaimed 1918 become Kingdom Yugoslavia 1929. sensible consider single polity? revisit case page 401 describing major differences system CoW’s system. Unlike COW, consider Serbia 1878 Austro-Hungarian invasion 1915 different polity Kingdom Croats, Serbs, Slovenes (renamed Yugoslavia 1929), established 1918. interesting difference interpretation whether Serbia disappear international system three-year period World War . CoW says “” G-W point government’s retreat Albania Austro-Hungarian/Bulgarian occupations suggestive “state” without territory (, thus, state). bigger difference interpretation concerns interpret “Yugoslavia.” CoW seems interpret Serbian “center” Yugoslavia, analogous interpretation (G-W’s interpretation) Prussian core German Empire. CoW, means Serbia precedes succeeds Yugoslavia Yugoslavia fundamentally territorial expansion Serbia result World War . G-W, 1915 retreat Serbian government 1918 creation State Slovenes, Croats Serbs amounts death one state (Serbia) formation new state (Yugoslavia) years later. Yugoslavia dies 2006 last remnant creation, Montenegro, emerges independent Serbia. Thus, Serbia reappears state system entity first time since 1915. integration run inverse situation Yemeni German unification 1990. cases, G-W see integration whereas CoW sees new state creation (case Yemen) old state restoration (case Germany). case, CoW sees one continuous state breaking apart whereas G-W see state death old state restoration. Correlates War state code 345 appear twice 2006, referring G-W state Serbia G-W state Yugoslavia year.","code":"create_stateyears() %>% filter(ccode %in% c(678:680) & year %in% c(1988:1991)) %>% add_gwcode_to_cow() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 8 × 4 #> ccode statenme year gwcode #> #> 1 678 Yemen Arab Republic 1988 678 #> 2 678 Yemen Arab Republic 1989 678 #> 3 678 Yemen Arab Republic 1990 678 #> 4 679 Yemen 1990 678 #> 5 679 Yemen 1991 678 #> 6 680 Yemen People's Republic 1988 680 #> 7 680 Yemen People's Republic 1989 680 #> 8 680 Yemen People's Republic 1990 680 cow_states %>% mutate(startdate = ymd(paste0(styear,\"/\",stmonth, \"/\", stday)), enddate = ymd(paste0(endyear,\"/\",endmonth,\"/\",endday))) %>% select(stateabb:statenme, startdate, enddate) %>% mutate(data = \"CoW\") %>% rename(statename = statenme) %>% filter(ccode == 345) %>% bind_rows(., gw_states %>% filter(gwcode %in% c(340, 345)) %>% mutate(data = \"G-W\")) %>% select(data, stateabb, statename, ccode, gwcode, everything()) #> # A tibble: 5 × 7 #> data stateabb statename ccode gwcode startdate enddate #> #> 1 CoW YUG Yugoslavia 345 NA 1878-07-13 1941-04-20 #> 2 CoW YUG Yugoslavia 345 NA 1944-10-20 2016-12-31 #> 3 G-W SER Serbia NA 340 1878-07-13 1915-10-01 #> 4 G-W SER Serbia NA 340 2006-06-05 2017-12-31 #> 5 G-W YUG Yugoslavia NA 345 1918-12-01 2006-06-04 create_stateyears(system = 'gw') %>% filter(gwcode %in% c(340, 345) & year %in% c(2005:2008)) %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 5 × 4 #> gwcode statename year ccode #> #> 1 340 Serbia 2006 345 #> 2 340 Serbia 2007 345 #> 3 340 Serbia 2008 345 #> 4 345 Yugoslavia 2005 345 #> 5 345 Yugoslavia 2006 345"},{"path":"http://svmiller.com/articles/state-systems.html","id":"how-peacesciencer-handles-the-integration-of-cow-and-g-w-state-system-data","dir":"Articles","previous_headings":"","what":"How {peacesciencer} Handles the Integration of CoW and G-W State System Data","title":"A Discussion of the Two State Systems (CoW, G-W) in `{peacesciencer}`","text":"peacesciencer two functions converting CoW codes G-W codes (vice-versa). add_ccode_to_gw() take data set ps_system attribute “gw” match G-W codes CoW codes. data uses gw_cow_years data frame package. can see created (along ample annotation ’m , two differ, ’m ’m ). corollary add_gwcode_to_cow(), adds G-W codes data frame ps_system attribute “cow”. function uses cow_gw_years data frame package. code generates data also amply annotated available public viewing. implementation philosophy important state . break philosophy following main points. First, collisions G-W state system data CoW state system data unavoidable higher levels temporal aggregation (e.g. state-years). user trying merge G-W codes CoW state-year data, create duplicate G-W state codes 1990 Yemen Arab Republic/Yemen (Germany/West Germany). CoW sees two states merging one new (Yemen) previous (Germany) state G-W see one folding . similar situation happen trying merge CoW codes G-W state-year data regarding final disintegration Yugoslavia 2006. CoW sees Serbia preceding, dominating, succeeding Yugoslavia G-W see Yugoslavia entity entirely distinct Serbia. Consider implication : user may Gleditsch-Ward state-year data civil conflict analysis want merge CoW’s national material capabilities data . Matching CoW codes G-W state codes beforehand invariably create duplicate entries Serbia-2006 Yugoslavia-2006. user avoid . happen two state systems collide . Second, functionality build peacesciencer comes philosophy classification system must “master” system. preach students well. user elects treat “master” system discretion, peacesciencer forces user important way. Namely, “create” family functions assign ps_system attribute data creates. user starts workflow create_stateyears(system = 'gw'), get state-year data frame “master” system G-W. user instead wants CoW master system, run create_stateyears(system = 'cow') create_stateyears(system = 'gw'). ultimately design choice user, peacesciencer force way. Something must “master” system. ’s worth stating right wrong answer user’s choice tailored research design. recommendation take one two tracks toward choosing “master” system. One approach make “master” system one coinciding bulk data author use. CoW larger presence G-W peace science data ecosystem, certainly “right-hand side” variables (e.g. capabilities, trade) inter-state conflict. Whereas primarily inter-state conflict researcher, account CoW default option data-creation functions. reasonable approach make “master” system one coinciding outcome variable. Think way. user creating data peacesciencer want explain outcome. Let’s say interested explaining intrastate conflict levels intensity UCDP armed conflict data. conflicts use G-W system classification. data collect fundamentally nested universe G-W state-year data since 1946. important, principle, get part right split hairs Yemen, Germany, Serbia/Yugoslavia. conditions, user make G-W system master (e.g. create_stateyears(system = 'gw')). Finally, peacesciencer strives make integration seamless possible can. example, add_minimum_distance() look data user feeds see “master” system. ’s CoW, add_minimum_distance() merge minimum distance data cow_mindist data frame package. ’s G-W system, add_minimum_distance() merge minimum distance data gw_mindist data frame. add_sdp_gdp() add_democracy() also . Collisions CoW state system data G-W state system data unavoidable; example, anything CoW ecosystem (e.g. alliances, IGOs, capabilities) going require CoW codes merging. possible, peacesciencer tries inclusive avoid elevating one can. end result suite functions peacesciencer work well robustly, given circumstances. CoW system master, merging G-W codes result duplicate G-W codes given different interpretations German Yemeni unification. G-W system master, merging CoW codes result duplicate CoW codes given different interpretation disintegration Yugoslavia. unavoidable, functionality add_ccode_to_gw() add_gwcode_to_cow() importantly duplicate master codes. underlying data used functions pre-processed make sure happen. functions like add_minimum_distance(), add_sdp_gdp(), add_democracy() come CoW G-W flavors allow easier integration well. matter commonality systems, differ important ways create unavoidable collisions merging one . user aware even peacesciencer works well contain collisions occur.","code":""},{"path":"http://svmiller.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steve Miller. Author, maintainer.","code":""},{"path":"http://svmiller.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Miller S (2022). “peacesciencer: R Package Quantitative Peace Science Research.” Conflict Management Peace Science, 39(6), 755–779. doi: 10.1177/07388942221077926.","code":"@Article{, title = {{peacesciencer}: An R Package for Quantitative Peace Science Research}, author = {Steven V. Miller}, journal = {Conflict Management and Peace Science}, year = {2022}, volume = {39}, number = {6}, pages = {755--779}, doi = {10.1177/07388942221077926}, }"},{"path":"http://svmiller.com/index.html","id":"peacesciencer-tools-and-data-for-quantitative-peace-science","dir":"","previous_headings":"","what":"Tools and Data for Quantitative Peace Science Research","title":"Tools and Data for Quantitative Peace Science Research","text":"peacesciencer R package including various functions data sets allow easier analyses field quantitative peace science. goal provide R package reasonably approximates made EUGene attractive scholars working field quantitative peace science early 2000s. EUGene shined encouraged replications conflict models user also generate data scratch. Likewise, R package offer tools approximate EUGene within R environment (.e. requiring Windows installation).","code":""},{"path":"http://svmiller.com/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Tools and Data for Quantitative Peace Science Research","text":"can install CRAN, follows: can install development version package devtools package. development version package invariably goodies, may may various levels stress-testing.","code":"install.packages(\"peacesciencer\") devtools::install_github(\"svmiller/peacesciencer\")"},{"path":"http://svmiller.com/index.html","id":"how-to-use-peacesciencer","dir":"","previous_headings":"","what":"How to Use {peacesciencer}","title":"Tools and Data for Quantitative Peace Science Research","text":"New users read two things get started. package’s website exhaustive list description functions data included package. {peacesciencer} user’s guide worth reading. user’s guide points potential uses benefits also offering encouragement completely new R programming language. package designed accessible prior experience R, though completely new users feel lost overwhelmed learn “tidy” approach R help get started. workflow going look something like . First, start one two processes create either dyad-year state-year data. dyad-year data created create_dyadyears() function. optional parameters hidden defaults. user can specify kind state system (system) data want use—either Correlates War (\"cow\") Gleditsch-Ward (\"gw\"), whether want extend data recently concluded calendar year (mry) (.e. Correlates War state system membership data current Dec. 31, 2016 script can extend end recently concluded calendar year), whether user wants directed non-directed dyad-year data (directed). create_stateyears() works much way, though “directed” “non-directed” make sense state-year context. functions default Correlates War state system membership data recently concluded calendar year. Thereafter, user can specify additional variables want added dyad-year state-year data. note: additional functions lean primarily Correlates War state code identifiers. Indeed, bulk quantitative peace science data ecosystem built around Correlates War project. variables user wants added “pipe” process like . note user may want break data-generating process manageable “chunks” (e.g. first generating dyad-year data saving object, adding piece piece). ’s look like operation. Assume want create data something analogous “dangerous dyads” design non-directed dyad-years. ’s ’d peacesciencer, going lifted source R scripts user’s guide. first part code chunk lean core peacesciencer functionality whereas stuff post-processing , bonus, modeling. might standard civil conflict analysis using Gleditsch-Ward states UCDP conflict data.","code":"# library(tidyverse) # load this first for most/all things # library(peacesciencer) # the package of interest # library(stevemisc) # a dependency, but also used for standardizing variables for better interpretation library(tictoc) tic() create_dyadyears(directed = FALSE, mry = FALSE) %>% filter_prd() %>% add_gml_mids(keep = NULL) %>% add_peace_years() %>% add_nmc() %>% add_democracy() %>% add_cow_alliance() %>% add_sdp_gdp() -> Data Data %>% mutate(landcontig = ifelse(conttype == 1, 1, 0)) %>% mutate(cowmajdyad = ifelse(cowmaj1 == 1 | cowmaj2 == 1, 1, 0)) %>% # Create estimate of militarization as milper/tpop # Then make a weak-link mutate(milit1 = milper1/tpop1, milit2 = milper2/tpop2, minmilit = ifelse(milit1 > milit2, milit2, milit1)) %>% # create CINC proportion (lower over higher) mutate(cincprop = ifelse(cinc1 > cinc2, cinc2/cinc1, cinc1/cinc2)) %>% # create weak-link specification using Quick UDS data mutate(mindemest = ifelse(xm_qudsest1 > xm_qudsest2, xm_qudsest2, xm_qudsest1)) %>% # Create \"weak-link\" measure of jointly advanced economies mutate(minwbgdppc = ifelse(wbgdppc2011est1 > wbgdppc2011est2, wbgdppc2011est2, wbgdppc2011est1)) -> Data # r2sd() is in {stevemisc}, a {peacesciencer} dependency. # This is just for a more readable regression output. Data %>% mutate_at(vars(\"cincprop\", \"mindemest\", \"minwbgdppc\", \"minmilit\"), ~r2sd(.)) -> Data broom::tidy(modDD <- glm(gmlmidonset ~ landcontig + cincprop + cowmajdyad + cow_defense + mindemest + minwbgdppc + minmilit + gmlmidspell + I(gmlmidspell^2) + I(gmlmidspell^3), data= Data, family=binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -3.06 0.0635 -48.2 0 #> 2 landcontig 1.06 0.0568 18.7 4.21e- 78 #> 3 cincprop 0.455 0.0363 12.5 6.63e- 36 #> 4 cowmajdyad 0.144 0.0575 2.51 1.20e- 2 #> 5 cow_defense -0.119 0.0580 -2.04 4.09e- 2 #> 6 mindemest -0.499 0.0525 -9.51 1.93e- 21 #> 7 minwbgdppc 0.293 0.0511 5.72 1.06e- 8 #> 8 minmilit 0.255 0.0226 11.3 2.02e- 29 #> 9 gmlmidspell -0.147 0.00505 -29.0 5.33e-185 #> 10 I(gmlmidspell^2) 0.00247 0.000135 18.4 2.74e- 75 #> 11 I(gmlmidspell^3) -0.0000116 0.000000891 -13.0 1.16e- 38 toc() #> 7.35 sec elapsed tic() create_stateyears(system = 'gw') %>% filter(year %in% c(1946:2019)) %>% add_ucdp_acd(type=c(\"intrastate\"), only_wars = FALSE) %>% add_peace_years() %>% add_democracy() %>% add_creg_fractionalization() %>% add_sdp_gdp() %>% add_rugged_terrain() -> Data create_stateyears(system = 'gw') %>% filter(year %in% c(1946:2019)) %>% add_ucdp_acd(type=c(\"intrastate\"), only_wars = TRUE) %>% add_peace_years() %>% rename_at(vars(ucdpongoing:ucdpspell), ~paste0(\"war_\", .)) %>% left_join(Data, .) -> Data Data %>% arrange(gwcode, year) %>% group_by(gwcode) %>% mutate_at(vars(\"xm_qudsest\", \"wbgdppc2011est\", \"wbpopest\"), list(l1 = ~lag(., 1))) %>% rename_at(vars(contains(\"_l1\")), ~paste(\"l1\", gsub(\"_l1\", \"\", .), sep = \"_\") ) -> Data modCW <- list() broom::tidy(modCW$\"All UCDP Conflicts\" <- glm(ucdponset ~ l1_wbgdppc2011est + l1_wbpopest + l1_xm_qudsest + I(l1_xm_qudsest^2) + newlmtnest + ethfrac + relfrac + ucdpspell + I(ucdpspell^2) + I(ucdpspell^3), data=subset(Data), family = binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -5.10 1.35 -3.77 0.000160 #> 2 l1_wbgdppc2011est -0.285 0.110 -2.59 0.00953 #> 3 l1_wbpopest 0.229 0.0672 3.41 0.000644 #> 4 l1_xm_qudsest 0.257 0.181 1.43 0.154 #> 5 I(l1_xm_qudsest^2) -0.726 0.211 -3.44 0.000574 #> 6 newlmtnest 0.0549 0.0666 0.824 0.410 #> 7 ethfrac 0.442 0.358 1.23 0.217 #> 8 relfrac -0.389 0.402 -0.969 0.333 #> 9 ucdpspell -0.0738 0.0393 -1.88 0.0601 #> 10 I(ucdpspell^2) 0.00443 0.00205 2.16 0.0304 #> 11 I(ucdpspell^3) -0.0000602 0.0000280 -2.15 0.0316 broom::tidy(modCW$\"Wars Only\" <- glm(war_ucdponset ~ l1_wbgdppc2011est + l1_wbpopest + l1_xm_qudsest + I(l1_xm_qudsest^2) + newlmtnest + ethfrac + relfrac + war_ucdpspell + I(war_ucdpspell^2) + I(war_ucdpspell^3), data=subset(Data), family = binomial(link=\"logit\"))) #> # A tibble: 11 × 5 #> term estimate std.error statistic p.value #> #> 1 (Intercept) -6.59 2.08 -3.16 0.00156 #> 2 l1_wbgdppc2011est -0.343 0.172 -1.99 0.0463 #> 3 l1_wbpopest 0.272 0.106 2.56 0.0105 #> 4 l1_xm_qudsest -0.0847 0.270 -0.313 0.754 #> 5 I(l1_xm_qudsest^2) -0.761 0.352 -2.16 0.0307 #> 6 newlmtnest 0.342 0.112 3.05 0.00226 #> 7 ethfrac 0.333 0.554 0.601 0.548 #> 8 relfrac -0.281 0.593 -0.474 0.635 #> 9 war_ucdpspell -0.111 0.0562 -1.98 0.0478 #> 10 I(war_ucdpspell^2) 0.00466 0.00252 1.85 0.0643 #> 11 I(war_ucdpspell^3) -0.0000499 0.0000302 -1.65 0.0982 toc() #> 2.315 sec elapsed"},{"path":"http://svmiller.com/index.html","id":"citing-what-you-do-in-peacesciencer","dir":"","previous_headings":"","what":"Citing What You Do in {peacesciencer}","title":"Tools and Data for Quantitative Peace Science Research","text":"can () cite peacesciencer. package includes data frame BibTeX file (ps_bib) function finding returning BibTeX entries can include projects. ps_cite() function. ps_cite() function takes string partial match relevant keywords (KEYWORDS) associated entries ps_bib file. example, can () cite package . can see relevant citations consider using data returned add_democracy() can also return partial matches see citations associated , say, alliance data package. function might expand complexity future releases, can use right now finding appropriate citations. also scan ps_bib data see .","code":"ps_cite(\"peacesciencer\") #> @ARTICLE{peacesciencer-package, #> AUTHOR = {Steven V. Miller}, #> JOURNAL = {Conflict Management and Peace Science}, #> TITLE = {peacesciencer}: An R Package for Quantitative Peace Science Research}, #> YEAR = {2022}, #> KEYWORDS = {peacesciencer, add_capital_distance(), add_ccode_to_gw(), add_gwcode_to_cow(), capitals}, #> URL = {http://svmiller.com/peacesciencer/}} ps_cite(\"add_democracy()\") #> @UNPUBLISHED{coppedgeetal2020vdem, #> AUTHOR = {Michael Coppedge and John Gerring and Carl Henrik Knutsen and Staffan I. Lindberg and Jan Teorell and David Altman and Michael Bernhard and M. Steven Fish and Adam Glynn and Allen Hicken and Anna Luhrmann and Kyle L. Marquardt and Kelly McMann and Pamela Paxton and Daniel Pemstein and Brigitte Seim and Rachel Sigman and Svend-Erik Skaaning and Jeffrey Staton and Agnes Cornell and Lisa Gastaldi and Haakon Gjerl{\\o}w and Valeriya Mechkova and Johannes von R{\\\"o}mer and Aksel Sundtr{\\\"o}m and Eitan Tzelgov and Luca Uberti and Yi-ting Wang and Tore Wig and Daniel Ziblatt}, #> NOTE = {Varieties of Democracy ({V}-{D}em) Project}, #> TITLE = {V-Dem Codebook v10}, #> YEAR = {2020}, #> KEYWORDS = {add_democracy(), v-dem, varieties of democracy}} #> #> @UNPUBLISHED{marquez2016qme, #> AUTHOR = {Xavier Marquez}, #> NOTE = {Available at SSRN: http://ssrn.com/abstract=2753830}, #> TITLE = {A Quick Method for Extending the {U}nified {D}emocracy {S}cores}, #> YEAR = {2016}, #> KEYWORDS = {add_democracy(), UDS, Unified Democracy Scores}, #> URL = {http://dx.doi.org/10.2139/ssrn.2753830}} #> #> @UNPUBLISHED{marshalletal2017p, #> AUTHOR = {Monty G. Marshall and Ted Robert Gurr and Keith Jaggers}, #> NOTE = {University of Maryland, Center for International Development and Conflict Management}, #> TITLE = {Polity {IV} Project: Political Regime Characteristics and Transitions, 1800-2016}, #> YEAR = {2017}, #> KEYWORDS = {add_democracy(), polity}} #> #> @ARTICLE{pemsteinetal2010dc, #> AUTHOR = {Pemstein, Daniel and Stephen A. Meserve and James Melton}, #> JOURNAL = {Political Analysis}, #> NUMBER = {4}, #> PAGES = {426--449}, #> TITLE = {Democratic Compromise: A Latent Variable Analysis of Ten Measures of Regime Type}, #> VOLUME = {18}, #> YEAR = {2010}, #> KEYWORDS = {add_democracy(), UDS, Unified Democracy Scores}, #> OWNER = {steve}, #> TIMESTAMP = {2011.01.30}} ps_cite(\"alliance\") #> @BOOK{gibler2009ima, #> AUTHOR = {Douglas M. Gibler}, #> PUBLISHER = {Washington DC: CQ Press}, #> TITLE = {International Military Alliances, 1648-2008}, #> YEAR = {2009}, #> KEYWORDS = {add_cow_alliance()}} #> #> @ARTICLE{leedsetal2002atop, #> AUTHOR = {Bretty Ashley Leeds and Jeffrey M. Ritter and Sara McLaughlin Mitchell and Andrew G. Long}, #> JOURNAL = {International Interactions}, #> PAGES = {237--260}, #> TITLE = {Alliance Treaty Obligations and Provisions, 1815-1944}, #> VOLUME = {28}, #> YEAR = {2002}, #> KEYWORDS = {add_atop_alliance()}}"},{"path":"http://svmiller.com/index.html","id":"issuesrequests","dir":"","previous_headings":"","what":"Issues/Requests","title":"Tools and Data for Quantitative Peace Science Research","text":"peacesciencer already capable meet wide variety needs peace science community. Users free raise issue project’s Github feature performing think additions like see.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":null,"dir":"Reference","previous_headings":"","what":"(An Abbreviation of) The LEAD Data Set — LEAD","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"abbreviated version LEAD Data Set, incorporating variables think interesting potentially useful data.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"","code":"LEAD"},{"path":"http://svmiller.com/reference/LEAD.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"data frame 3409 observations following 12 variables. obsid observational ID archigos leveledu 0 = primary, 1 = secondary, 2 = university, 3 = graduate milservice leader prior military service? combat leader prior combat experience military service? rebel leader previously part rebel group? warwin leader previously part winning war effort part military service? warloss leader previously part losing war effort part military service? rebelwin leader previously part winning war effort part rebel group? rebelloss leader previously part losing war effort part rebel group? yrsexper previous years experience politics becoming leader physhealth leader physical health issues? mentalhealth leader mental health issues?","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"Data ported Ellis et al. (2015). Users want variables included peacesciencer raise issue Github.","code":""},{"path":"http://svmiller.com/reference/LEAD.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(An Abbreviation of) The LEAD Data Set — LEAD","text":"Ellis, Carli Mortenson, Michael C. Horowitz, Allan C. Stam. 2015. \"Introducing LEAD Data Set.\" International Interactions 41(4): 718--741.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"add_archigos() allows add information leaders dyad-year state-year data. function leans abbreviated version data, also comes package.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"","code":"add_archigos(data)"},{"path":"http://svmiller.com/reference/add_archigos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"add_archigos() takes dyad-year state-year data frame adds summary variables based leader-level data. include whether leader transition state-year (first/second state dyad-year), whether \"irregular\" leader transition, number leaders state-year, unique leader ID Jan. 1 year, unique leader ID Dec. 31 year.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_archigos.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Archigos political leader information to dyad-year and state-year data — add_archigos","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_archigos() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 2,139,270 × 13 #> ccode1 ccode2 year leadert…¹ irreg…² n_lea…³ jan1o…⁴ dec31…⁵ leade…⁶ irreg…⁷ #> #> 1 2 20 1920 0 0 1 USA-19… USA-19… 1 0 #> 2 2 20 1921 1 0 2 USA-19… USA-19… 1 0 #> 3 2 20 1922 0 0 1 USA-19… USA-19… 0 0 #> 4 2 20 1923 1 0 2 USA-19… USA-19… 0 0 #> 5 2 20 1924 0 0 1 USA-19… USA-19… 0 0 #> 6 2 20 1925 0 0 1 USA-19… USA-19… 0 0 #> 7 2 20 1926 0 0 1 USA-19… USA-19… 1 0 #> 8 2 20 1927 0 0 1 USA-19… USA-19… 0 0 #> 9 2 20 1928 0 0 1 USA-19… USA-19… 0 0 #> 10 2 20 1929 1 0 2 USA-19… USA-19… 0 0 #> # … with 2,139,260 more rows, 3 more variables: n_leaders2 , #> # jan1obsid2 , dec31obsid2 , and abbreviated variable names #> # ¹​leadertransition1, ²​irregular1, ³​n_leaders1, ⁴​jan1obsid1, ⁵​dec31obsid1, #> # ⁶​leadertransition2, ⁷​irregular2 create_stateyears() %>% add_archigos() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 17,121 × 8 #> ccode statenme year leader…¹ irreg…² n_lea…³ jan1o…⁴ dec31…⁵ #> #> 1 2 United States of America 1816 NA NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA NA #> # … with 17,111 more rows, and abbreviated variable names ¹​leadertransition, #> # ²​irregular, ³​n_leaders, ⁴​jan1obsid, ⁵​dec31obsid # }"},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"add_atop_alliance() allows add Alliance Treaty Obligations Provisions (ATOP) data (dyad-year, leader-dyad-year) data frame.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"","code":"add_atop_alliance(data)"},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"add_atop_alliance() takes (dyad-year, leader-dyad-year) data frame adds information alliance pledge given dyad-year ATOP data. include whether alliance defense pledge, offense pledge, neutrality pledge, non-aggression pledge, pledge consultation time crisis.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Data version 5.0 ATOP. function also work leader-dyad-years, though users careful leader-level applications alliance data. Alliance data primarily communicated yearly, making possible---even likely---least one leader-dyad given year credited alliance active particular leader-dyad. ATOP alliance data communicated time measurements granular year, least dyad-years. alliance-level data provided ATOP termination dates, unaware well start termination dates coincide particular members joining fact exiting early. alliance phase data appear communicate \"phases\" understood beginning/ending underlying document amended way affects one variable codings, may may signatory joining fact exiting early. guidance useful going forward, use data leader-level analyses mind.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Leeds, Brett Ashley, Jeffrey M. Ritter, Sara McLaughlin Mitchell, Andrew G. Long. 2002. Alliance Treaty Obligations Provisions, 1815-1944. International Interactions 28: 237-60.","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_atop_alliance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Alliance Treaty Obligations and Provisions (ATOP) alliance data to a dyad-year data frame — add_atop_alliance","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_atop_alliance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 8 #> ccode1 ccode2 year atop_defense atop_offense atop_neutral atop_non…¹ atop_…² #> #> 1 2 20 1920 0 0 0 0 0 #> 2 2 20 1921 0 0 0 0 0 #> 3 2 20 1922 0 0 0 0 0 #> 4 2 20 1923 0 0 0 0 0 #> 5 2 20 1924 0 0 0 0 0 #> 6 2 20 1925 0 0 0 0 0 #> 7 2 20 1926 0 0 0 0 0 #> 8 2 20 1927 0 0 0 0 0 #> 9 2 20 1928 0 0 0 0 0 #> 10 2 20 1929 0 0 0 0 0 #> # … with 2,139,260 more rows, and abbreviated variable names ¹​atop_nonagg, #> # ²​atop_consul"},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add capital-to-capital distance to a data frame — add_capital_distance","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"add_capital_distance() allows add capital--capital distance (dyad-year, leader-year, leader-dyad-year, state-year) data frame. capitals coded cow_capitals gw_capitals data frames, along latitudes longitudes. distance variable emerges capdist calculated using \"Vincenty\" method (.e. \"crow flies\") expressed kilometers.","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"","code":"add_capital_distance(data)"},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"add_capital_distance() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds capital--capital distance first state second state (dyad-year data) minimum capital--capital distance given state given year. minor note function: cases capital transition recorded underlying data , conversion capital-years (eventual merging dyad-year data frame), Jan. 1 capital used calculating distances.","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"function leans attributes data provided one \"create\" functions package (e.g. create_dyadyear() create_stateyear()).","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_capital_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add capital-to-capital distance to a data frame — add_capital_distance","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_capital_distance() #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year capdist #> #> 1 2 20 1920 2011. #> 2 2 20 1921 2011. #> 3 2 20 1922 2011. #> 4 2 20 1923 2011. #> 5 2 20 1924 2011. #> 6 2 20 1925 2011. #> 7 2 20 1926 2011. #> 8 2 20 1927 2011. #> 9 2 20 1928 2011. #> 10 2 20 1929 2011. #> # … with 2,139,260 more rows create_stateyears() %>% add_capital_distance() #> Warning: There were 390 warnings in `summarize()`. #> The first warning was: #> ℹ In argument: `mincapdist = min(.data$capdist, na.rm = TRUE)`. #> ℹ In group 206: `ccode1 = 2`, `year = 2021`. #> Caused by warning in `min()`: #> ! no non-missing arguments to min; returning Inf #> ℹ Run `dplyr::last_dplyr_warnings()` to see the 389 remaining warnings. #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 4 #> ccode statenme year mincapdist #> #> 1 2 United States of America 1816 6677. #> 2 2 United States of America 1817 6677. #> 3 2 United States of America 1818 6677. #> 4 2 United States of America 1819 6677. #> 5 2 United States of America 1820 6677. #> 6 2 United States of America 1821 6677. #> 7 2 United States of America 1822 6679. #> 8 2 United States of America 1823 6679. #> 9 2 United States of America 1824 6679. #> 10 2 United States of America 1825 6679. #> # … with 17,111 more rows # }"},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"add_ccode_to_gw() allows match, well one can, Correlates War system membership data Gleditsch-Ward system data.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"","code":"add_ccode_to_gw(data)"},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"add_ccode_to_gw() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame already Gleditsch-Ward state system codes adds corollary Correlates War codes.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"data-raw directory project's Github contains information underlying data assists merging codes. user invariably need careful ask want data included. issue different composition merging process () perfect. can note case like Gran Colombia difficult handle (.e. CoW entity none splinter states conflict CoW's coding). However, greater weirdness case like unification West Germany East Germany. Herein, Correlates War treats unification reappearance original Germany whereas Gleditsch-Ward treat unification incorporation East Germany West Germany. script create state-year dyad-year duplicates Gleditsch-Ward codes. size original data remain unchanged. However, year duplicates various Correlates War codes (prominently Serbia Yugoslavia 2006). Use care. can also use countrycode package. Whether use function countrycode package, kind merging without assessing output.","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ccode_to_gw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War state system codes to your data with Gleditsch-Ward state codes. — add_ccode_to_gw","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_dyadyears(system = \"gw\") %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 5 #> gwcode1 gwcode2 year ccode1 ccode2 #> #> 1 2 20 1867 2 NA #> 2 2 20 1868 2 NA #> 3 2 20 1869 2 NA #> 4 2 20 1870 2 NA #> 5 2 20 1871 2 NA #> 6 2 20 1872 2 NA #> 7 2 20 1873 2 NA #> 8 2 20 1874 2 NA #> 9 2 20 1875 2 NA #> 10 2 20 1876 2 NA #> # … with 2,089,816 more rows create_stateyears(system = 'gw') %>% add_ccode_to_gw() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 4 #> gwcode statename year ccode #> #> 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 #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_contiguity.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"add_contiguity() allows add Correlates War contiguity data dyad-year, leader-year, leader-dyad-year, state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"","code":"add_contiguity(data)"},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"add_contiguity() takes data frame adds information contiguity relationship based \"master records\" Correlates War direct contiguity data (v. 3.2). data dyad-year (leader dyad-year), function returns lowest contiguity type observed dyad-year (contiguity observed ). data state-year (leader-year), data return total number land sea borders calculated master records.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"contiguity codes dyad-year data range 0 5. 1 = direct land contiguity. 2 = separated 12 miles water fewer (la Stannis Baratheon). 3 = separated 24 miles water fewer (12 miles). 4 = separated 150 miles water fewer (24 miles). 5 = separated 400 miles water fewer (150 miles). Importantly, 0 dyads contiguous CoW contiguity data. conscious decision part think CoW's contiguity data exactly ordinal. Cross-reference CoW's contiguity data minimum distance data exact package see dyads CoW codes contiguous fact close , sometimes even land-contiguous. example, Zimbabwe Namibia separated hundred feet water peculiar intersection Zambezi River borders Zambia, Botswana, Namibia, Zimbabwe meet. contiguity record CoW data. cases contiguity records situationally missing (e.g. India-Bangladesh, Bangladesh-Myanmar 1971) cases states much closer CoW's contiguity data imply (e.g. Pakistan Soviet Union separated 30 kilometers Afghani territory). researcher free recode 0s , say, 6s, peacesciencer . additional clarity, \"master records\" produce duplicates cases contiguity relationship changed given year. function returns minimum contiguity relationship observed given year. duplicates returned output. mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"Stinnett, Douglas M., Jaroslav Tir, Philip Schafer, Paul F. Diehl, Charles Gochman (2002). \"Correlates War Project Direct Contiguity Data, Version 3.\" Conflict Management Peace Science 19 (2):58-66.","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_contiguity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War direct contiguity information to a data frame — add_contiguity","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_contiguity() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year conttype #> #> 1 2 20 1920 1 #> 2 2 20 1921 1 #> 3 2 20 1922 1 #> 4 2 20 1923 1 #> 5 2 20 1924 1 #> 6 2 20 1925 1 #> 7 2 20 1926 1 #> 8 2 20 1927 1 #> 9 2 20 1928 1 #> 10 2 20 1929 1 #> # … with 2,139,260 more rows create_stateyears() %>% add_contiguity() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 5 #> ccode statenme year land sea #> #> 1 2 United States of America 1816 0 0 #> 2 2 United States of America 1817 0 0 #> 3 2 United States of America 1818 0 0 #> 4 2 United States of America 1819 0 0 #> 5 2 United States of America 1820 0 0 #> 6 2 United States of America 1821 0 0 #> 7 2 United States of America 1822 0 0 #> 8 2 United States of America 1823 0 0 #> 9 2 United States of America 1824 0 0 #> 10 2 United States of America 1825 0 0 #> # … with 17,111 more rows # }"},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War alliance data to a data frame — add_cow_alliance","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"add_cow_alliance() allows add Correlates War alliance data dyad-year data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"","code":"add_cow_alliance(data)"},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"data dyad-year leader-dyad-year data frame (either \"directed\" \"non-directed\")","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"add_cow_alliance() takes dyad-year data frame adds information alliance pledge given dyad-year. include whether alliance defense pledge, neutrality pledge, non-aggression pledge, pledge consultation time crisis (entente).","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Duplicates original directed dyad-year alliance data pre-processed. Check cow_alliance package's data-raw directory Github information. function also work leader-dyad-years, though users careful leader-level applications alliance data. Alliance data primarily communicated yearly, making possible---even likely---least one leader-dyad given year credited alliance active particular leader-dyad. Correlates War's alliance data communicated time measurements granular year. Apply data leader-level analyses mind.","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Congressional Quarterly Press.","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_alliance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War alliance data to a data frame — add_cow_alliance","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_alliance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 7 #> ccode1 ccode2 year cow_defense cow_neutral cow_nonagg cow_entente #> #> 1 2 20 1920 0 0 0 0 #> 2 2 20 1921 0 0 0 0 #> 3 2 20 1922 0 0 0 0 #> 4 2 20 1923 0 0 0 0 #> 5 2 20 1924 0 0 0 0 #> 6 2 20 1925 0 0 0 0 #> 7 2 20 1926 0 0 0 0 #> 8 2 20 1927 0 0 0 0 #> 9 2 20 1928 0 0 0 0 #> 10 2 20 1929 0 0 0 0 #> # … with 2,139,260 more rows"},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War major power information to a data frame — add_cow_majors","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"add_cow_majors() allows add Correlates War major power variables dyad-year, leader-year, leader dyad-year, state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"","code":"add_cow_majors(data)"},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"add_cow_majors() takes data frame adds information major power status given state dyad year. data dyad-year (leader dyad-year), function returns two columns whether first state (.e. ccode1) second state (.e. ccode2) major powers given year, according Correlates War. 1 = major power. 0 = major power. data state-year (leader-year), functions returns just one column (cowmaj) whether state major power given state-year.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_majors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War major power information to a data frame — add_cow_majors","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_majors() #> # A tibble: 2,139,270 × 5 #> ccode1 ccode2 year cowmaj1 cowmaj2 #> #> 1 2 20 1920 1 0 #> 2 2 20 1921 1 0 #> 3 2 20 1922 1 0 #> 4 2 20 1923 1 0 #> 5 2 20 1924 1 0 #> 6 2 20 1925 1 0 #> 7 2 20 1926 1 0 #> 8 2 20 1927 1 0 #> 9 2 20 1928 1 0 #> 10 2 20 1929 1 0 #> # … with 2,139,260 more rows"},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"add_cow_mids() merges CoW's MID data dyad-year data frame. version CoW-MID data package version 5.0.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"","code":"add_cow_mids(data, keep)"},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"data dyad-year data frame (either \"directed\" \"non-directed\") keep optional parameter, specified character vector, passed function select(one_of(.)) wrapper. allows user discard unwanted columns directed dispute data output consume much space memory. Note: Correlates War system codes (ccode1, ccode2), observation year (year), presence absence ongoing MID (cowmidongoing), presence absence unique MID onset (cowmidonset) always returned. foolish self-defeating eliminate observations. user free keep discard anything else see fit. keep specified function, ensuing output returns everything.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"add_cow_mids() takes dyad-year data frame adds dyad-year dispute information CoW-MID data.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. merging process employs several rules whittle duplicate dyad-years merging dyad-year data frame. function also return message user case-exclusion rules went process. Users interested implementing case-exclusion rules look \"whittle\" class functions also provided package.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_mids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War (CoW) Militarized Interstate Dispute (MID) data to dyad-year data frame — add_cow_mids","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_mids() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 24 #> ccode1 ccode2 year dispnum cowmidong…¹ cowmi…² sidea1 sidea2 fatal…³ fatal…⁴ #> #> 1 2 20 1920 NA 0 0 NA NA NA NA #> 2 2 20 1921 NA 0 0 NA NA NA NA #> 3 2 20 1922 NA 0 0 NA NA NA NA #> 4 2 20 1923 NA 0 0 NA NA NA NA #> 5 2 20 1924 NA 0 0 NA NA NA NA #> 6 2 20 1925 NA 0 0 NA NA NA NA #> 7 2 20 1926 NA 0 0 NA NA NA NA #> 8 2 20 1927 NA 0 0 NA NA NA NA #> 9 2 20 1928 NA 0 0 NA NA NA NA #> 10 2 20 1929 NA 0 0 NA NA NA NA #> # … with 2,139,260 more rows, 14 more variables: fatalpre1 , #> # fatalpre2 , hiact1 , hiact2 , hostlev1 , #> # hostlev2 , orig1 , orig2 , fatality , hostlev , #> # mindur , maxdur , recip , stmon , and abbreviated #> # variable names ¹​cowmidongoing, ²​cowmidonset, ³​fatality1, ⁴​fatality2 # keep just the dispute number and Side A/B identifiers cow_ddy %>% add_cow_mids(keep=c(\"dispnum\",\"sidea1\", \"sidea2\")) #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 8 #> ccode1 ccode2 year cowmidonset cowmidongoing dispnum sidea1 sidea2 #> #> 1 2 20 1920 0 0 NA NA NA #> 2 2 20 1921 0 0 NA NA NA #> 3 2 20 1922 0 0 NA NA NA #> 4 2 20 1923 0 0 NA NA NA #> 5 2 20 1924 0 0 NA NA NA #> 6 2 20 1925 0 0 NA NA NA #> 7 2 20 1926 0 0 NA NA NA #> 8 2 20 1927 0 0 NA NA NA #> 9 2 20 1928 0 0 NA NA NA #> 10 2 20 1929 0 0 NA NA NA #> # … with 2,139,260 more rows # }"},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War trade data to a data frame — add_cow_trade","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"add_cow_trade() allows add Correlates War trade data (dyad-year, leader-year, leader-dyad-year, state-year) data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"","code":"add_cow_trade(data)"},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"add_cow_trade() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information volume trade given dyad-year state-year. state-year (leader-year) data, minimally sum imports sum exports. dyad-year (leader-dyad-year) data, function returns value imports current million USD first country second country (vice-versa) along \"smooth\" equivalents.","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"dyad-year (leader-dyad-year) data, must kind information loss order work within limited space available package. package loads truncated version data trade values rounded three decimal points order greatly reduce disk space package. think terribly problematic, though admit like . problem research question, may want consider using function dyad-year leader-dyad-year data. mindful data fundamentally state-year dyad-year extensions leader-level data understood approximations leaders (leader-dyads) given state-year (dyad-year).","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"Barbieri, Katherine, Omar M. G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science. 26(5): 471-491.","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_trade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War trade data to a data frame — add_cow_trade","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) # The function below works, but depends on running `download_extdata()` beforehand. # cow_ddy %>% add_cow_trade() create_stateyears() %>% add_cow_trade() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 5 #> ccode statenme year imports exports #> #> 1 2 United States of America 1816 NA NA #> 2 2 United States of America 1817 NA NA #> 3 2 United States of America 1818 NA NA #> 4 2 United States of America 1819 NA NA #> 5 2 United States of America 1820 NA NA #> 6 2 United States of America 1821 NA NA #> 7 2 United States of America 1822 NA NA #> 8 2 United States of America 1823 NA NA #> 9 2 United States of America 1824 NA NA #> 10 2 United States of America 1825 NA NA #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"add_cow_wars() allows Correlates War data dyad-year state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"","code":"add_cow_wars(data, type, intratype = \"all\")"},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"data data frame appropriate peacesciencer attributes type type war want add. Options include \"inter\" \"intra\". intratype types armed conflicts user wants consider, specified character vector. Options include \"local issues\" \"central control\". Applicable type \"intra\".","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"add_cow_wars() takes dyad-year state-year data frame returns information wars either inter-state intra-state war data set Correlates War. function works state-year data user wants information extra-state wars intra-state wars. function works dyad-year data user wants information inter-state wars.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Intra-state war data coerced true state-year data first selecting duplicate state-years unique onsets, whichever war deadliest. inter-state war data work functionally way. intra-state wars: primary_state used identify government principally fighting domestic non-state actor central control local issues. Internationalized civil wars included data, outside actors intervene behalf government rebel group. Extra-state war functionality available right now try figure demand use.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Dixon, Jeffrey, Meredith Sarkees. 2016. Guide Intra-State Wars: Examination Civil Wars, 1816-2014. Thousand Oaks, CA: Sage. Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_cow_wars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War war data to dyad-year or state-year data frame. — add_cow_wars","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_stateyears(system = \"cow\") %>% add_cow_wars(type = \"intra\", intratype = \"central control\") #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 13 #> ccode statenme year warnum warname wartype cowin…¹ cowin…² intnl outcome #> #> 1 2 United Stat… 1816 NA NA NA 0 0 NA NA #> 2 2 United Stat… 1817 NA NA NA 0 0 NA NA #> 3 2 United Stat… 1818 NA NA NA 0 0 NA NA #> 4 2 United Stat… 1819 NA NA NA 0 0 NA NA #> 5 2 United Stat… 1820 NA NA NA 0 0 NA NA #> 6 2 United Stat… 1821 NA NA NA 0 0 NA NA #> 7 2 United Stat… 1822 NA NA NA 0 0 NA NA #> 8 2 United Stat… 1823 NA NA NA 0 0 NA NA #> 9 2 United Stat… 1824 NA NA NA 0 0 NA NA #> 10 2 United Stat… 1825 NA NA NA 0 0 NA NA #> # … with 17,111 more rows, 3 more variables: sideadeaths , #> # sidebdeaths , intrawarnums , and abbreviated variable names #> # ¹​cowintraonset, ²​cowintraongoing create_stateyears(system = \"cow\") %>% add_cow_wars(type = \"intra\", intratype = \"local issues\") #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 13 #> ccode statenme year warnum warname wartype cowin…¹ cowin…² intnl outcome #> #> 1 2 United Stat… 1816 NA NA NA 0 0 NA NA #> 2 2 United Stat… 1817 NA NA NA 0 0 NA NA #> 3 2 United Stat… 1818 NA NA NA 0 0 NA NA #> 4 2 United Stat… 1819 NA NA NA 0 0 NA NA #> 5 2 United Stat… 1820 NA NA NA 0 0 NA NA #> 6 2 United Stat… 1821 NA NA NA 0 0 NA NA #> 7 2 United Stat… 1822 NA NA NA 0 0 NA NA #> 8 2 United Stat… 1823 NA NA NA 0 0 NA NA #> 9 2 United Stat… 1824 NA NA NA 0 0 NA NA #> 10 2 United Stat… 1825 NA NA NA 0 0 NA NA #> # … with 17,111 more rows, 3 more variables: sideadeaths , #> # sidebdeaths , intrawarnums , and abbreviated variable names #> # ¹​cowintraonset, ²​cowintraongoing cow_ddy %>% add_cow_wars(type = \"inter\") #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 14 #> ccode1 ccode2 year cowintero…¹ cowin…² sidea1 sidea2 initi…³ initi…⁴ outco…⁵ #> #> 1 2 20 1920 0 0 NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA #> # … with 2,139,260 more rows, 4 more variables: outcome2 , #> # batdeath1 , batdeath2 , resume , and abbreviated variable #> # names ¹​cowinterongoing, ²​cowinteronset, ³​initiator1, ⁴​initiator2, ⁵​outcome1 # }"},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":null,"dir":"Reference","previous_headings":"","what":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"add_creg_fractionalization() allows add information fractionalization/polarization state's ethnic religious groups data.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"","code":"add_creg_fractionalization(data)"},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"add_creg_fractionalization() takes dyad-year, leader-year, leader-dyad-year, state-data frame, whether primary state identifiers Correlates War system Gleditsch-Ward system, returns information fractionalization polarization state(s) given year. function returns four additional columns data state-year returns eight additional columns data state-year (leader-year). columns returned fractionalization ethnic groups, polarization ethnic groups, fractionalization religious groups, polarization religious groups. data dyad-year (leader-dyad-year), return doubles provides information states dyad.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Please see information underlying data creg, associated R script data-raw directory, see data generated. creg data duplicates. standardizing true CoW codes, duplicates concern Serbia/Yugoslavia 1991 1992 well Russia/Soviet Union 1991. standardizing true Gleditsch-Ward codes, duplicates concern Serbia/Yugoslavia 1991 Russia/Soviet Union 1991. cases, function group-arrange fractionalized/polarized estimate (reasonable, think) assumption estimates prior dissolution states. problematic, feel free consult underlying data merge manually. underlying data Gleditsch-Ward codes Correlates War codes. merge makes depends declare \"master\" system top pipe (.e. create_dyadyears() create_stateyears()). , example, run create_stateyears(system=\"cow\") follow add_gwcode_to_cow(), merge Correlates War codes Gleditsch-Ward codes. can see script mechanics see achieved. mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Alesina, Alberto, Arnaud Devleeschauwer, William Easterly, Sergio Kurlat Romain Wacziarg. 2003. \"Fractionalization\". Journal Economic Growth 8: 155-194. Montalvo, Jose G. Marta Reynal-Querol. 2005. \"Ethnic Polarization, Potential Conflict, Civil Wars\" American Economic Review 95(3): 796--816. Nardulli, Peter F., Cara J. Wong, Ajay Singh, Buddy Petyon, Joseph Bajjalieh. 2012. Composition Religious Ethnic Groups (CREG) Project. Cline Center Democracy.","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_creg_fractionalization.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add fractionalization/polarization estimates from CREG to a data frame — add_creg_fractionalization","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_creg_fractionalization() #> # A tibble: 2,139,270 × 11 #> ccode1 ccode2 year ethfrac1 ethpol1 relfrac1 relpol1 ethfr…¹ ethpol2 relfr…² #> #> 1 2 20 1920 NA NA NA NA NA NA NA #> 2 2 20 1921 NA NA NA NA NA NA NA #> 3 2 20 1922 NA NA NA NA NA NA NA #> 4 2 20 1923 NA NA NA NA NA NA NA #> 5 2 20 1924 NA NA NA NA NA NA NA #> 6 2 20 1925 NA NA NA NA NA NA NA #> 7 2 20 1926 NA NA NA NA NA NA NA #> 8 2 20 1927 NA NA NA NA NA NA NA #> 9 2 20 1928 NA NA NA NA NA NA NA #> 10 2 20 1929 NA NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: relpol2 , and abbreviated #> # variable names ¹​ethfrac2, ²​relfrac2 create_stateyears() %>% add_creg_fractionalization() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year ethfrac ethpol relfrac relpol #> #> 1 2 United States of America 1816 NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA #> # … with 17,111 more rows create_stateyears(system = \"gw\") %>% add_creg_fractionalization() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 7 #> gwcode statename year ethfrac ethpol relfrac relpol #> #> 1 2 United States of America 1816 NA NA NA NA #> 2 2 United States of America 1817 NA NA NA NA #> 3 2 United States of America 1818 NA NA NA NA #> 4 2 United States of America 1819 NA NA NA NA #> 5 2 United States of America 1820 NA NA NA NA #> 6 2 United States of America 1821 NA NA NA NA #> 7 2 United States of America 1822 NA NA NA NA #> 8 2 United States of America 1823 NA NA NA NA #> 9 2 United States of America 1824 NA NA NA NA #> 10 2 United States of America 1825 NA NA NA NA #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Add democracy information to a data frame — add_democracy","title":"Add democracy information to a data frame — add_democracy","text":"add_democracy() allows add estimates democracy data.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add democracy information to a data frame — add_democracy","text":"","code":"add_democracy(data)"},{"path":"http://svmiller.com/reference/add_democracy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add democracy information to a data frame — add_democracy","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add democracy information to a data frame — add_democracy","text":"add_democracy() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information level democracy state two states dyad given year. data dyad-year leader-dyad-year, function adds six total columns first state (.e. ccode1 gwcode1) second state (.e. ccode2 gwcode2) level democracy measured Varieties Democracy project (v2x_polyarchy), Polity project (polity2), Xavier Marquez' QuickUDS extensions/estimates. data state-year leader-year, function returns three additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add democracy information to a data frame — add_democracy","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year. vignette package's website talks data primarily encourage maximize number observations analysis follow. Xavier Marquez' QuickUDS estimates best coverage. democracy ultimately control variable, otherwise variable huge concern analysis (.e. user particular stake best measurement democracy best conceptualization operationalization \"democracy\"), please use Marquez' estimates instead Polity V-dem. user analysis inter-state conflict, across standard post-1816 domain conflict studies, definitely use Polity data extent missingness large unnecessary. Please read vignette describing issues : http://svmiller.com/peacesciencer/articles/democracy.html","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add democracy information to a data frame — add_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add democracy information to a data frame — add_democracy","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_democracy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add democracy information to a data frame — add_democracy","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_democracy() #> # A tibble: 2,139,270 × 9 #> ccode1 ccode2 year v2x_polyarchy1 polity21 xm_quds…¹ v2x_p…² polit…³ xm_qu…⁴ #> #> 1 2 20 1920 0.446 10 1.19 0.442 9 0.982 #> 2 2 20 1921 0.509 10 1.19 0.576 10 1.31 #> 3 2 20 1922 0.51 10 1.19 0.622 10 1.31 #> 4 2 20 1923 0.516 10 1.19 0.622 10 1.31 #> 5 2 20 1924 0.514 10 1.20 0.622 10 1.31 #> 6 2 20 1925 0.505 10 1.20 0.622 10 1.28 #> 7 2 20 1926 0.511 10 1.20 0.661 10 1.28 #> 8 2 20 1927 0.53 10 1.20 0.672 10 1.28 #> 9 2 20 1928 0.533 10 1.25 0.672 10 1.28 #> 10 2 20 1929 0.549 10 1.25 0.672 10 1.28 #> # … with 2,139,260 more rows, and abbreviated variable names ¹​xm_qudsest1, #> # ²​v2x_polyarchy2, ³​polity22, ⁴​xm_qudsest2 create_stateyears(system=\"gw\") %>% add_democracy() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 6 #> gwcode statename year v2x_polyarchy polity2 xm_qudsest #> #> 1 2 United States of America 1816 0.367 9 0.707 #> 2 2 United States of America 1817 0.37 9 0.707 #> 3 2 United States of America 1818 0.365 9 0.707 #> 4 2 United States of America 1819 0.362 9 0.707 #> 5 2 United States of America 1820 0.349 9 0.707 #> 6 2 United States of America 1821 0.336 9 0.707 #> 7 2 United States of America 1822 0.341 9 0.707 #> 8 2 United States of America 1823 0.345 9 0.707 #> 9 2 United States of America 1824 0.345 9 0.707 #> 10 2 United States of America 1825 0.341 9 0.707 #> # … with 18,627 more rows create_stateyears(system=\"cow\") %>% add_democracy() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 6 #> ccode statenme year v2x_polyarchy polity2 xm_qudsest #> #> 1 2 United States of America 1816 0.367 9 0.707 #> 2 2 United States of America 1817 0.37 9 0.707 #> 3 2 United States of America 1818 0.365 9 0.707 #> 4 2 United States of America 1819 0.362 9 0.707 #> 5 2 United States of America 1820 0.349 9 0.707 #> 6 2 United States of America 1821 0.336 9 0.707 #> 7 2 United States of America 1822 0.341 9 0.707 #> 8 2 United States of America 1823 0.345 9 0.707 #> 9 2 United States of America 1824 0.345 9 0.707 #> 10 2 United States of America 1825 0.341 9 0.707 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_fpsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Add dyadic foreign policy similarity measures to your data — add_fpsim","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"add_fpsim() allows add variety dyadic foreign policy similarity measures (dyad-year, leader-dyad-year) data frame","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"","code":"add_fpsim(data, keep)"},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"data data frame appropriate peacesciencer attributes keep optional parameter, specified character vector, dyadic foreign policy similarity measure(s) user wants returned function. keep specified, function returns 14 dyadic foreign policy similarity measures calculated Haege (2011). Otherwise, function subsets underlying data just user wants merges .","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"add_fpsim() takes (dyad-year, leader-dyad-year) data frame adds information dyadic foreign policy similarity, based several measures calculated offered Frank Haege.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"dyad-year (leader-dyad-year) data, must kind information loss order reduce disk space data like command. case, calculations rounded three decimal spots. think terribly problematic, though admit like . problem research question (though imagine ), may want consider using function dyad-year leader-dyad-year data. mindful data fundamentally dyad-year extensions leader-level data understood approximations leaders-dyads given dyad-year. data function uses directed dyad-year merge left-join, making function agnostic whether dyad-year (leader-dyad-year) data directed non-directed. Haege's (2011) article reads first glance agnostic particular measures consider \"preferred\" \"default\" measure dyadic foreign policy similarity. Indeed, 2011 publication Political Analysis mostly drives point home S important limitations multiple variants Haege calculates substitutable. means user interested measuring dyadic foreign policy similarity might cycle assess varying effects whereas user interested just control variable model can (probably) get picking just one belaboring measure .","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"suggested-defaults","dir":"Reference","previous_headings":"","what":"Suggested Defaults","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"evaluation data, article, email exchange author leads following points user consider. follows rationale users think kappa default measure dyadic foreign policy similarity, though \"valued\" equivalent alliance data inadvisable default. example end document offers operational \"nudge\" user want function. choice measure part depend temporal domain. user just post-WWII sample, UN voting measures offer better coverage. partial alliance data, though, 19th century coverage. Haege implores use chance-corrected measures, like Cohen's (1960) kappa Scott's (1955) pi. two, Haege suggests kappa pi. rationale user need build strong assumption baseline propensity forming tie dyad members dyad make Scott's (1955) pi appropriate estimate Cohen's (1960) kappa even important chance correction. choice squared versus absolute distances arbitrary. Users probably think differences, know differences. S usually calculated absolute differences software packages, though never usually belabored user. Comparability S might argument favor absolute distance default, keep mind squared distances much commonly used types distance association metrics. choice binary valued also design choice user consider full merits, though practice valuing alliance ties quantitative scale builds strong assumptions scale alliance strength presented something like Correlates War ATOP typology. S traditionally done default, another reason application lot quantitative peace science research suspect.","code":""},{"path":[]},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"the-main-source-of-the-data","dir":"Reference","previous_headings":"","what":"The Main Source of the Data","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"use data whatsoever (except Tau-b), please cite Haege (2011). Data version 2.0. Haege, Frank M. 2011. \"Choice Circumstance? Adjusting Measures Foreign Policy Similarity Chance Agreement.\" Political Analysis 19(3): 287-305. Tau-b calculated Haege, additional citation (beyond citing package) necessary.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"citations-for-the-particular-similarity-measure-you-choose","dir":"Reference","previous_headings":"","what":"Citations for the Particular Similarity Measure You Choose","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Additional citations depend particular measure similarity using, whether Kendall's (1938) Tau-b, Signorino Ritter's (1999) S, Cohen's (1960) kappa Scott's (1955) pi. Haege (2011) part chorus arguing use S, though S measures included data elect ignore chorus use measure. Likewise, Tau-b , though good measure dyadic foreign policy similarity reasons Signorino Ritter (1999) mention. Haege (2011) argues chance-corrected measure dyadic foreign policy similarity, either Cohen's (1960) kappa Scott's (1955) pi. Cohen, Jacob. 1960. \"Coefficient Agreement Nominal Scales.\" Educational Psychological Measurement 20(1): 37-46. Kendall, M.G. 1938. \"New Measure Rank Correlation.\" Biometrika 30(1/2): 81--93. Scott, William . 1955. \"Reliability Content Analysis: Case Nominal Scale Coding.\" Public Opinion Quarterly 19(3): 321--5. Signorino, Curtis S. Jeffrey M. Ritter. \"Tau-b Tau-B: Measuring Similarity Foreign Policy Positions.\" 43(1): 115--44.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"citations-for-the-underlying-data-informing-the-similarity-measure","dir":"Reference","previous_headings":"","what":"Citations for the Underlying Data Informing the Similarity Measure","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Haege (2011) also suggests cite underlying data informing similarity measure, whether UN voting alliances. case, recommended Voeten citation 2013 alliance data proper. case alliances, know Gibler's (2009) book recommended even alliance data since updated (reflected measure). UN voting data, understanding 2017 paper Journal Conflict Resolution also preferred citation. Bailey, Michael ., Anton Strezhnev, Erik Voeten. 2017. \"Estimating Dynamic State Preferences United Nations Voting Data.\" Journal Conflict Resolution 61(2): 430--456. Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_fpsim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add dyadic foreign policy similarity measures to your data — add_fpsim","text":"","code":"if (FALSE) { # just call `library(tidyverse)` at the top of the your script. library(magrittr) # The function below works, but depends on # running `download_extdata()` beforehand. cow_ddy %>% add_fpsim() # Select just the two kappa measures that are suggested defaults. # `kappaba`: kappa for binary alliance data if you have pre-WWII data. # `kappavv`: kappa for UN voting data if you just post-WWII data. cow_ddy %>% add_fpsim(keep=c(\"kappaba\", \"kappavv\")) }"},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"add_gml_mids() merges GML's MID data (dyad-year, leader-year, leader-dyad-year, state-year) data frame. current version GML MID data 2.2.1.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"","code":"add_gml_mids(data, keep, init = \"sidea-all-joiners\")"},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"data data frame appropriate peacesciencer attributes keep optional parameter, specified character vector, applicable just dyad-year data, passed function select(one_of(.)) wrapper. allows user discard unwanted columns directed dispute data output consume much space memory. Note: Correlates War system codes (ccode1, ccode2), observation year (year), presence absence ongoing MID (gmlmidongoing), presence absence unique MID onset (gmlmidonset) always returned. foolish self-defeating eliminate observations. user free keep discard anything else see fit. keep specified function, ensuing output returns everything. init initiators coded? Applicable state-year, leader-dyad-year, leader-year data. parameter accepts one three possible values (\"sidea-orig\", \"sidea--joiners\", \"sidea--joiners\"). \"sidea-orig\" = state initiates MID (appears summary return output) state Side onset dispute. \"sidea--joiners\" = state initiates MID (appears summary return output) state Side onset dispute state joined MID Side . \"sidea--joiners\" = state initiates MID (appears summary return output) state Side onset dispute joined point thereafter. See details section discussion. default \"sidea--joiners\".","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"add_gml_mids() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds dispute information GML MID data. data dyad-year, return laundry list information onsets, ongoing conflicts, assorted participant- dispute-level summaries. data leader-dyad-year, carefully matched leaders well. data state-year leader-year, function returns information ongoing disputes (onsets) whether ongoing disputes (onsets) state (leader) initiated.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. merging process employs several rules whittle duplicate dyad-years merging dyad-year data frame. function also return message user case-exclusion rules went process. Users interested implementing case-exclusion rules look \"whittle\" class functions also provided package. Determining \"initiation\" state-year summaries inter-state disputes possible since implied directionality \"initiation.\" half cases, straightforward. can use participant summaries determine dispute bilateral dispute escalate beyond attack, state Side initiated dispute. multilateral MIDs, conditions still hold least originators. However, considerable difficulty cases 1) participant-level summaries suggested actions level clash higher, 2) participant joiner originator. effort required flesh enormous, perhaps forthcoming future update. add_gml_mids() allows make one three judgment calls (see arguments section documentation). call make, say probably use option \"sidea--joiners\". review MID data Doug Gibler suggests states join dispute roped conflict (.e. targeted state) first incident. routinely initiate entry conflict, concept \"initiation\" supposed capture literature. doubt cases third state brought dispute actions state even original MID coding rules place high barrier coding type dispute entry. However, time required individually assess whether state initiated entry MID something simplest cases (e.g. bilateral cases highest participant action fell short clash) time-consuming. require audit almost half participant-level summaries data. forthcoming publication, Gibler Miller offer excellent coverage new data set militarized events. However, include confrontations World War II.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_gml_mids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) data to a data frame — add_gml_mids","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gml_mids() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 26 #> ccode1 ccode2 year dispnum gmlmidong…¹ gmlmi…² sidea1 sidea2 fatal…³ fatal…⁴ #> #> 1 2 20 1920 NA 0 0 NA NA NA NA #> 2 2 20 1921 NA 0 0 NA NA NA NA #> 3 2 20 1922 NA 0 0 NA NA NA NA #> 4 2 20 1923 NA 0 0 NA NA NA NA #> 5 2 20 1924 NA 0 0 NA NA NA NA #> 6 2 20 1925 NA 0 0 NA NA NA NA #> 7 2 20 1926 NA 0 0 NA NA NA NA #> 8 2 20 1927 NA 0 0 NA NA NA NA #> 9 2 20 1928 NA 0 0 NA NA NA NA #> 10 2 20 1929 NA 0 0 NA NA NA NA #> # … with 2,139,260 more rows, 16 more variables: fatalpre1 , #> # fatalpre2 , hiact1 , hiact2 , hostlev1 , #> # hostlev2 , orig1 , orig2 , fatality , hostlev , #> # recip , mindur , maxdur , stmon , init1 , #> # init2 , and abbreviated variable names ¹​gmlmidongoing, ²​gmlmidonset, #> # ³​fatality1, ⁴​fatality2 # keep just the dispute number and Side A/B identifiers cow_ddy %>% add_gml_mids(keep=c(\"dispnum\",\"sidea1\", \"sidea2\")) #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> # A tibble: 2,139,270 × 12 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: dispnum , and abbreviated #> # variable name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"add_gwcode_to_cow() allows match, well one can, Gleditsch-Ward system membership data Correlates War state system membership data.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"","code":"add_gwcode_to_cow(data)"},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"add_gwcode_to_cow() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame already Correlates War state system codes adds corollary Gleditsch-Ward codes.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"data-raw directory project's Github contains information underlying data assists merging codes. user invariably need careful ask want data included. issue different composition merging process () perfect. can note case like Serbia/Yugoslavia difficult handle (since \"Serbia\" never overlaps \"Yugoslavia\" Gleditsch-Ward data Correlates War understands Serbia predecessor state, dominant state, successor state Yugoslavia). However, greater weirdness case like Yemen/Yemen Arab Republic. script create state-year dyad-year duplicates Correlates War codes. size original data remain unchanged. However, year duplicates various Gleditsch-Ward codes (e.g. Yemen, ). Use care. can also use countrycode package. Whether use function countrycode package, kind merging without assessing output.","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_gwcode_to_cow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Gleditsch-Ward state system codes to your data with Correlates of War state codes. — add_gwcode_to_cow","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gwcode_to_cow() #> # A tibble: 2,139,270 × 5 #> ccode1 ccode2 year gwcode1 gwcode2 #> #> 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 #> # … with 2,139,260 more rows create_stateyears() %>% add_gwcode_to_cow() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 4 #> ccode statenme year gwcode #> #> 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 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_igos.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"add_igos() allows add information Correlates War International Governmental Organizations data dyad-year state-year data, matching Correlates War system codes.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"","code":"add_igos(data)"},{"path":"http://svmiller.com/reference/add_igos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"add_igos() takes dyad-year data frame state-year data frame adds information available Correlates War International Governmental Organizations data. data dyad-year, function returns original data just one additional column total number mutual IGOs members dyad full members. data state-year, function returns original data four additional columns. number IGOs state full member, number IGOs state associate member, number IGOs state observer, number IGOs state involved way (.e. sum three columns).","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"Pevehouse, Jon C.W., Timothy Nordstron, Roseanne W McManus, Anne Spencer Jamison. 2020. \"Tracking Organizations World: Correlates War IGO Version 3.0 datasets.\" Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_igos.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War international governmental organizations (IGOs) data to dyad-year or state-year data. — add_igos","text":"","code":"# \\donttest{ # just call library(tidyverse) at the top of the pipe library(magrittr) cow_ddy %>% add_igos() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year dyadigos #> #> 1 2 20 1920 7 #> 2 2 20 1921 8 #> 3 2 20 1922 8 #> 4 2 20 1923 7 #> 5 2 20 1924 7 #> 6 2 20 1925 8 #> 7 2 20 1926 8 #> 8 2 20 1927 8 #> 9 2 20 1928 8 #> 10 2 20 1929 8 #> # … with 2,139,260 more rows create_stateyears() %>% add_igos() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year sum_igo_full sum_igo_a…¹ sum_i…² sum_i…³ #> #> 1 2 United States of America 1816 0 0 0 0 #> 2 2 United States of America 1817 0 0 0 0 #> 3 2 United States of America 1818 0 0 0 0 #> 4 2 United States of America 1819 0 0 0 0 #> 5 2 United States of America 1820 0 0 0 0 #> 6 2 United States of America 1821 0 0 0 0 #> 7 2 United States of America 1822 0 0 0 0 #> 8 2 United States of America 1823 0 0 0 0 #> 9 2 United States of America 1824 0 0 0 0 #> 10 2 United States of America 1825 0 0 0 0 #> # … with 17,111 more rows, and abbreviated variable names ¹​sum_igo_associate, #> # ²​sum_igo_observer, ³​sum_igo_anytype # }"},{"path":"http://svmiller.com/reference/add_lead.html","id":null,"dir":"Reference","previous_headings":"","what":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"add_lead() allows add data recorded LEAD data leader-year leader-dyad-year data.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"","code":"add_lead(data, keep)"},{"path":"http://svmiller.com/reference/add_lead.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"data leader-year leader-dyad-year data frame keep optional parameter, specified character vector, leader attributes user wants return function. keep specified, everything LEAD data package returned. Otherwise, function subsets LEAD data just user wants.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"add_lead() takes leader-year leader-dyad-year data frame adds data recorded LEAD data . leader-dyad-year data, suffices \"1\" \"2\" added data indicate attributes first leader (obsid1) second leader (obsid2), respectively.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"Ellis, Carli Mortenson, Michael C. Horowitz, Allan C. Stam. 2015. \"Introducing LEAD Data Set.\" International Interactions 41(4): 718--741.","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_lead.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add (Select) Leader Experience and Attribute Descriptions (LEAD) Data to Leader-Year or Leader-Dyad-Year Data — add_lead","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_leaderyears() %>% add_lead() #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 18 #> obsid leader gwcode gender leade…¹ year yrino…² level…³ milse…⁴ combat rebel #> #> 1 USA-… Grant 2 M 47 1869 1 2 1 1 0 #> 2 USA-… Grant 2 M 48 1870 2 2 1 1 0 #> 3 USA-… Grant 2 M 49 1871 3 2 1 1 0 #> 4 USA-… Grant 2 M 50 1872 4 2 1 1 0 #> 5 USA-… Grant 2 M 51 1873 5 2 1 1 0 #> 6 USA-… Grant 2 M 52 1874 6 2 1 1 0 #> 7 USA-… Grant 2 M 53 1875 7 2 1 1 0 #> 8 USA-… Grant 2 M 54 1876 8 2 1 1 0 #> 9 USA-… Grant 2 M 55 1877 9 2 1 1 0 #> 10 USA-… Hayes 2 M 55 1877 1 3 1 1 0 #> # … with 17,676 more rows, 7 more variables: warwin , warloss , #> # rebelwin , rebelloss , yrsexper , physhealth , #> # mentalhealth , and abbreviated variable names ¹​leaderage, ²​yrinoffice, #> # ³​leveledu, ⁴​milservice create_leaderyears() %>% add_lead(keep = c(\"yrsexper\")) #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 8 #> obsid leader gwcode gender leaderage year yrinoffice yrsexper #> #> 1 USA-1869 Grant 2 M 47 1869 1 0 #> 2 USA-1869 Grant 2 M 48 1870 2 0 #> 3 USA-1869 Grant 2 M 49 1871 3 0 #> 4 USA-1869 Grant 2 M 50 1872 4 0 #> 5 USA-1869 Grant 2 M 51 1873 5 0 #> 6 USA-1869 Grant 2 M 52 1874 6 0 #> 7 USA-1869 Grant 2 M 53 1875 7 0 #> 8 USA-1869 Grant 2 M 54 1876 8 0 #> 9 USA-1869 Grant 2 M 55 1877 9 0 #> 10 USA-1877 Hayes 2 M 55 1877 1 12 #> # … with 17,676 more rows # }"},{"path":"http://svmiller.com/reference/add_lwuf.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"add_lwuf() allows add estimates leader willingness use force leader-year data leader-dyad-year data.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"","code":"add_lwuf(data, keep)"},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"data leader-year leader dyad-year data frame generated peacesciencer keep optional argument, specified character vector, variables lwuf data frame user wants data. See lwuf data documentation . argument unspecified, function return measures leader willingness use force generated Carter Smith.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"add_lwuf() takes leader-year leader-dyad-year data frame adds estimates leader willingness use force, generated Carter Smith (2020).","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"See lwuf information, copy-paste . letter published Carter Smith (2020) contains information thetas refer. \"M1\" theta variation standard Rasch model boilerplate information LEAD data. authors consider \"theoretically relevant\" \"risk-related\" refer conflict risk-taking. \"M2\" theta expands \"M1\" including political orientation psychological characteristics. \"M3\" \"M4\" expand \"M1\" \"M2\" considering 36 variables LEAD data. authors construct include measures, though analyses suggest \"M2\" best-performing measure. probably consider using theta2_mean default estimate leader willingness use force leader-year analyses.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"Carter, Jeff Charles E. Smith, Jr. 2020. \"Framework Measuring Leaders' Willingness Use Force.\" American Political Science Review 114(4): 1352--1358.","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_lwuf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Estimates of Leader Willingness to Use Force to Leader-Year Data — add_lwuf","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) create_leaderyears() %>% add_lwuf() #> Joining with `by = join_by(obsid)` #> # A tibble: 17,686 × 15 #> obsid leader gwcode gender leaderage year yrino…¹ theta…² theta…³ theta…⁴ #> #> 1 USA-1869 Grant 2 M 47 1869 1 1.01 0.509 1.04 #> 2 USA-1869 Grant 2 M 48 1870 2 1.01 0.509 1.04 #> 3 USA-1869 Grant 2 M 49 1871 3 1.01 0.509 1.04 #> 4 USA-1869 Grant 2 M 50 1872 4 1.01 0.509 1.04 #> 5 USA-1869 Grant 2 M 51 1873 5 1.01 0.509 1.04 #> 6 USA-1869 Grant 2 M 52 1874 6 1.01 0.509 1.04 #> 7 USA-1869 Grant 2 M 53 1875 7 1.01 0.509 1.04 #> 8 USA-1869 Grant 2 M 54 1876 8 1.01 0.509 1.04 #> 9 USA-1869 Grant 2 M 55 1877 9 1.01 0.509 1.04 #> 10 USA-1877 Hayes 2 M 55 1877 1 0.464 0.545 0.472 #> # … with 17,676 more rows, 5 more variables: theta2_sd , #> # theta3_mean , theta3_sd , theta4_mean , theta4_sd , and #> # abbreviated variable names ¹​yrinoffice, ²​theta1_mean, ³​theta1_sd, #> # ⁴​theta2_mean # }"},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Add minimum distance data to your data frame — add_minimum_distance","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"add_minimum_distance() allows add minimum distance (kilometers) (dyad-year, leader-year, leader-dyad-year, state-year) data frame. estimates recorded cow_mindist gw_mindist data come package. data current end 2019.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"","code":"add_minimum_distance(data)"},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"add_minimum_distance() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds minimum distance first state second state (dyad-year data) minimum minimum (sic) distance given state given year.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"function leans attributes data provided one \"create\" functions package (e.g. create_dyadyear() create_stateyear()).","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24.","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_minimum_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add minimum distance data to your data frame — add_minimum_distance","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_minimum_distance() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 4 #> ccode1 ccode2 year mindist #> #> 1 2 20 1920 NA #> 2 2 20 1921 0 #> 3 2 20 1922 0 #> 4 2 20 1923 0 #> 5 2 20 1924 0 #> 6 2 20 1925 0 #> 7 2 20 1926 0 #> 8 2 20 1927 0 #> 9 2 20 1928 0 #> 10 2 20 1929 0 #> # … with 2,139,260 more rows create_dyadyears(system = \"gw\") %>% add_minimum_distance() #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 4 #> gwcode1 gwcode2 year mindist #> #> 1 2 20 1867 NA #> 2 2 20 1868 NA #> 3 2 20 1869 NA #> 4 2 20 1870 NA #> 5 2 20 1871 NA #> 6 2 20 1872 NA #> 7 2 20 1873 NA #> 8 2 20 1874 NA #> 9 2 20 1875 NA #> 10 2 20 1876 NA #> # … with 2,089,816 more rows create_stateyears(system =\"gw\") %>% add_minimum_distance() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 4 #> gwcode statename year minmindist #> #> 1 2 United States of America 1816 NA #> 2 2 United States of America 1817 NA #> 3 2 United States of America 1818 NA #> 4 2 United States of America 1819 NA #> 5 2 United States of America 1820 NA #> 6 2 United States of America 1821 NA #> 7 2 United States of America 1822 NA #> 8 2 United States of America 1823 NA #> 9 2 United States of America 1824 NA #> 10 2 United States of America 1825 NA #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_nmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Correlates of War National Military Capabilities Data — add_nmc","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"add_nmc() allows add Correlates War National Material Capabilities data data.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"","code":"add_nmc(data)"},{"path":"http://svmiller.com/reference/add_nmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"add_nmc() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information national material capabilities state two states dyad given year. data dyad-year (leader-dyad-year), function adds 12 total columns first state (.e. ccode1) second state (.e. ccode2) estimates national military capabilities provided Correlates War project. data state-year (leader-year), function returns six additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"Singer, J. David, Stuart Bremer, John Stuckey. (1972). \"Capability Distribution, Uncertainty, Major Power War, 1820-1965.\" Bruce Russett (ed) Peace, War, Numbers, Beverly Hills: Sage, 19-48. Singer, J. David. 1987. \"Reconstructing Correlates War Dataset Material Capabilities States, 1816-1985.\" International Interactions 14(1): 115-32.","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_nmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Correlates of War National Military Capabilities Data — add_nmc","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_nmc() #> # A tibble: 2,139,270 × 17 #> ccode1 ccode2 year milex1 milper1 irst1 pec1 tpop1 upop1 cinc1 milex2 #> #> 1 2 20 1920 1657118 343 42809 743808 106461 27428 0.290 10755 #> 2 2 20 1921 1116342 387 20101 622541 108538 28210 0.253 10209 #> 3 2 20 1922 860853 270 36173 641311 110049 29013 0.256 10028 #> 4 2 20 1923 678256 247 45665 834889 111947 29840 0.272 13316 #> 5 2 20 1924 570142 261 38540 762070 114109 30690 0.254 12824 #> 6 2 20 1925 589706 252 46122 790029 115829 31565 0.254 12984 #> 7 2 20 1926 558004 247 49069 852304 117397 32464 0.263 13936 #> 8 2 20 1927 596501 249 45656 842978 119035 33389 0.239 16745 #> 9 2 20 1928 678100 251 52371 833446 120509 34340 0.240 18862 #> 10 2 20 1929 701300 255 57339 903141 121767 35318 0.240 21058 #> # … with 2,139,260 more rows, and 6 more variables: milper2 , irst2 , #> # pec2 , tpop2 , upop2 , cinc2 create_stateyears() %>% add_nmc() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 10 #> ccode statenme year milex milper irst pec tpop upop cinc #> #> 1 2 United States of Ame… 1816 3823 17 80 254 8659 101 0.0397 #> 2 2 United States of Ame… 1817 2466 15 80 277 8899 106 0.0358 #> 3 2 United States of Ame… 1818 1910 14 90 302 9139 112 0.0361 #> 4 2 United States of Ame… 1819 2301 13 90 293 9379 118 0.0371 #> 5 2 United States of Ame… 1820 1556 15 110 303 9618 124 0.0371 #> 6 2 United States of Ame… 1821 1612 11 100 321 9939 130 0.0342 #> 7 2 United States of Ame… 1822 1079 10 100 332 10268 136 0.0329 #> 8 2 United States of Ame… 1823 1170 11 110 345 10596 143 0.0331 #> 9 2 United States of Ame… 1824 1261 11 110 390 10924 151 0.0330 #> 10 2 United States of Ame… 1825 1336 11 120 424 11252 158 0.0342 #> # … with 17,111 more rows"},{"path":"http://svmiller.com/reference/add_peace_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Peace Years to Your Conflict Data — add_peace_years","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"add_peace_years() calculates peace years ongoing conflicts. function works dyad-year state-year data generated peacesciencer. forthcoming v. 0.7.0, add_peace_years() deprecated generic versatile add_spells(). Users free continue function, though recommend balanced panels (like state-year dyad-year), less imbalanced panels (like leader-years, leader-dyad-years). change name implies, add_spells() greater flexibility cross-sectional units time.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"","code":"add_peace_years(data, pad = FALSE)"},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"data dyad-year data frame (either \"directed\" \"non-directed\") state-year data frame pad optional parameter, defaults FALSE. TRUE, peace-year calculations fill cases panels unbalanced/gaps. Think state like Germany disappearing 45 years illustrative .","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"add_peace_years() takes dyad-year state-year data frame adds peace years ongoing conflicts. Dyadic conflict data supported include Correlates War (CoW) Militarized Interstate Dispute (MID) data set Gibler-Miller-Little (GML) corrections CoW-MID. State-level conflict data supported function include UCDP armed conflict data CoW intra-state war data.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"function internally uses sbtscs() stevemisc. interest full disclosure, sbtscs() leans heavily btscs() DAMisc. optimized code performance. Importantly, underlying function (sbtscs() stevemisc, way btscs() DAMisc) important performance issues trying run event data sandwiched observations without event data. mean. Assume got full Gleditsch-Ward state-year data 1816 2020 added UCDP armed conflict data . want peace-years , function fail every year 1816 1945 (along 2020, writing) event data. can force function \"fail\" setting pad = TRUE argument, clear advisable reason. Assume wanted event data UCDP just extrasystemic onsets. data start 1946 , 1946, United Kingdom, Netherlands, France extrasystemic conflicts. years 1946, events imputed 1 countries 1s first year observation everyone else NA implicitly assumed zero. NAs, function runs sequence resulting wonky spells 1946 implied (absence ) data. fact, none implied absence data 1946. function works just fine truncate temporal domain reflect nature event data. Basically, want use function generally, filter dyad-year state-year data make sure years without event data recorded (e.g. CoW-MID analyses dyad-years observations 1816?). less problem years -NAs succeed (precede) event data. example, UCDP conflict data run 1946 2019 (writing). 2020 observations compromise function output pad = TRUE included argument. Finally, add_peace_years() calculate peace years leave temporal dependence adjustment taste researcher. Importantly, recommend manually creating splines square/cube terms creates problems adjusting temporal dependence model predictions. regression formula R, can specify Carter Signorino (2010) approach ... + gmlmidspell + (gmlmidspell^2) + (gmlmidspell^3) (assuming ran add_peace_years() dyad-year data frame including Gibler-Miller-Little conflict data). Beck et al. cubic splines approach ... + splines::bs(gmlmidspell, 4). function includes spell three splines (hence 4 command). Either approach makes easier model predictions, given R's functionality.","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"Armstrong, Dave. 2016. ``DAMisc: Dave Armstrong's Miscellaneous Functions.'' R package version 1.4-3. Beck, Nathaniel, Jonathan N. Katz, Richard Tucker. 1998. \"Taking Time Seriously: Time-Series-Cross-Section Analysis Binary Dependent Variable.\" American Journal Political Science 42(4): 1260--1288. Carter, David B. Curtis S. Signorino. 2010. \"Back Future: Modeling Time Dependence Binary Data.\" Political Analysis 18(3): 271--292. Miller, Steven V. 2017. ``Quickly Create Peace Years BTSCS Models sbtscs stevemisc.'' http://svmiller.com/blog/2017/06/quickly-create-peace-years--btscs-models--stevemisc/","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_peace_years.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Peace Years to Your Conflict Data — add_peace_years","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_gml_mids(keep = NULL) %>% add_cow_mids(keep = NULL) %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() %>% add_peace_years() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(year, dyad)` #> Joining with `by = join_by(year, dyad)` #> # A tibble: 246,302 × 19 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 246,292 more rows, 8 more variables: cowmidonset , #> # cowmidongoing , conttype , cowmaj1 , cowmaj2 , #> # prd , cowmidspell , gmlmidspell , and abbreviated variable #> # name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Add rugged terrain information to a data frame — add_rugged_terrain","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"add_rugged_terrain() allows add information, however crude, \"ruggedness\" state's terrain (dyad-year, leader-year, leader-dyad-year, state-year) data.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"","code":"add_rugged_terrain(data)"},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"add_rugged_terrain() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame, whether primary state identifiers Correlates War system Gleditsch-Ward system, returns information \"ruggedness\" state's terrain. two indicators returned \"terrain ruggedness index\" calculated Nunn Puga (2012) logarithmic transformation mountainous state (calculated Gibler Miller, 2014). dyad-year (leader-dyad-year) data get four additional columns (.e. indicators states dyad) whereas state-year data get just two additional columns.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Please see information underlying data rugged, associated R script data-raw directory, see data generated. Importantly, data time-agnostic move slowly. talking geography . data sets benchmark around 1999-2000 leap faith use data comparisons across entirety Correlates War Gleditsch-Ward system membership. Every use data types either cross-sectional snapshots making state--state comparisons World War II (think prominent civil war studies ). mindful expect get data. underlying data Gleditsch-Ward codes Correlates War codes. merge makes depends declare \"master\" system top pipe (e.g.. create_dyadyears() create_stateyears()). , example, run create_stateyears(system=\"cow\") follow add_gwcode_to_cow(), merge Correlates War codes Gleditsch-Ward codes. can see script mechanics see achieved.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Fearon, James D., David Laitin, \"Ethnicity, Insurgency, Civil War\" American Political Science Review 97: 75–90. Gibler, Douglas M. Steven V. Miller. 2014. \"External Territorial Threat, State Capacity, Civil War.\" Journal Peace Research 51(5): 634-646. Nunn, Nathan Diego Puga. 2012. \"Ruggedness: Blessing Bad Geography Africa.\" Review Economics Statistics. 94(1): 20-36. Riley, Shawn J., Stephen D. DeGloria, Robert Elliot. 1999. \"Terrain Ruggedness Index Quantifies Topographic Heterogeneity,” Intermountain Journal Sciences 5: 23–27.","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_rugged_terrain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add rugged terrain information to a data frame — add_rugged_terrain","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_rugged_terrain() #> # A tibble: 2,139,270 × 7 #> ccode1 ccode2 year rugged1 newlmtnest1 rugged2 newlmtnest2 #> #> 1 2 20 1920 1.07 3.21 0.775 2.80 #> 2 2 20 1921 1.07 3.21 0.775 2.80 #> 3 2 20 1922 1.07 3.21 0.775 2.80 #> 4 2 20 1923 1.07 3.21 0.775 2.80 #> 5 2 20 1924 1.07 3.21 0.775 2.80 #> 6 2 20 1925 1.07 3.21 0.775 2.80 #> 7 2 20 1926 1.07 3.21 0.775 2.80 #> 8 2 20 1927 1.07 3.21 0.775 2.80 #> 9 2 20 1928 1.07 3.21 0.775 2.80 #> 10 2 20 1929 1.07 3.21 0.775 2.80 #> # … with 2,139,260 more rows create_stateyears() %>% add_rugged_terrain() #> Joining with `by = join_by(ccode)` #> # A tibble: 17,121 × 5 #> ccode statenme year rugged newlmtnest #> #> 1 2 United States of America 1816 1.07 3.21 #> 2 2 United States of America 1817 1.07 3.21 #> 3 2 United States of America 1818 1.07 3.21 #> 4 2 United States of America 1819 1.07 3.21 #> 5 2 United States of America 1820 1.07 3.21 #> 6 2 United States of America 1821 1.07 3.21 #> 7 2 United States of America 1822 1.07 3.21 #> 8 2 United States of America 1823 1.07 3.21 #> 9 2 United States of America 1824 1.07 3.21 #> 10 2 United States of America 1825 1.07 3.21 #> # … with 17,111 more rows create_stateyears(system = \"gw\") %>% add_rugged_terrain() #> Joining with `by = join_by(gwcode)` #> # A tibble: 18,637 × 5 #> gwcode statename year rugged newlmtnest #> #> 1 2 United States of America 1816 1.07 3.21 #> 2 2 United States of America 1817 1.07 3.21 #> 3 2 United States of America 1818 1.07 3.21 #> 4 2 United States of America 1819 1.07 3.21 #> 5 2 United States of America 1820 1.07 3.21 #> 6 2 United States of America 1821 1.07 3.21 #> 7 2 United States of America 1822 1.07 3.21 #> 8 2 United States of America 1823 1.07 3.21 #> 9 2 United States of America 1824 1.07 3.21 #> 10 2 United States of America 1825 1.07 3.21 #> # … with 18,627 more rows # }"},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"add_sdp_gdp() allows add estimated GDP \"surplus\" domestic product data 2020 analysis published International Studies Quarterly Anders, Fariss, Markowitz.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"","code":"add_sdp_gdp(data)"},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"data data frame appropriate peacesciencer attributes","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"add_sdp_gdp() takes (dyad-year, leader-year, leader-dyad-year, state-year) data frame adds information estimated gross domestic product (2011 USD) year, estimated population year, GDP per capita year, Anders, Fariss Markowitz term \"surplus domestic product\" year. data dyad-year (leader-dyad-year), function adds eight total columns first state (.e. ccode1) second state (.e. ccode2) estimates. data state-year (leader-year), function returns four additional columns original data contain information given state given year.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"function leans attributes data provided one \"create\" functions. Make sure recognized function (data created function) appear top proverbial pipe. Users also want note underlying function access two different data sets. appears results published International Studies Quarterly used Correlates War classification, follow-repository Github uses Gleditsch-Ward classification. extent estimates generated simulation, mean estimates slightly different across data sets even common observations (e.g. United States 1816). large nominal numbers, estimates log-transformed. Users can always exponentiate choose. Researchers can use data construct reasonable estimates surplus GDP per capita, must exponentiate underlying variables . mindful data fundamentally state-year extensions leader-level data understood approximations leaders given state-year.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_sdp_gdp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add (Surplus and Gross) Domestic Product Data — add_sdp_gdp","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_sdp_gdp() #> # A tibble: 2,139,270 × 11 #> ccode1 ccode2 year wbgdp20…¹ wbpop…² sdpest1 wbgdp…³ wbgdp…⁴ wbpop…⁵ sdpest2 #> #> 1 2 20 1920 27.6 18.4 27.5 9.19 24.8 15.9 24.7 #> 2 2 20 1921 27.6 18.5 27.5 9.18 24.8 16.0 24.6 #> 3 2 20 1922 27.7 18.5 27.6 9.21 24.8 16.0 24.7 #> 4 2 20 1923 27.8 18.5 27.7 9.26 24.9 16.0 24.7 #> 5 2 20 1924 27.8 18.5 27.7 9.30 24.9 16.0 24.8 #> 6 2 20 1925 27.9 18.5 27.8 9.32 25.0 16.0 24.9 #> 7 2 20 1926 27.9 18.5 27.8 9.34 25.1 16.0 24.9 #> 8 2 20 1927 27.9 18.6 27.8 9.35 25.1 16.1 25.0 #> 9 2 20 1928 27.9 18.6 27.8 9.36 25.2 16.1 25.0 #> 10 2 20 1929 27.9 18.6 27.8 9.35 25.1 16.1 25.0 #> # … with 2,139,260 more rows, 1 more variable: wbgdppc2011est2 , and #> # abbreviated variable names ¹​wbgdp2011est1, ²​wbpopest1, ³​wbgdppc2011est1, #> # ⁴​wbgdp2011est2, ⁵​wbpopest2 create_stateyears() %>% add_sdp_gdp() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year wbgdp2011est wbpopest sdpest wbgdppc20…¹ #> #> 1 2 United States of America 1816 23.6 15.9 22.9 7.66 #> 2 2 United States of America 1817 23.6 16.0 22.9 7.64 #> 3 2 United States of America 1818 23.6 16.0 22.9 7.64 #> 4 2 United States of America 1819 23.7 16.0 23.0 7.66 #> 5 2 United States of America 1820 23.7 16.1 23.0 7.66 #> 6 2 United States of America 1821 23.8 16.1 23.1 7.68 #> 7 2 United States of America 1822 23.8 16.1 23.1 7.70 #> 8 2 United States of America 1823 23.8 16.1 23.1 7.69 #> 9 2 United States of America 1824 23.9 16.2 23.2 7.69 #> 10 2 United States of America 1825 23.9 16.2 23.3 7.72 #> # … with 17,111 more rows, and abbreviated variable name ¹​wbgdppc2011est create_stateyears(system = \"gw\") %>% add_sdp_gdp() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 7 #> gwcode statename year wbgdp2011est wbpopest sdpest wbgdppc2…¹ #> #> 1 2 United States of America 1816 23.6 15.9 22.8 7.66 #> 2 2 United States of America 1817 23.6 16.0 22.8 7.64 #> 3 2 United States of America 1818 23.6 16.0 22.9 7.64 #> 4 2 United States of America 1819 23.7 16.0 22.9 7.66 #> 5 2 United States of America 1820 23.7 16.1 23.0 7.66 #> 6 2 United States of America 1821 23.8 16.1 23.0 7.68 #> 7 2 United States of America 1822 23.8 16.1 23.1 7.70 #> 8 2 United States of America 1823 23.8 16.1 23.1 7.69 #> 9 2 United States of America 1824 23.9 16.2 23.2 7.69 #> 10 2 United States of America 1825 23.9 16.2 23.2 7.72 #> # … with 18,627 more rows, and abbreviated variable name ¹​wbgdppc2011est"},{"path":"http://svmiller.com/reference/add_spells.html","id":null,"dir":"Reference","previous_headings":"","what":"Add ","title":"Add ","text":"add_spells() calculates \"spells\" state-year, leader-year, dyad-year data. application mostly concerned things like \"peace spells\" conflicts given cross-sectional unit (e.g. state dyad).","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add ","text":"","code":"add_spells(data, conflict_event_type = \"ongoing\", ongo = FALSE)"},{"path":"http://svmiller.com/reference/add_spells.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add ","text":"data applicable data frame (e.g. leader-year, dyad-year, state-year, created peacesciencer) conflict_event_type type event spells calculated, either \"ongoing\" \"onset\". Default \"ongoing\". \"ongoing\", spells calculated presence ongoing event. \"onset\", spells calculated onset conflict event successive zeros (observed) calculated \"peace\". See Details section . ongo TRUE, successive 1s considered ongoing events treated NA first 1. FALSE, successive 1s treated failures. Defaults FALSE.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add ","text":"add_spells() takes dyad-year, leader-year, state-year data frame adds spells ongoing conflicts. Dyadic conflict data supported include Correlates War (CoW) Militarized Interstate Dispute (MID) data set Gibler-Miller-Little (GML) corrections CoW-MID. State-level conflict data supported function include UCDP armed conflict data CoW intra-state war data. Leader-year conflict data supported include GML MID data.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add ","text":"function internally uses ps_spells() stevemisc. interest full disclosure, ps_spells() leans heavily add_duration() spduration. optimized code performance. Thinking application like peace-years, add_spells() calculate peace years leave temporal dependence adjustment taste researcher. Importantly, recommend manually creating splines square/cube terms creates problems adjusting temporal dependence model predictions. regression formula R, can specify Carter Signorino (2010) approach ... + gmlmidspell + (gmlmidspell^2) + (gmlmidspell^3) (assuming ran add_spells() dyad-year data frame including Gibler-Miller-Little conflict data). Beck et al. cubic splines approach ... + splines::bs(gmlmidspell, 4). function includes spell three splines (hence 4 command). Either approach makes easier model predictions, given R's functionality. Thinking dyadic analyses conflict, always understood something like \"peace-years\" calculated ongoing event onset event. Think something like Iran-Iraq War (MID#2115) illustrative . MID (became war) started 1980 ended 1988. bilateral incidents Iran-Iraq independent war, per Correlates War coding rules. peace years calculated \"onset\" event, list peace-years two countries 1981 1988. never understood make sense, still seen others insist correct way . add_peace_years() force calculation ongoing event, still maintain correct. add_spells() allow calculate onsets, even ongoing events default. underlying function add_spells() stop without return NAs bracketing observed events. surest way happen something like dyad-year analysis inter-state conflicts 1816 2010, create_dyadyears() created observations 2011 2020 well. Remove using function confine temporal domain just time-units (e.g. years) observed event data. See example .","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add ","text":"Beger, Andreas, Daina Chiba, Daniel W. Hill, Jr, Nils W. Metternich, Shahryar Minhas Michael D. Ward. 2018. ``spduration: Split-Population Duration (Cure) Regression.'' R package version 0.17.1. Beck, Nathaniel, Jonathan N. Katz, Richard Tucker. 1998. \"Taking Time Seriously: Time-Series-Cross-Section Analysis Binary Dependent Variable.\" American Journal Political Science 42(4): 1260--1288. Carter, David B. Curtis S. Signorino. 2010. \"Back Future: Modeling Time Dependence Binary Data.\" Political Analysis 18(3): 271--292.","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add ","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_spells.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add ","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) aaa <- subset(cow_ddy, year <= 2010) aaa %>% add_gml_mids(keep = NULL) %>% add_cow_mids(keep = NULL) %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() %>% add_spells() #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_gml_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> add_cow_mids() IMPORTANT MESSAGE: By default, this function whittles dispute-year data into dyad-year data by first selecting on unique onsets. Thereafter, where duplicates remain, it whittles dispute-year data into dyad-year data in the following order: 1) retaining highest `fatality`, 2) retaining highest `hostlev`, 3) retaining highest estimated `mindur`, 4) retaining highest estimated `maxdur`, 5) retaining reciprocated over non-reciprocated observations, 6) retaining the observation with the lowest start month, and, where duplicates still remained (and they don't), 7) forcibly dropping all duplicates for observations that are otherwise very similar. #> See: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html #> Joining with `by = join_by(ccode1, ccode2, year)` #> Joining with `by = join_by(orig_order)` #> Joining with `by = join_by(orig_order)` #> # A tibble: 224,564 × 19 #> ccode1 ccode2 year gmlmidonset gmlmi…¹ init1 init2 sidea1 sidea2 orig1 orig2 #> #> 1 2 20 1920 0 0 NA NA NA NA NA NA #> 2 2 20 1921 0 0 NA NA NA NA NA NA #> 3 2 20 1922 0 0 NA NA NA NA NA NA #> 4 2 20 1923 0 0 NA NA NA NA NA NA #> 5 2 20 1924 0 0 NA NA NA NA NA NA #> 6 2 20 1925 0 0 NA NA NA NA NA NA #> 7 2 20 1926 0 0 NA NA NA NA NA NA #> 8 2 20 1927 0 0 NA NA NA NA NA NA #> 9 2 20 1928 0 0 NA NA NA NA NA NA #> 10 2 20 1929 0 0 NA NA NA NA NA NA #> # … with 224,554 more rows, 8 more variables: cowmidonset , #> # cowmidongoing , conttype , cowmaj1 , cowmaj2 , #> # prd , gmlmidspell , cowmidspell , and abbreviated variable #> # name ¹​gmlmidongoing # }"},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() merges Thompson Dreyer's (2012) strategic rivalry data dyad-year data frame. right-bound, right now, bound 2010.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"","code":"add_strategic_rivalries(data, across_types = 1)"},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"data dyad-year data frame (either \"directed\" \"non-directed\") across_types optional, relevant state-year, takes value 1, 2, 3 look whether one three types fits criteria ideological, interventionary, positional, spatial rivalry. Defaults 1.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() takes dyad-year data frame adds information ongoing strategic rivalries. also include simple dummy variable whether ongoing rivalry year . state-year data, returns count ongoing strategic rivalries state year meeting certain criteria (.e. whether state interventionary, ideological, positional, spatial rivalry ongoing year, many).","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"add_strategic_rivalries() include information derived rivalry data user may want (e.g. start year rivalry). Feel free select fact. Function includes --fly adjustment Austria rivalry #79. case, Austria-Serbia rivalry continues two years Austria-Hungary (ccode: 300) became Austria (ccode: 305). across_types argument optional observed state-year calls. defaults 1. default, function looks rivalry data (td_rivalries) focuses type1 column. , say, state ongoing rivalry primarily spatial, codes spatial rivalry. Assume input across_types = 2, function looks across type1 type2 columns see spatial component rivalry either primary secondary dimension. , codes 1. across_types must 1, 2, 3.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R. David Dreyer. 2012. Handbook International Rivalries. CQ Press.","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_strategic_rivalries.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Thompson and Dreyer's (2012) strategic rivalry data to dyad-year data frame — add_strategic_rivalries","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_strategic_rivalries() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 12 #> ccode1 ccode2 year rivalryno rival…¹ styear endyear region type1 type2 type3 #> #> 1 2 20 1920 NA NA NA NA NA NA NA NA #> 2 2 20 1921 NA NA NA NA NA NA NA NA #> 3 2 20 1922 NA NA NA NA NA NA NA NA #> 4 2 20 1923 NA NA NA NA NA NA NA NA #> 5 2 20 1924 NA NA NA NA NA NA NA NA #> 6 2 20 1925 NA NA NA NA NA NA NA NA #> 7 2 20 1926 NA NA NA NA NA NA NA NA #> 8 2 20 1927 NA NA NA NA NA NA NA NA #> 9 2 20 1928 NA NA NA NA NA NA NA NA #> 10 2 20 1929 NA NA NA NA NA NA NA NA #> # … with 2,139,260 more rows, 1 more variable: ongoingrivalry , and #> # abbreviated variable name ¹​rivalryname # across_types defaults to 1 create_stateyears() %>% add_strategic_rivalries() #> Joining with `by = join_by(ccode, year)` #> # A tibble: 17,121 × 7 #> ccode statenme year ideological interventi…¹ posit…² spatial #> #> 1 2 United States of America 1816 0 0 1 1 #> 2 2 United States of America 1817 0 0 1 1 #> 3 2 United States of America 1818 0 0 1 1 #> 4 2 United States of America 1819 0 0 1 1 #> 5 2 United States of America 1820 0 0 1 0 #> 6 2 United States of America 1821 0 0 1 1 #> 7 2 United States of America 1822 0 0 1 1 #> 8 2 United States of America 1823 0 0 1 1 #> 9 2 United States of America 1824 0 0 1 1 #> 10 2 United States of America 1825 0 0 1 1 #> # … with 17,111 more rows, and abbreviated variable names ¹​interventionary, #> # ²​positional # }"},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":null,"dir":"Reference","previous_headings":"","what":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"add_ucdp_acd() allows add UCDP Armed Conflict data state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"","code":"add_ucdp_acd(data, type, issue, only_wars = FALSE)"},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"data state-year data frame type types armed conflicts user wants consider, specified character vector. Options include \"extrasystemic\", \"interstate\", \"intrastate\", \"II\". \"II\" convenience shorthand \"internationalized intrastate\". want just one (say: \"intrastate\"), type want quotes sufficient. want multiple, wrap vector c(). issue want subset data just different armed conflicts different types issues? , specify type argument. Options include \"territory\", \"government\", \"\". only_wars subsets conflict data just intensity levels \"war\" (.e. >1,000 deaths). Defaults FALSE.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"add_ucdp_acd() takes state-year data frame returns state-year information UCDP Armed Conflict data set (v. 20.1). variables returned whether ongoing armed conflict year, whether armed conflict episode onset year, maximum intensity observed year (armed conflict observed), character vector associated conflict IDs year.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Right now, state-year data supported. worth saying \"\" issue argument understood equivalent c(\"territory\",\"government\"). former kind \"\" (boolean speak) explicit category data. latter \"\" (boolean speak) likelihood want tempted specify \"\" issue argument.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ucdp_acd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add UCDP Armed Conflict Data to state-year data frame — add_ucdp_acd","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union create_stateyears(system = \"gw\") %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 10,490 × 7 #> gwcode statename year ucdpongoing ucdponset maxinte…¹ confl…² #> #> 1 2 United States of America 1946 0 0 NA NA #> 2 2 United States of America 1947 0 0 NA NA #> 3 2 United States of America 1948 0 0 NA NA #> 4 2 United States of America 1949 0 0 NA NA #> 5 2 United States of America 1950 1 1 1 238 #> 6 2 United States of America 1951 0 0 NA NA #> 7 2 United States of America 1952 0 0 NA NA #> 8 2 United States of America 1953 0 0 NA NA #> 9 2 United States of America 1954 0 0 NA NA #> 10 2 United States of America 1955 0 0 NA NA #> # … with 10,480 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids create_stateyears(system = \"gw\") %>% filter(between(year, 1946, 2019)) %>% add_ucdp_acd(type = \"intrastate\", issue = \"government\") #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 10,490 × 7 #> gwcode statename year ucdpongoing ucdponset maxinte…¹ confl…² #> #> 1 2 United States of America 1946 0 0 NA NA #> 2 2 United States of America 1947 0 0 NA NA #> 3 2 United States of America 1948 0 0 NA NA #> 4 2 United States of America 1949 0 0 NA NA #> 5 2 United States of America 1950 0 0 NA NA #> 6 2 United States of America 1951 0 0 NA NA #> 7 2 United States of America 1952 0 0 NA NA #> 8 2 United States of America 1953 0 0 NA NA #> 9 2 United States of America 1954 0 0 NA NA #> 10 2 United States of America 1955 0 0 NA NA #> # … with 10,480 more rows, and abbreviated variable names ¹​maxintensity, #> # ²​conflict_ids"},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"Add UCDP onsets to state-year data — add_ucdp_onsets","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"add_ucdp_onsets() allows add information conflict episode onsets UCDP data program state-year data.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"","code":"add_ucdp_onsets(data)"},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"data state-year data frame","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"add_ucdp_onsets() takes state-year data frame adds summary variables based armed conflict onsets data provided UCDP. variables returned sum new conflict dyads (exist) given state-year, sum new onset episodes (new conflicts) separated one, two, three, five, 10 years since last conflict episode.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe. underlying data version 19.1. Importantly, UCDP yearly onset data nominally state-year, technically state-dyad-episode-year cases onsets. example, four France-1946 observations four new conflict episodes Cambodia, Laos, Thailand, Vietnam. two Panama-1989 episodes, one invasion United States another failed coup attempt. means duplicates original data process summaries. user probably want consider kind recoding .","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/add_ucdp_onsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add UCDP onsets to state-year data — add_ucdp_onsets","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) library(dplyr) create_stateyears(system=\"gw\") %>% add_ucdp_onsets() #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 9 #> gwcode statename year sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ #> #> 1 2 United States o… 1816 0 0 0 0 0 0 #> 2 2 United States o… 1817 0 0 0 0 0 0 #> 3 2 United States o… 1818 0 0 0 0 0 0 #> 4 2 United States o… 1819 0 0 0 0 0 0 #> 5 2 United States o… 1820 0 0 0 0 0 0 #> 6 2 United States o… 1821 0 0 0 0 0 0 #> 7 2 United States o… 1822 0 0 0 0 0 0 #> 8 2 United States o… 1823 0 0 0 0 0 0 #> 9 2 United States o… 1824 0 0 0 0 0 0 #> 10 2 United States o… 1825 0 0 0 0 0 0 #> # … with 18,627 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 create_stateyears() %>% add_gwcode_to_cow() %>% add_ucdp_onsets() #> Joining with `by = join_by(ccode, year)` #> Joining with `by = join_by(year, gwcode)` #> # A tibble: 17,121 × 10 #> ccode statenme year gwcode sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ #> #> 1 2 United St… 1816 2 0 0 0 0 0 0 #> 2 2 United St… 1817 2 0 0 0 0 0 0 #> 3 2 United St… 1818 2 0 0 0 0 0 0 #> 4 2 United St… 1819 2 0 0 0 0 0 0 #> 5 2 United St… 1820 2 0 0 0 0 0 0 #> 6 2 United St… 1821 2 0 0 0 0 0 0 #> 7 2 United St… 1822 2 0 0 0 0 0 0 #> 8 2 United St… 1823 2 0 0 0 0 0 0 #> 9 2 United St… 1824 2 0 0 0 0 0 0 #> 10 2 United St… 1825 2 0 0 0 0 0 0 #> # … with 17,111 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 # Recall, these are summaries. You'll need to post-process to what you want. create_stateyears(system=\"gw\") %>% add_ucdp_onsets() %>% mutate(onset = ifelse(sumonset1 > 0, 1, 0)) #> Joining with `by = join_by(gwcode, year)` #> # A tibble: 18,637 × 10 #> gwcode statename year sumne…¹ sumon…² sumon…³ sumon…⁴ sumon…⁵ sumon…⁶ onset #> #> 1 2 United St… 1816 0 0 0 0 0 0 0 #> 2 2 United St… 1817 0 0 0 0 0 0 0 #> 3 2 United St… 1818 0 0 0 0 0 0 0 #> 4 2 United St… 1819 0 0 0 0 0 0 0 #> 5 2 United St… 1820 0 0 0 0 0 0 0 #> 6 2 United St… 1821 0 0 0 0 0 0 0 #> 7 2 United St… 1822 0 0 0 0 0 0 0 #> 8 2 United St… 1823 0 0 0 0 0 0 0 #> 9 2 United St… 1824 0 0 0 0 0 0 0 #> 10 2 United St… 1825 0 0 0 0 0 0 0 #> # … with 18,627 more rows, and abbreviated variable names ¹​sumnewconf, #> # ²​sumonset1, ³​sumonset2, ⁴​sumonset3, ⁵​sumonset5, ⁶​sumonset10 # }"},{"path":"http://svmiller.com/reference/archigos.html","id":null,"dir":"Reference","previous_headings":"","what":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"leader-level data drawn Archigos data. Space considerations mean offer just columns based data. Data version 4.1.","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"","code":"archigos"},{"path":"http://svmiller.com/reference/archigos.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"data frame 3409 observations following 11 variables. gwcode numeric vector Gleditsch-Ward state code obsid character vector observation ID leadid unique leader identifier leader leader name yrborn year leader born gender categorical variable leader gender (\"M\" men, \"W\" women) startdate date leader start date enddate date leader end date entry character vector leader's entry type exit character vector leader's exit type exitcode character vector information leader's exit type","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"Space considerations mean can offer columns overall data. Archigos data rich information. Consult raw data available Hein Goeman's website . best conform data requirements CRAN, leader names renamed included irregular characters (e.g. umlauts accents). leaders, particular applications, hav renamed \"(Juan Orlando) Hernandez\" (HON-2014), \"(Antonio) Saca Gonzalez\" (SAL-2004), \"Julian Trujillo Largacha\" (COL-1878), \"Cesar Gaviria Trujillo\" (COL-1990), \"Gabriel Garcia Moreno\" (ECU-1869), \"Marcos . Morinigo\" (PAR-1894-1), \"Higinio Morinigo\" (PAR-1940), \"Sebastian Pinera\" (CHL-2010), \"Sauli Niinisto\" (FIN-2012), \"Louis Gerhard De Geer\" (SWD-1876), \"Stefan Lofven\" (SWD-2014), \"Lars Lokke Rasmussen\" (DEN-2009, DEN-2015), \"Fernando de Araujo\" (ETM-2008-1). None names contain special characters data . clarity's sake, renamed ccode column raw data gwcode. may deceive user peeking data Correlates War state codes, Gleditsch-Ward state codes.","code":""},{"path":"http://svmiller.com/reference/archigos.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Archigos: A (Subset of a) Dataset on Political Leaders — archigos","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"directed dyad-year-level data alliance obligations provisions ATOP project","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"","code":"atop_alliance"},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"data frame 272,046 observations following eight variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year atop_defense numeric vector equals 1 alliance observed defense pledge atop_offense numeric vector equals 1 alliance observed offense pledge atop_neutral numeric vector equals 1 alliance observed neutrality pledge atop_nonagg numeric vector equals 1 alliance observed non-aggression pledge atop_consul numeric vector equals 1 alliance observed consultation pledge","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"data-raw directory project's Github shows data processed.","code":""},{"path":"http://svmiller.com/reference/atop_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alliance Treaty Obligations and Provisions (ATOP) Project Data (v. 5.0) — atop_alliance","text":"Leeds, Brett Ashley, Jeffrey M. Ritter, Sara McLaughlin Mitchell, Andrew G. Long. 2002. Alliance Treaty Obligations Provisions, 1815-1944. International Interactions 28: 237-60.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Democracy data for all Correlates of War states — ccode_democracy","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"democracy data Correlates War state system members.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"","code":"ccode_democracy"},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"data frame 16536 observations following 5 variables. ccode Correlates War system code year numeric vector year v2x_polyarchy Varieties Democracy \"polyarchy\" estimate polity2 polity2 score Polity project xm_qudsest extension Unified Democracy Scores (UDS) estimates, made possibly QuickUDS package Xavier Marquez.","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"Missing data connote data unavailable various reasons. Either democracy data code , case Polity project, state system member outright evaluated variable. Polity data 2017. Varieties Democracy data version 10. Xavier Marquez' QuickUDS estimates (.e. extensions Pemstein et al. (2010)) come package Marquez makes available Github (https://github.com/xmarquez/QuickUDS).","code":""},{"path":"http://svmiller.com/reference/ccode_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Democracy data for all Correlates of War states — ccode_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War directed dyad-year alliance data — cow_alliance","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"version 4.1 Correlates War directed dyad-year alliance data.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"","code":"cow_alliance"},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"data frame 120784 observations following 7 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year cow_defense numeric vector equals 1 alliance included defense pledge cow_neutral numeric vector equals 1 alliance included neutrality pledge cow_nonagg numeric vector equals 1 alliance included non-aggression pledge cow_entente numeric vector equals 1 alliance included pledge consult crisis occurred","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"directed dyad-year alliance data alliance initiations, straight dyad-years, \"per se.\" suggests presence duplicate directed dyad-years. computing ease, given intended use, take care duplicate dyad-years behind scenes. Consider case U.S. Canada 1958. Therein, apparently two separate alliance initiations included defense pledges. behind--scenes cleaning process groups ccode1, ccode2, year summarizes alliance pledge variables. replace value greater 1 1. indicates presence absence defense pledge given directed dyad-year.","code":""},{"path":"http://svmiller.com/reference/cow_alliance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War directed dyad-year alliance data — cow_alliance","text":"Gibler, Douglas M. 2009. International Military Alliances, 1648-2008. Congressional Quarterly Press.","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":null,"dir":"Reference","previous_headings":"","what":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"complete list capitals capital transitions Correlates War state system members. use internally calculating capital--capital distances add_capital_distances() function.","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"","code":"cow_capitals"},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"data frame 252 observations following 7 variables. ccode numeric vector Correlates War state code statenme character vector state capital character vector name capital styear character vector start year. See details section information. endyear character vector end year. See details section information. lat numeric vector latitude coordinates capital lng numeric vector longitude coordinates capital","code":""},{"path":"http://svmiller.com/reference/cow_capitals.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A complete list of capitals and capital transitions for Correlates of War state system members — cow_capitals","text":"convenience, start year states 1816. Samoa, example, state 1816. However, functions use cow_capitals data create observations states exist given point time. data current end 2020. Cases start year 1816 indicate capital transition. example, Brazil's capital moved Rio de Janeiro Brasilia (planned capital) 1960. 25 states data experienced capital transition. recent Burundi 2018. Indonesia, writing, planning capital transition, completed yet. Kazakhstan renamed capital state leader 2019. data retain name Astana. changed event software use records change. capitals data without peculiarities. Prominently, Portugal transferred Portuguese court Lisbon Rio de Janeiro 1808 1821. recorded data. knowledge inter-state conflict data note war dispute , say, Portugal Spain (Portugal country) point time, create weirdness suggest massive distance two countries, like Portugal Spain, otherwise land-contiguous. Spain: republican government moved capital start civil war (1936) Valencia. However, abandoned capital 1937. elect record capital transition. data also (think) reasonable back-dating capitals coincide states transition without necessarily formal capitals first appearance state system membership data. concern Lithuania, Kazakhstan, Philippines. Kaunas initial post-independence capital Lithuania. Almaty initial post-independence capital Kazakhstan. Quezon City initial post-independence capital Philippines. concerns, , one two years three countries.","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"contain abbreviated version \"master records\" Correlates War direct contiguity data. Data contain cosmetic changes assist functions downstream .","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"","code":"cow_contdir"},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"data frame 2025840 observations following 4 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state conttype numeric vector contiguity relationship begin year-month contiguity relationship begins (YYYYMM) end year-month contiguity relationship ends (YYYYMM)","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"\"master record\" provided Correlates War \"non-directed.\" make data \"directed\" convenience. clarity, contiguity codes range 1 5. 1 = direct land contiguity. 2 = separated 12 miles water fewer (la Stannis Baratheon). 3 = separated 24 miles water fewer (12 miles). 4 = separated 150 miles water fewer (24 miles). 5 = separated 400 miles water fewer (150 miles). Cases separation 400 miles water included master record (easily discerned based complete dyad-year data).","code":""},{"path":"http://svmiller.com/reference/cow_contdir.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Direct Contiguity Data (v. 3.2) — cow_contdir","text":"Stinnett, Douglas M., Jaroslav Tir, Philip Schafer, Paul F. Diehl, Charles Gochman (2002). \"Correlates War Project Direct Contiguity Data, Version 3.\" Conflict Management Peace Science 19 (2):58-66.","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":null,"dir":"Reference","previous_headings":"","what":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"complete directed dyad-year data frame Correlates War state system members. offer shortcut various functions working new additions want invest time waiting create_dyadyears() run. general rule, data frame updated every calendar year include recently concluded calendar year.","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"","code":"cow_ddy"},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"data frame following 3 variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year","code":""},{"path":"http://svmiller.com/reference/cow_ddy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A directed dyad-year data frame of Correlates of War state system members — cow_ddy","text":"Data quick generation create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"complete (believe) data set Correlates War states Gleditsch-Ward states, byproduct full_join() gw_states cow_states leans largely state abbreviation variable.","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"","code":"cow_gw_years"},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"data frame 16936 observations following 6 variables. gwcode Gleditsch-Ward state code stateabb state abbreviation, greatest source agreement data sets gw_statename state name appears Gleditsch-Ward data ccode Correlates War state code cow_statename state name appears Correlates War data year numeric vector year","code":""},{"path":"http://svmiller.com/reference/cow_gw_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War and Gleditsch-Ward states, by year — cow_gw_years","text":"data-raw directory project's Github contains information data created. going use internal stuff. workflow going treat Correlates War state system membership codes \"master\" codes, user can add Gleditsch-Ward identifiers see fit. Data extended 2020, assuming changes state system membership either data set.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"non-directed dyad-year version Correlates War IGOs data. use internally merging IGOs data dyad-year data.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"","code":"cow_igo_ndy"},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"data frame 917695 observations following 4 variables. ccode1 Correlates War state system code first state ccode2 Correlates War state system code second state year year dyadigos sum mutual IGOs state appears full member given year","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"data-raw directory project's Github contains additional information data generated otherwise enormous dyad-year IGOs data provided Correlates War project. Given size data, size limitations R packages CRAN, data provide can simpler summaries. want specifics, need consult underlying raw data provided Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_igo_ndy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Non-Directed Dyad-Year International Governmental Organizations (IGOs) Data — cow_igo_ndy","text":"Pevehouse, Jon C.W., Timothy Nordstrom, Roseanne W McManus, Anne Spencer Jamison, 2020. “Tracking Organizations World: Correlates War IGO Version 3.0 datasets”, Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"state-year version Correlates War IGOs data. use internally merging IGOs data state-year data.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"","code":"cow_igo_sy"},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"data frame 1557 observations following 5 variables. ccode Correlates War state system code state year year sum_igo_full sum IGOs state full member given year sum_igo_associate sum IGOs state just associate member given year sum_igo_observer sum IGOs state just observer given year sum_igo_anytype sum IGOs state member kind given year.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"data-raw directory project's Github contains additional information data generated otherwise enormous dyad-year IGOs data provided Correlates War project. Given size data, size limitations R packages CRAN, data provide can simpler summaries. want specifics, need consult underlying raw data provided Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_igo_sy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War State-Year International Governmental Organizations (IGOs) Data — cow_igo_sy","text":"Pevehouse, Jon C.W., Timothy Nordstrom, Roseanne W McManus, Anne Spencer Jamison. 2020. “Tracking Organizations World: Correlates War IGO Version 3.0 datasets”, Journal Peace Research 57(3): 492-503. Wallace, Michael, J. David Singer. 1970. \"International Governmental Organization Global System, 1815-1964.\" International Organization 24: 239-87.","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Major Powers Data (1816-2016) — cow_majors","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Correlates War major powers data.","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"","code":"cow_majors"},{"path":"http://svmiller.com/reference/cow_majors.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"data frame 14 observations following 8 variables. ccode numeric vector Correlates War country code styear start year major power stmonth start month major power stday start day major power endyear end year major power endmonth end month major power endday end day major power version version identifier","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Data provided \"-\" additional re-cleaning inclusion data set (beyond eliminating state abbreviation).","code":""},{"path":"http://svmiller.com/reference/cow_majors.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Major Powers Data (1816-2016) — cow_majors","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"directed dyadic dispute year data derived Correlates War (CoW) Militarized Interstate Dispute (MID) project. Data version 5.0. whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"","code":"cow_mid_ddydisps"},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"data frame 10234 observations following 25 variables. dispnum numeric vector CoW-MID dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year cowmidongoing numeric vector whether dispute ongoing year cowmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? fatality numeric vector fatality level dispute hostlev numeric vector hostility level MID mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID recip numeric vector whether MID reciprocated stmon numeric vector start month MID","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/cow_mid_ddydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (CoW-MID, v. 5.0) — cow_mid_ddydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"directed dyadic dispute year data derived Correlates War (CoW) Militarized Interstate Dispute (MID) project. Data version 5.0.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"","code":"cow_mid_dirdisps"},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"data frame 11390 observations following 18 variables. dispnum numeric vector CoW-MID dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year dispongoing numeric vector whether dispute ongoing year disponset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute?","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/cow_mid_dirdisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data (CoW-MID, v. 5.0) — cow_mid_dirdisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":null,"dir":"Reference","previous_headings":"","what":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"abbreviated version dispute-level CoW-MID data.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"","code":"cow_mid_disps"},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"data frame 2436 observations following 7 variables. dispnum numeric vector CoW-MID dispute number outcome numeric vector outcome MID styear numeric vector start year MID stmon numeric vector start month MID settle numeric vector dispute settled fatality numeric vector fatality level dispute mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID hiact numeric vector highest action MID hostlev numeric vector hostility level MID recip numeric vector whether MID reciprocated","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"data purposely light information; intended used dispute-level analyses, per se. intended augment directed dyadic dispute-year data adding variables serve exclusion rules whittle data dyadic dispute-year just dyad-year data.","code":""},{"path":"http://svmiller.com/reference/cow_mid_disps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Abbreviated CoW-MID Dispute-level Data (v. 5.0) — cow_mid_disps","text":"Palmer, Glenn, Roseanne W. McManus Vito D'Orazio Michael R. Kenwick Mikaela Karstens Chase Bloch Nick Dietrich Kayla Kahn Kellan Ritter Michael J. Soules. 2021. \"MID5 Dataset, 2011–2014: Procedures, coding rules, description\" Conflict Management Peace Science.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":null,"dir":"Reference","previous_headings":"","what":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"non-directed dyad-year data minimum distance states Correlates War state system 1886 2019. data generated cshapes package.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"","code":"cow_mindist"},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"data frame 817053 observations following 4 variables. ccode1 Correlates War state system code first state ccode2 Correlates War state system code second state year year mindist minimum distance states Jan. 1 year, kilometers","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"data generated cshapes package. Data automatically generated (default) directed dyad-years. elect make non-directed space considerations. Making non-directed dyad-year data directed dyad-year data difficult R. just looks weird see code . Previous versions data minimum distance Dec. 31 referent year. now Jan. 1. data provide elsewhere package understood data start year. process, example, capitals data get merged add_capital_distance() function. However, script generates data set Jan. 1 year Dec. 31. Right now, cshapes appear work system know . Fortunately, package authors made data available.","code":""},{"path":"http://svmiller.com/reference/cow_mindist.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The Minimum Distance Between States in the Correlates of War System, 1886-2019 — cow_mindist","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War National Military Capabilities Data — cow_nmc","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"version 6.0 Correlates War National Military Capabilities data. Data omit state abbreviation version identifier consideration.","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"","code":"cow_nmc"},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"data frame 15171 observations following 9 variables. ccode numeric vector Correlates War country code year year milex estimate military expenditures (thousands). See details section . milper estimate size military personnel (thousands) state irst estimate iron steel production (thousands tons) pec estimate primary energy consumption (thousands coal-ton equivalents) tpop estimate total population size state (thousands) upop estimate urban population size state (thousands). See details section . cinc Composite Index National Capability (\"CINC\") score. See details section .","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"user want little careful data used, beyond typical caveat difficult pin-point many thousands coal-tons state like Baden producing 19th century. First, military expenditures denominated British pounds sterling observations 1816 1913. observations 1914 beyond denominated current United States dollars. according manual. Second, urban population size estimate based , well, estimate size population living area 100,000 people. Third, Composite Index National Capability score calculated state's world share six composite indicators also included data given year. theoretically bound 0 1. state 1 100% responsible 1) military expenditures world, 2) state military, 3) iron steel production, 4) world's primary energy consumption, 5) state world population urban population. Incidentally, maximum scores observed data belong United States 1945.","code":""},{"path":"http://svmiller.com/reference/cow_nmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War National Military Capabilities Data — cow_nmc","text":"Singer, J. David, Stuart Bremer, John Stuckey. (1972). \"Capability Distribution, Uncertainty, Major Power War, 1820-1965.\" Bruce Russett (ed) Peace, War, Numbers, Beverly Hills: Sage, 19-48. Singer, J. David. 1987. \"Reconstructing Correlates War Dataset Material Capabilities States, 1816-1985\" International Interactions, 14: 115-32.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"state-year level data surplus gross domestic product Correlates War state system members. Data also include population estimates per capita standardization.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"","code":"cow_sdp_gdp"},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"data frame 27753 observations following five variables. ccode numeric vector Correlates War state code year numeric vector year wbgdp2011est numeric vector estimated natural log GDP 2011 USD (log-transformed) wbpopest numeric vector estimated population size (log-transformed) sdpest numeric vector estimated surplus domestic product (log-transformed) wbgdppc2011est numeric vector estimated GDP per capita (log-transformed)","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"extracted actual replication files International Studies Quarterly. data ultimately simulated, user can expect slight differences Correlates War version data (Anders et al. published) Gleditsch-Ward version data (appear one authors vigorously support going forward). Space considerations compel round data three decimal points. \"economic\" data routinely biggest package, decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. original simulations available remote download like. Type ?download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/cow_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Surplus and Gross) Domestic Product for Correlates of War States — cow_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War State System Membership Data (1816-2016) — cow_states","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Correlates War state system membership data.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"","code":"cow_states"},{"path":"http://svmiller.com/reference/cow_states.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"data frame 243 observations following 10 variables. stateabb character vector state abbreviation ccode numeric vector Correlates War country code statenme character vector state name styear start year system stmonth start month system stday start day system endyear end year system endmonth end month system endday end day system version version identifier","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Data provided \"-\" additional re-cleaning inclusion data set.","code":""},{"path":"http://svmiller.com/reference/cow_states.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War State System Membership Data (1816-2016) — cow_states","text":"Correlates War Project. 2017. \"State System Membership List, v2016.\" Online, https://correlatesofwar.org/data-sets/state-system-membership/","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"state-year-level data national trade Correlates War project.","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"","code":"cow_trade_sy"},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"data frame 14410 observations following four variables. ccode Correlates War state system code year year imports total imports state current million USD exports total exports state current million USD","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"data-raw directory project's Github shows data processed.","code":""},{"path":"http://svmiller.com/reference/cow_trade_sy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War National Trade Data Set (v. 4.0) — cow_trade_sy","text":"Barbieri, Katherine Omar M.G. Keshk. 2016. Correlates War Project Trade Data Set Codebook, Version 4.0. Online: https://correlatesofwar.org Barbieri, Katherine, Omar M.G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science, 26(5): 471-491.","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"modified version inter-state war data Correlates War project. Data version 4.0. temporal domain 1816-2007. Data functionally directed dyadic war-year.","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"","code":"cow_war_inter"},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"data frame 1932 observations following 15 variables. warnum Correlates War war number ccode1 Correlates War state code side1 ccode2 Correlates War state code side2 year numeric vector year cowinteronset dummy variable whether inter-state war onset (.e. either year StartYear1 StartYear2 raw data) cowinterongoing numeric constant 1 sidea1 numeric vector side war ccode1, either 1 2 sidea2 numeric vector side war ccode2, either 1 2 initiator1 dummy variable equals 1 ccode1 initiated war initiator2 dummy variable equals 1 ccode2 initiated war outcome1 outcome ccode1 numeric vector. Outcomes 1 (winner), 2 (loser), 3 (compromise/tied), 4 (transformed another type war), 5 (ongoing end 2007, observed data), 6 (stalemate), 7 (conflict continues severity war), 8 (changed sides) outcome2 outcome ccode2 numeric vector. Outcomes 1 (winner), 2 (loser), 3 (compromise/tied), 4 (transformed another type war), 5 (ongoing end 2007, observed data), 6 (stalemate), 7 (conflict continues severity war), 8 (changed sides) batdeath1 estimated deaths ccode1 (-9 = unknown) batdeath2 estimated deaths ccode2 (-9 = unknown) resume dummy variable equals 1 conflict resumption episode","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"See data-raw directory data generated. data want , caution using gospel. problems . One: -9s proliferate data battle deaths either side, unhelpful. 10 cases sum battle deaths exactly 1,000 1,001. suspicious. \"side\" variables well-explained---fact explained codebook--- can lead user astray want interpret analogous sidea variables Correlates War Militarized Interstate Dispute data. probably want use initiator variables . , war data routinely betray MID data two speak well . language Sarkees Wayman (2010) use book talk MIDs \"precede\" war \"associated\" war, forgets war data supposed subset MID data. one case (Gulf War), get associated dispute number wrong , one prominent case (War Bosnian Independence), argue MID exists (actually MID#3557).","code":""},{"path":"http://svmiller.com/reference/cow_war_inter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Inter-State War Data (v. 4.0) — cow_war_inter","text":"Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"modified version intra-state war data Correlates War project. Data version 4.1. temporal domain 1816-2007.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"","code":"cow_war_intra"},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"data frame 1361 observations following 17 variables. warnum Correlates War war number warname Correlates War war name wartype character vector type war, either \"local issues\" \"central control\" year numeric vector year cowintraonset dummy variable whether civil war onset (.e. either year StartYear1 StartYear2 raw data) cowintraongoing numeric constant 1 resume_combat dummy variable whether resumption conflict (.e. StartYear2 -8) primary_state dummy variable whether state primary state civil war ccodea Correlates War state code participant Side . -8 = applicable (participant state) sidea name participant Side . -8 = applicable (additional party side) ccodeb Correlates War state code participant Side B. -8 = applicable (participant state) sideb name participant Side B. -8 = applicable (additional party side) intnl dummy variable internationalized civil war outcome unordered-categorical variable outcome civil war. Values include 1 (Side wins), 2 (Side B wins), 3 (Compromise), 4 (war transformed another type war), 5 (war ongoing end 2007), 6 (stalemate), 7 (conflict continues severity war) sideadeaths estimated deaths Side participant (-9 = unknown, -8 = applicable) sidebdeaths estimated deaths Side B participant (-9 = unknown, -8 = applicable) ongo2007 dummy variable war ongoing end 2007","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"See data-raw directory data generated. Guinnea-Bissau Civil War (1998, 1999), \"Mane Junta\" accented-e scrubbed coincide CRAN's character requirements.","code":""},{"path":"http://svmiller.com/reference/cow_war_intra.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlates of War Intra-State War Data (v. 4.1) — cow_war_intra","text":"Dixon, Jeffrey, Meredith Sarkees. 2016. Guide Intra-State Wars: Examination Civil Wars, 1816-2014. Thousand Oaks, CA: Sage. Sarkees, Meredith Reid, Frank Wheldon Wayman. 2010. Resort War: Data Guide Inter-State, Extra-State, Intra-State, Non-State Wars, 1816-2007. Washington DC: CQ Press.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create dyad-years from state system membership data — create_dyadyears","title":"Create dyad-years from state system membership data — create_dyadyears","text":"create_dyadyears() allows dyad-year data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create dyad-years from state system membership data — create_dyadyears","text":"","code":"create_dyadyears(system = \"cow\", mry = TRUE, directed = TRUE, subset_years)"},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create dyad-years from state system membership data — create_dyadyears","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care. directed optional, defaults TRUE. TRUE, function returns -called \"directed\" dyad-year data. directed dyad-year data, France-Germany (220-255) Germany-France (255-220) observationally different. FALSE, function returns non-directed data. non-directed data, France-Germany Germany-France year observation. standard drop cases country code second observation less country code first observation. subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(1816:1820) subset data just dyad-years 1816, 1817, 1818, 1819, 1820. advised easiest subset data full universe dyad-year data created. means , choose, effectively overwrite mry = TRUE argument since mry argument applied expansion state system data, occurs start function.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create dyad-years from state system membership data — create_dyadyears","text":"create_dyadyears() takes state system membership data provided either Correlates War Gleditsch-Ward returns dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create dyad-years from state system membership data — create_dyadyears","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create dyad-years from state system membership data — create_dyadyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_dyadyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create dyad-years from state system membership data — create_dyadyears","text":"","code":"# \\donttest{ # CoW is default, will include years beyond 2016 (most recent CoW update) create_dyadyears() #> Joining with `by = join_by(ccode1, ccode2, year)` #> # A tibble: 2,139,270 × 3 #> ccode1 ccode2 year #> #> 1 2 20 1920 #> 2 2 20 1921 #> 3 2 20 1922 #> 4 2 20 1923 #> 5 2 20 1924 #> 6 2 20 1925 #> 7 2 20 1926 #> 8 2 20 1927 #> 9 2 20 1928 #> 10 2 20 1929 #> # … with 2,139,260 more rows # Gleditsch-Ward, include most recent years create_dyadyears(system=\"gw\") #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 2,089,826 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 2,089,816 more rows # Gleditsch-Ward, don't include most recent years create_dyadyears(system=\"gw\", mry=FALSE) #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 1,939,316 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 1,939,306 more rows # Gleditsch-Ward, don't include most recent years, directed = FALSE create_dyadyears(system=\"gw\", mry=FALSE, directed = FALSE) #> Joining with `by = join_by(gwcode1, gwcode2, year)` #> # A tibble: 969,658 × 3 #> gwcode1 gwcode2 year #> #> 1 2 20 1867 #> 2 2 20 1868 #> 3 2 20 1869 #> 4 2 20 1870 #> 5 2 20 1871 #> 6 2 20 1872 #> 7 2 20 1873 #> 8 2 20 1874 #> 9 2 20 1875 #> 10 2 20 1876 #> # … with 969,648 more rows # }"},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-days from leader data — create_leaderdays","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays() allows generate leader-day data leader-level data provided peacesciencer.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-days from leader data — create_leaderdays","text":"","code":"create_leaderdays(system = \"archigos\", standardize = \"none\")"},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-days from leader data — create_leaderdays","text":"system leader system create leader-days. Right now, \"archigos\" supported. standardize character vector length one: \"cow\", \"gw\", \"none\". \"cow\", function standardizes leader-days just overlap state system membership Correlates War state system (see: cow_states). \"gw\", function standardizes leader-days just overlap state system dates Gleditsch-Ward date (see: gw_states). \"none\", function returns leader-days presented Archigos (nominally denominated Gleditsch-Ward state system codes, necessarily Gleditsch-Ward state system dates). Default \"none\".","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays() takes leader-level data available peacesciencer returns leader-day-level data frame.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-days from leader data — create_leaderdays","text":"create_leaderdays(), writing, supports Archigos data set leaders. envision function mostly internal uses. Basically, create_leaderyears() effectively starts first running version create_leaderdays(). , function ?","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-days from leader data — create_leaderdays","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-days from leader data — create_leaderdays","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-days from leader data — create_leaderdays","text":"","code":"# \\donttest{ create_leaderdays() #> # A tibble: 5,298,380 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,298,370 more rows create_leaderdays(standardize = \"gw\") #> Joining with `by = join_by(gwcode, date)` #> # A tibble: 5,181,021 × 5 #> obsid gwcode leader date yrinoffice #> #> 1 USA-1869 2 Grant 1869-03-04 1 #> 2 USA-1869 2 Grant 1869-03-05 1 #> 3 USA-1869 2 Grant 1869-03-06 1 #> 4 USA-1869 2 Grant 1869-03-07 1 #> 5 USA-1869 2 Grant 1869-03-08 1 #> 6 USA-1869 2 Grant 1869-03-09 1 #> 7 USA-1869 2 Grant 1869-03-10 1 #> 8 USA-1869 2 Grant 1869-03-11 1 #> 9 USA-1869 2 Grant 1869-03-12 1 #> 10 USA-1869 2 Grant 1869-03-13 1 #> # … with 5,181,011 more rows # }"},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"create_leaderdyadyears() allows created leader dyad-year data Archigos data first introduced described Goemans et al. (2009).","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"","code":"create_leaderdyadyears(directed = TRUE, system = \"gw\")"},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"directed optional, defaults TRUE. TRUE, function returns -called \"directed\" leader dyad-year data. FALSE, function returns non-directed data state codes second leader greater state codes second leader. system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Gleditsch-Ward default.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"create_leaderdyadyears() takes remote data available separate download returns complete leader dyad-year data frame leaders, possible dyads, 1870 2015.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"complete universal leader dyad-year data frame possible dyadic leader pairings 1870 2015. several implications. First: data enormous. output 2 million rows long! Second: time required create data scratch take long normal function call. amounts unholy combination data large CRAN's disk space restrictions (5 MB) time-consuming scratch every time. Thus, data pre-generated stored remotely. Check download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderdyadyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-dyad-years from the Archigos data — create_leaderdyadyears","text":"","code":"if (FALSE) { # download_extdata() # ^ make sure you've run this first. # default is directed create_leaderdyadyears() # non-directed create_leaderdyadyears(directed = FALSE) }"},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create leader-years from leader data — create_leaderyears","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears() allows generate leader-year data leader-level data provided peacesciencer","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create leader-years from leader data — create_leaderyears","text":"","code":"create_leaderyears(system = \"archigos\", standardize = \"none\", subset_years)"},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create leader-years from leader data — create_leaderyears","text":"system leader system create leader-years. Right now, \"archigos\" supported. standardize character vector length one: \"cow\", \"gw\", \"none\". \"cow\", function standardizes leader-years just overlap state system membership Correlates War state system (see: cow_states). \"gw\", function standardizes leader-years just overlap state system dates Gleditsch-Ward date (see: gw_states). \"none\", function returns leader-years presented Archigos (nominally denominated Gleditsch-Ward state system codes, necessarily Gleditsch-Ward state system dates). Default \"none\". subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(2000:2005) subset data just leader-years 2000, 2001, 2002, 2003, 2004, 2005 advised easiest subset data full universe leader-year data created. also agnostic supplied standardize argument.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears() takes leader-level data available peacesciencer returns leader-year-level data frame. minimal output contains observation ID Archigos, year, state code leader (.e. either Correlates War Gleditsch-Ward, depending standardize argument), leader's name Archigos (may help reader ), approximation leader's age, year office leader (running count, starting 1).","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create leader-years from leader data — create_leaderyears","text":"create_leaderyears(), writing, supports Archigos data set leaders. Many leader ages known precision. Many recorded Archigos data. Knowing well years aggregates days, leader age variable gets returned output treated approximation leader's age. mindful leader tenure calculated standardization argument. Archigos leader entries precede state system entry state, otherwise coincide state system dates. example, Lynden Pindling seventh year leader Bahamas (various titles) independence 1973 (became prime minister). Leader tenure tethered state system dates situations like (dates recorded Archigos data). leader tenure variable returned odd effect potentially misstating leader tenure, least making seem unusual. example, Jimmy Carter (USA-1877) president 1977 (year 1), 1978 (year 2), 1979 (year 3), 1980 (year 4), exited January 1981 (year 5). : years aggregates days evident else information perfectly communicated mind. Users R skills can extract underlying information archigos data , perhaps, calculate something like maximum leader tenure (days) either Dec. 31 referent year, leader exit Dec. 31 year, something effect. matter, think least defensible variable present user limitations mind. user interested leader tenure leader-year analysis, variable fine. user interested something like effect fifth year kind leader behavior, want figure something else.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create leader-years from leader data — create_leaderyears","text":"Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create leader-years from leader data — create_leaderyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_leaderyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create leader-years from leader data — create_leaderyears","text":"","code":"# \\donttest{ # standardize = 'none' is default create_leaderyears() #> # A tibble: 17,686 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,676 more rows create_leaderyears(standardize = 'gw') #> Joining with `by = join_by(gwcode, date)` #> # A tibble: 17,361 × 7 #> obsid leader gwcode gender leaderage year yrinoffice #> #> 1 USA-1869 Grant 2 M 47 1869 1 #> 2 USA-1869 Grant 2 M 48 1870 2 #> 3 USA-1869 Grant 2 M 49 1871 3 #> 4 USA-1869 Grant 2 M 50 1872 4 #> 5 USA-1869 Grant 2 M 51 1873 5 #> 6 USA-1869 Grant 2 M 52 1874 6 #> 7 USA-1869 Grant 2 M 53 1875 7 #> 8 USA-1869 Grant 2 M 54 1876 8 #> 9 USA-1869 Grant 2 M 55 1877 9 #> 10 USA-1877 Hayes 2 M 55 1877 1 #> # … with 17,351 more rows # }"},{"path":"http://svmiller.com/reference/create_statedays.html","id":null,"dir":"Reference","previous_headings":"","what":"Create state-days from state system membership data — create_statedays","title":"Create state-days from state system membership data — create_statedays","text":"create_statedays() allows create state-day data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create state-days from state system membership data — create_statedays","text":"","code":"create_statedays(system = \"cow\", mry = TRUE)"},{"path":"http://svmiller.com/reference/create_statedays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create state-days from state system membership data — create_statedays","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create state-days from state system membership data — create_statedays","text":"create_statedays() takes state system membership data provided either Correlates War Gleditsch-Ward returns simple state-day data frame.","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create state-days from state system membership data — create_statedays","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create state-days from state system membership data — create_statedays","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_statedays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create state-days from state system membership data — create_statedays","text":"","code":"# \\donttest{ # CoW is default, will include years beyond 2016 (most recent CoW update) create_statedays() #> # A tibble: 6,203,441 × 3 #> ccode statenme date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,203,431 more rows # Gleditsch-Ward, include most recent years create_statedays(system=\"gw\") #> # A tibble: 6,765,801 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,765,791 more rows # Gleditsch-Ward, don't include most recent years create_statedays(system=\"gw\", mry=FALSE) #> # A tibble: 6,448,077 × 3 #> gwcode statename date #> #> 1 2 United States of America 1816-01-01 #> 2 2 United States of America 1816-01-02 #> 3 2 United States of America 1816-01-03 #> 4 2 United States of America 1816-01-04 #> 5 2 United States of America 1816-01-05 #> 6 2 United States of America 1816-01-06 #> 7 2 United States of America 1816-01-07 #> 8 2 United States of America 1816-01-08 #> 9 2 United States of America 1816-01-09 #> 10 2 United States of America 1816-01-10 #> # … with 6,448,067 more rows # }"},{"path":"http://svmiller.com/reference/create_stateyears.html","id":null,"dir":"Reference","previous_headings":"","what":"Create state-years from state system membership data — create_stateyears","title":"Create state-years from state system membership data — create_stateyears","text":"create_stateyears() allows generate state-year data either Correlates War (CoW) state system membership data Gleditsch-Ward (gw) system membership data. function leans internal data provided package.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create state-years from state system membership data — create_stateyears","text":"","code":"create_stateyears(system = \"cow\", mry = TRUE, subset_years)"},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create state-years from state system membership data — create_stateyears","text":"system character specifying whether user wants Correlates War state-years (\"cow\") Gleditsch-Ward (\"gw\") state-years. Correlates War default. mry optional, defaults TRUE. TRUE, function extends script beyond recent system membership updates include observation recently concluded calendar year. example, Gleditsch-Ward data extend end 2017. mry == TRUE, function returns recent years (e.g. 2018, 2019) assumption states alive end 2017 still alive today. Use care. subset_years optional character vector subsetting years returned just temporal domain interest user. example, c(1816:1820) subset data just state-years 1816, 1817, 1818, 1819, 1820. advised easiest subset data full universe state-year data created. means , choose, effectively overwrite mry = TRUE argument since mry argument applied expansion state system data state-year data.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create state-years from state system membership data — create_stateyears","text":"create_stateyears() takes state system membership data provided either Correlates War Gleditsch-Ward returns simple state-year data frame.","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create state-years from state system membership data — create_stateyears","text":"Miller, Steven V. 2019. ``Create Country-Year (Non)-Directed Dyad-Year Data Just Lines R'' http://svmiller.com/blog/2019/01/create-country-year-dyad-year--country-data/","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create state-years from state system membership data — create_stateyears","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/create_stateyears.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create state-years from state system membership data — create_stateyears","text":"","code":"# CoW is default, will include years beyond 2016 (most recent CoW update) create_stateyears() #> # A tibble: 17,121 × 3 #> ccode statenme year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,111 more rows # Gleditsch-Ward, include most recent years create_stateyears(system=\"gw\") #> # A tibble: 18,637 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 18,627 more rows # Gleditsch-Ward, don't include most recent years create_stateyears(system=\"gw\", mry=FALSE) #> # A tibble: 17,767 × 3 #> gwcode statename year #> #> 1 2 United States of America 1816 #> 2 2 United States of America 1817 #> 3 2 United States of America 1818 #> 4 2 United States of America 1819 #> 5 2 United States of America 1820 #> 6 2 United States of America 1821 #> 7 2 United States of America 1822 #> 8 2 United States of America 1823 #> 9 2 United States of America 1824 #> 10 2 United States of America 1825 #> # … with 17,757 more rows"},{"path":"http://svmiller.com/reference/creg.html","id":null,"dir":"Reference","previous_headings":"","what":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data set state-year estimates ethnic religious fractionalization/polarization, way Composition Religious Ethnic Groups (CREG) project University Illinois. -L-L.","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"","code":"creg"},{"path":"http://svmiller.com/reference/creg.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data frame 11523 observations following 9 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code creg_ccode numeric code state, mostly patterned Correlates War codes important differences. See details section . year year ethfrac estimate ethnic fractionalization index. See details . ethpol estimate ethnic polarization index. See details . relfrac estimate religious fractionalization index. See details . relpol estimate religious polarization index. See details .","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"data-raw directory project's Github contains information data created. Pay careful attention assigned CoW/G-W codes. underlying data version 1.02. state codes provided CREG project mostly Correlates War codes, differences. Summarizing differences: state code Serbia 1992 2013 actually Gleditsch-Ward code (340). Russia dissolution Soviet Union (1991-onward) 393 365. Soviet Union 365 code. Yugoslavia 345 code. code Yemen (678) effectively Gleditsch-Ward code spans entire post-World War II temporal domain. Likewise, code post-unification Germany Gleditsch-Ward code (260) well. codebook actually says 265 (East Germany's code), assuredly typo based data. codebook cautions insufficient data ethnic group estimates Cameroon, France, India, Kosovo, Montenegro, Mozambique, Papua New Guinea. French case particularly disappointing missing data function France's constitution modelling issues CREG (per codebook). insufficient data make religious group estimates China, North Korea, short-lived Republic Vietnam. fractionalization estimates familiar Herfindahl-Hirschman concentration index. polarization formula comes way Montalvo Reynal-Querol (2000), though book appear published beyond placement online. recommend Montalvo Reynal-Querol (2005) instead. can cite Alesina (2003) fractionalization measure like. literal sense \"1\", group proportions may sum exactly 1 rounding data. two problem cases data worth mentioning. First, data sets, occasional duplicates group names state-year (example: Afghanistan 1951 ethnic group data United States 1948 religious group data). cases, script make available data-raw directory just select distinct values effectively fixes problem duplicates, appear. Finally, Costa Rica curious problem years religious group data. Costa Rica years group data Protestants, Roman Catholics, \"others.\" 1964 , \"others\" zero. Afterward, small proportion \"others\". However, sum Protestants, Roman Catholics, \"others\" exceeds 1 (pretty clearly) difference sum 1 entirely \"others.\" , drop \"others\" years. think terribly problematic, worth saying .","code":""},{"path":"http://svmiller.com/reference/creg.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Composition of Religious and Ethnic Groups (CREG) Fractionalization/Polarization Estimates — creg","text":"Alesina, Alberto, Arnaud Devleeschauwer, William Easterly, Sergio Kurlat Romain Wacziarg. 2003. \"Fractionalization\". Journal Economic Growth 8: 155-194. Montalvo, Jose G. Marta Reynal-Querol. 2005. \"Ethnic Polarization, Potential Conflict, Civil Wars\" American Economic Review 95(3): 796--816. Nardulli, Peter F., Cara J. Wong, Ajay Singh, Buddy Petyon, Joseph Bajjalieh. 2012. Composition Religious Ethnic Groups (CREG) Project. Cline Center Democracy.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare peacesciencer-specific attributes to data — declare_attributes","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"declare_attributes() allows user declare peacesciencer-specific attributes data bring outside package. allows user use package functions shortcuts, appropriate.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"","code":"declare_attributes(data, data_type, system, conflict_type)"},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"data data frame want peacesciencer-specific attributes data_type optional, character vector length 1 coinciding type data user believes data frame . Options include: 'dyad_year', 'leader_day', 'leader_year', 'leader_dyad_year', 'state_day', 'state_year'. system optional, character vector length 1 coinciding state system data. specified , must 'cow' 'gw'. conflict_type optional, applicable just conflict data \"whittle\" class functions peacesciencer. specified, must character vector length 1 either 'cow' 'gml'.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"declare_attributes() takes data frame adds peacesciencer-specific attributes data frame. allow user take advantage many functions package without starting process one \"create\" functions. nothing declared function, attribute added function just returns original data without change.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"function's documentation include attributes available declared. doubt, list potential attributes grow time, attributes can declared limited just built package point. Users declare one attribute given type (.e. user declare system Correlates War Gleditsch-Ward). idea , basically, allow user use functions peacesciencer data created acquired elsewhere. However, functions provides assurances quality control various merges built elsewhere package. package aggressively tests functions data generated -house. outside data merges, various \"add\" functions may perfectly perform. real way can control since data coming outside package one \"create\" functions. particular case, may much problem. However, user's responsibility quality control situation.","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/declare_attributes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Declare peacesciencer-specific attributes to data — declare_attributes","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) data.frame(ccode = 2, year = c(1816:1830)) -> usa_years usa_years %>% declare_attributes(data_type = 'state_year', system = 'cow') #> ccode year #> 1 2 1816 #> 2 2 1817 #> 3 2 1818 #> 4 2 1819 #> 5 2 1820 #> 6 2 1821 #> 7 2 1822 #> 8 2 1823 #> 9 2 1824 #> 10 2 1825 #> 11 2 1826 #> 12 2 1827 #> 13 2 1828 #> 14 2 1829 #> 15 2 1830"},{"path":"http://svmiller.com/reference/download_extdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Download Some Extra Data for Peace Science Research — download_extdata","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"download_extdata() leverages R's inst directory flexibility allow download extra data store package.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"","code":"download_extdata(overwrite = FALSE)"},{"path":"http://svmiller.com/reference/download_extdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"overwrite logical, defaults FALSE. FALSE, function checks see already downloaded data , already , nothing. TRUE, function redownloads data.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"download_extdata() downloads extra data stored website (http://svmiller.com) sticks extdata directory package.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"a-description-of-various-data-sets-this-will-download","dir":"Reference","previous_headings":"","what":"A Description of Various Data Sets This Will Download","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Running download_extdata() returns following data stored package's extdata directory.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"correlates-of-war-dyadic-trade-data-set-v-","dir":"Reference","previous_headings":"","what":"Correlates of War Dyadic Trade Data Set (v. 4.0)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed dyad-year-level data dyadic trade Correlates War project. trade values presented rounded three decimal points conserve space. data downloaded function 4.1 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"directed-leader-dyad-year-data-cow-states-","dir":"Reference","previous_headings":"","what":"Directed Leader Dyad-Year Data, 1870-2015 (CoW States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed leader dyad-year data 1870-2015. Data come Archigos data (version 4.1). data standardized just observations leaders states appear CoW state system data. data downloaded function 2 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"directed-leader-dyad-year-data-gleditsch-ward-states-","dir":"Reference","previous_headings":"","what":"Directed Leader Dyad-Year Data, 1870-2015 (Gleditsch-Ward States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"directed leader dyad-year data 1870-2015. Data come Archigos data (version 4.1). data represent every possible dyadic leader-pairing Archigos data (denominated Gleditsch-Ward system), standardizes leader dyad-years Gleditsch-Ward state system dates. data downloaded function 2.2 megabytes size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"chance-corrected-measures-of-foreign-policy-similarity-fpsim-v-","dir":"Reference","previous_headings":"","what":"Chance-Corrected Measures of Foreign Policy Similarity (FPSIM, v. 2)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"FPSIM data set provides measures foreign policy similarity dyads based alliance ties (Correlates War, version 4.1) UN General Assembly voting (Voeten, version 17) members Correlates War state system. alliance data cover time period 1816 2012, UN voting data 1946 2015. similarity measures include various versions Ritter Signorino's S (weighted/non-weighted material capabilities; squared/absolute distance metrics) well chance-corrected measures Cohen's (1960) kappa Scott's (1955) pi. measures based alliance data come two versions: one based valued alliance ties based binary alliance ties. Data last updated December 7, 2017, description effectively plagiarized (blessing) Frank Haege's Dataverse. data directed dyad-years 17 columns 1,872,198 observations. almost certainly largest data set nudge/ask download remotely. file containing information 18.6 MB size. reduce size , decimal points also rounded three spots. Haege generated estimates dyadic foreign policy similarity, except taub column. generated separately, .","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"-non-directed-dyadic-minimum-distance-data-plus-cow-states-","dir":"Reference","previous_headings":"","what":"(Non-Directed) Dyadic Minimum Distance Data Plus (CoW States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"non-directed dyadic minimum distance data Schvitz et al. (2022) Correlates War states start 1886 end 2019. Note call \"data plus\", idea informally branding kind augmentation might otherwise cshapes package. data set 4.4 million rows dyadic minimum distance available years. Within year, recorded minimum distance Jan. 1, June 30, Dec. 31 , addition, day within year composition international system (shape state) changed, recorded cshapes. Sometimes changes concern dyadic minimum distance; sometimes . example, League Nations responsible lot shape changes (.e. system entry) CoW state system data year 1920. obviously change dyadic minimum distance U.S. Canada, always zero. Sometimes start year (Jan. 1), midpoint year (June 30), end year (Dec. 31) coincides system change. Often . Note referent day (Jan. 1, June 30, Dec. 31) may appear given year given dyad date exists outside CoW state system membership. example, Canada appear state system member Jan. 10, 1920. goal data set allow quickly generate dyadic minimum distances within peacesciencer's functionality proficient tidyverse verbs. also use highlight often dyadic minimum distance may vary within year given dyad. Despite dimensions data set, big download. data 1.7 MB size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"-non-directed-dyadic-minimum-distance-data-plus-g-w-states-","dir":"Reference","previous_headings":"","what":"(Non-Directed) Dyadic Minimum Distance Data Plus (G-W States)","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"non-directed dyadic minimum distance data Schvitz et al. (2022) Gleditsch-Ward states start 1886 end 2019. Note call \"data plus\", idea informally branding kind augmentation might otherwise cshapes package. data set 3.7 million rows dyadic minimum distance available years. Within year, recorded minimum distance Jan. 1, June 30, Dec. 31 , addition, day within year composition international system (shape state) changed, recorded cshapes. Sometimes changes concern dyadic minimum distance; sometimes . example, dissolution Soviet Union responsible lot shape changes (.e. system entry) 1991. obviously change dyadic minimum distance U.S. Canada, always zero. Sometimes start year (Jan. 1), midpoint year (June 30), end year (Dec. 31) coincides system change. Often . Note referent day (Jan. 1, June 30, Dec. 31) may appear given year given dyad date exists outside G-W state system membership. example, Haiti disappears state system July 4, 1915 reappears Aug. 15, 1934. means dyadic minimum distance observations U.S., example, Dec. 31, 1915 June 30, 1934. goal data set allow quickly generate dyadic minimum distances within peacesciencer's functionality proficient tidyverse verbs. also use highlight often dyadic minimum distance may vary within year given dyad. Despite dimensions data set, big download. data 1.4 MB size.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Barbieri, Katherine, Omar M. G. Keshk, Brian Pollins. 2009. \"TRADING DATA: Evaluating Assumptions Coding Rules.\" Conflict Management Peace Science. 26(5): 471-491. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83. Haege, Frank. 2011. \"Choice Circumstance? Adjusting Measures Foreign Policy Similarity Chance Agreement.\" Political Analysis 19(3): 287-305. Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24.","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/download_extdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download Some Extra Data for Peace Science Research — download_extdata","text":"","code":"if (FALSE) { # Here's where the data are going to be downloaded. system.file(\"extdata\", package=\"peacesciencer\") # Now, let's download the data. download_extdata() }"},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":null,"dir":"Reference","previous_headings":"","what":"False Correlates of War Directed Dyad-Years — false_cow_dyads","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"simple data set communicates directed dyads Correlates War data appear year, particular day year. used anti-join create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"","code":"false_cow_dyads"},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"data frame following four variables. ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year in_ps constant equals 1 data appear create_dyadyears() careful remove .","code":""},{"path":"http://svmiller.com/reference/false_cow_dyads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"False Correlates of War Directed Dyad-Years — false_cow_dyads","text":"Think directed Suriname Republic Vietnam dyad illustrative . Republic Vietnam exits Correlates War state system April 30, 1975 whereas Suriname enters state system November 25, 1975. appear year, time.","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":null,"dir":"Reference","previous_headings":"","what":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"simple data set communicates directed dyads Gleditsch-Ward data appear year, particular day year. used anti-join create_dyadyears() function package.","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"","code":"false_gw_dyads"},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"data frame following four variables. gwcode1 numeric vector Gleditsch-Ward state code first state gwcode2 numeric vector Gleditsch-Ward state code second state year numeric vector year in_ps constant equals 1 data appear create_dyadyears() careful remove .","code":""},{"path":"http://svmiller.com/reference/false_gw_dyads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"False Gleditsch-Ward Directed Dyad-Years — false_gw_dyads","text":"Think directed Suriname Republic Vietnam dyad illustrative . Republic Vietnam exits Correlates War state system April 30, 1975 whereas Suriname enters state system November 25, 1975. appear year, time.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter dyad-year data to include just politically relevant dyads — filter_prd","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"filter_prd() filters dyad-year data frame just \"politically relevant.\" useful discarding unnecessary (unwanted) observations just consume space memory.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"","code":"filter_prd(data)"},{"path":"http://svmiller.com/reference/filter_prd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"data dyad-year data frame (either \"directed\" \"non-directed\")","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"filter_prd() takes dyad-year data frame, assuming columns major power status contiguity type, calculates whether dyad \"politically relevant\", subsets data frame just observations.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"\"Political relevance\" can calculated ways. Right now, function considers \"direct\" contiguity Correlates War major power status. can employ maximalist definitions \"direct contiguity\" focus just land-contiguous. function inclusive type contiguity relationship. version 0.5, filter_prd() shortcut add_contiguity() /add_cow_majors() function executed absence data needed create politically relevant dyads. See example means.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"Weede, Erich. 1976. \"Overwhelming preponderance pacifying condition among contiguous Asian dyads.\" Journal Conflict Resolution 20: 395-411. Lemke, Douglas William Reed. 2001. \"Relevance Politically Relevant Dyads.\" Journal Conflict Resolution 45(1): 126-144.","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/filter_prd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter dyad-year data to include just politically relevant dyads — filter_prd","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) A <- cow_ddy %>% add_contiguity() %>% add_cow_majors() %>% filter_prd() #> Joining with `by = join_by(ccode1, ccode2, year)` A #> # A tibble: 246,302 × 7 #> ccode1 ccode2 year conttype cowmaj1 cowmaj2 prd #> #> 1 2 20 1920 1 1 0 1 #> 2 2 20 1921 1 1 0 1 #> 3 2 20 1922 1 1 0 1 #> 4 2 20 1923 1 1 0 1 #> 5 2 20 1924 1 1 0 1 #> 6 2 20 1925 1 1 0 1 #> 7 2 20 1926 1 1 0 1 #> 8 2 20 1927 1 1 0 1 #> 9 2 20 1928 1 1 0 1 #> 10 2 20 1929 1 1 0 1 #> # … with 246,292 more rows # you can also use it as a shortcut for the other functions required # to calculate politically relevant dyads. B <- cow_ddy %>% filter_prd() #> Joining with `by = join_by(ccode1, ccode2, year)` B #> # A tibble: 246,302 × 7 #> ccode1 ccode2 year conttype cowmaj1 cowmaj2 prd #> #> 1 2 20 1920 1 1 0 1 #> 2 2 20 1921 1 1 0 1 #> 3 2 20 1922 1 1 0 1 #> 4 2 20 1923 1 1 0 1 #> 5 2 20 1924 1 1 0 1 #> 6 2 20 1925 1 1 0 1 #> 7 2 20 1926 1 1 0 1 #> 8 2 20 1927 1 1 0 1 #> 9 2 20 1928 1 1 0 1 #> 10 2 20 1929 1 1 0 1 #> # … with 246,292 more rows identical(A,B) #> [1] TRUE # }"},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"directed dispute-year data recent version (2.2.1) Gibler-Miller-Little (GML) militarized interstate dispute (MID) data. used internally merging full dyad-year data frames.","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"","code":"gml_dirdisp"},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"data frame 10330 observations following 39 variables. dispnum dispute number ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state year numeric vector year midongoing constant 1 ongoing disputes midonset numeric vector equals 1 onset year given dispute sidea1 first state (ccode1) side took first militarized action? sidea2 second state (ccode2) side took first militarized action? revstate1 first state (ccode1) revisionist state dispute? revstate2 second state (ccode2) revisionist state dispute? revtype11 revtype1 value ccode1? revtype12 revtype1 value ccode2? revtype21 revtype2 value ccode1? revtype22 revtype2 value ccode2? fatality1 fatality value ccode1? fatality2 fatality value ccode2? fatalpre1 fatalpre value ccode1? fatalpre2 fatalpre value ccode2? hiact1 hiact value ccode1? hiact2 hiact value ccode2? hostlev1 hostlev value ccode1? hostlev2 hostlev value ccode2? orig1 ccode1 originator (1) dispute joiner (0)? orig2 ccode2 originator (1) dispute joiner (0)? hiact highest level action observed dispute hostlev hostility level action observed dispute mindur minimum length dispute (days) maxdur maximum length dispute (days) outcome dispute-level outcome settle settlement value dispute fatality ordinal fatality level dispute fatalpre fatalities (precision, known) dispute stmon start month dispute (dispute-level) endmon end month dispute (dispute-level) recip dispute reciprocated (.e. Side B also militarized action)? numa number participants Side numb number participants Side B ongo2010 dispute ongoing 2010? version version identifier","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"Data directed dispute-year data made available version 2.1.1 GML MID data. caution using revtype variables. informative. however included legacy reasons.","code":""},{"path":"http://svmiller.com/reference/gml_dirdisp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed dispute-year data (Gibler, Miller, and Little, 2016) — gml_dirdisp","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"directed leader-dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1 (GML-MID) version 4.1 (Archigos). whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"","code":"gml_mid_ddlydisps"},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"data frame 10708 observations following 12 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad obsid1 character vector leader focal state dyad, avialable obsid2 character vector leader target state dyad, avialable year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? obsid_start1 ID leader dispute onset ccode1 obsid_start2 ID leader dispute onset ccode2 obsid_end1 ID leader dispute conclusion ccode1 obsid_end2 ID leader dispute conclusion ccode2","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind. Data created first selecting unique onsets. , duplicates remained: retaining highest fatality, highest hostility level, highest estimated minimum duration, reciprocated observations unreciprocated observations, , finally, lowest start month. mindful Archigos' leader data nominally denominated Gleditsch-Ward states, standardized Correlates War state system membership well data can allow. missing leaders 1870 Archigos ultimately system.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddlydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Leader-Dyadic Dispute-Year Data with No Duplicate Leader-Dyad-Years (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_ddlydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"directed dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1. whittled duplicate dyad-years. primary aim merging dyad-year data frame.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"","code":"gml_mid_ddydisps"},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"data frame 9262 observations following 25 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? fatality1 numeric vector overall fatality level ccode1 dispute fatality2 numeric vector overall fatality level ccode2 dispute fatalpre1 numeric vector known fatalities (precision) ccode1 dispute fatalpre2 numeric vector known fatalities (precision) ccode2 dispute hiact1 numeric vector highest action ccode1 dispute hiact2 numeric vector highest action ccode2 dispute hostlev1 numeric vector hostility level ccode1 dispute hostlev2 numeric vector hostility level ccode2 dispute orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? fatality numeric vector fatality level dispute hostlev numeric vector hostility level MID mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID recip numeric vector whether MID reciprocated stmon numeric vector start month MID","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind.","code":""},{"path":"http://svmiller.com/reference/gml_mid_ddydisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Dyadic Dispute-Year Data with No Duplicate Dyad-Years (GML, v. 2.2.1) — gml_mid_ddydisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":null,"dir":"Reference","previous_headings":"","what":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"directed leader-dyadic dispute year data derived Gibler-Miller-Little (GML) Militarized Interstate Dispute (MID) project. Data version 2.2.1 (GML-MID) version 4.1 (Archigos). data relevant dyadic leader pairings conflict, allowing users employ case exclusion rules data see fit.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"","code":"gml_mid_dirleaderdisps"},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"data frame 11686 observations following 16 variables. dispnum numeric vector dispute number ccode1 numeric vector focal state dyad ccode2 numeric vector target state dyad obsid1 character vector leader focal state dyad, avialable obsid2 character vector leader target state dyad, avialable year numeric vector dispute-year gmlmidongoing numeric vector whether dispute ongoing year gmlmidonset numeric vector whether onset new dispute (new participant-entry recurring dispute) sidea1 ccode1 side dispute? sidea2 ccode2 side dispute? orig1 ccode1 originator dispute? orig2 ccode2 originator dispute? obsid_start1 ID leader dispute onset ccode1 obsid_start2 ID leader dispute onset ccode2 obsid_end1 ID leader dispute conclusion ccode1 obsid_end2 ID leader dispute conclusion ccode2","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"process creating described one references . Importantly, data somewhat \"naive.\" : tell , example, Brazil Japan never directly fought World War II. Instead, tell two years overlap two different sides conflict highest action war. data thus similar EUGene program create users back day. Use data limitation mind. mindful Archigos' leader data nominally denominated Gleditsch-Ward states, standardized Correlates War state system membership well data can allow. missing leaders 1870 Archigos ultimately system.","code":""},{"path":"http://svmiller.com/reference/gml_mid_dirleaderdisps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Directed Leader-Dyadic Dispute-Year Data (GML, v. 2.2.1, Archigos v. 4.1) — gml_mid_dirleaderdisps","text":"Miller, Steven V. 2021. \"(Meticulously) Convert Participant-Level Dispute Data Dyadic Dispute-Year Data R.\" URL: http://svmiller.com/blog/2021/05/convert-cow-mid-data--dispute-year/ Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":null,"dir":"Reference","previous_headings":"","what":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"abbreviated version dispute-level Gibler-Miller-Little (GML) MID data.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"","code":"gml_mid_disps"},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"data frame 2436 observations following 7 variables. dispnum numeric vector CoW-MID dispute number styear numeric vector start year MID stmon numeric vector start month MID outcome numeric vector outcome MID settle numeric vector dispute settled fatality numeric vector fatality level dispute mindur numeric vector minimum duration MID maxdur numeric vector maximum duration MID hiact numeric vector highest action MID hostlev numeric vector hostility level MID recip numeric vector whether MID reciprocated","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"data purposely light information; intended used dispute-level analyses, per se. intended augment directed dyadic dispute-year data adding variables serve exclusion rules whittle data dyadic dispute-year just dyad-year data.","code":""},{"path":"http://svmiller.com/reference/gml_mid_disps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Abbreviated GML MID Dispute-level Data (v. 2.2.1) — gml_mid_disps","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":null,"dir":"Reference","previous_headings":"","what":"Participant Summaries of the GML-MID Data — gml_part","title":"Participant Summaries of the GML-MID Data — gml_part","text":"participant summaries recent GML-MID data. data also include leaders onset conclusion participant episode GML MID data.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Participant Summaries of the GML-MID Data — gml_part","text":"","code":"gml_part"},{"path":"http://svmiller.com/reference/gml_part.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Participant Summaries of the GML-MID Data — gml_part","text":"data frame 5217 observations following 21 variables. dispnum dispute ID GML MID data ccode Correlates War code participant styear start year participant stmon start month participant stday start day participant endyear end year participant endmon end month participant endday end day participant obsid_start observational ID archigos leader participant onset obsid_end observational ID archigos leader participant conclusion dummy_stday \"dummy\" start day participant. See details . dummy_endday \"dummy\" end day participant. See details . sidea participant Side dispute hiact highest action participant dispute(-episode) orig participant originator? anymiss_leader_start dummy variable disputes equals 1 dispute participant missing leader ID start date. anymiss_leader_end dummy variable disputes equals 1 dispute participant missing leader ID end date. allmiss_leader_start dummy variable disputes equals 1 dispute participants missing leader ID start date. allmiss_leader_end dummy variable disputes equals 1 dispute participants missing leader ID end date.","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Participant Summaries of the GML-MID Data — gml_part","text":"Information leaders come Archigos (v. 4.1). GML MID Data version 2.2.1. data-raw directory contains information data generated. invariably going guesswork dates sometimes known precision. Sometimes, dispute coincides even leadership change dates known precision. source script includes discussion cases shows data generated caveats mind. note participants can several episodes within dispute. Sometimes participants switch sides (e.g. Romania World War 2). Sometime participants drop long-running dispute (e.g. Syria, prominently, MID#4182). \"Dummy\" start days end days serve parlor trick assigning disputes leaders leader-level analyses. days known precision, dummy day number. cases, day known precision coincides month leader transition. Thus, start day gets imputed going first month (dummy start day) last month (dummy end day). Cases leader transition (two) month may require sensitive imputing. example, best guess Antonio Guzmán Blanco Venezuela president end MID#1639, given role trying negotiate conclusion dispute. Archigos leaving office 7th, end day gets imputed . , serve parlor trick assigning disputes leaders leader-level analyses. careful using data calculating dispute-participant duration. fact: .","code":""},{"path":"http://svmiller.com/reference/gml_part.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Participant Summaries of the GML-MID Data — gml_part","text":"Gibler, Douglas M., Steven V. Miller, Erin K. Little. 2016. “Analysis Militarized Interstate Dispute (MID) Dataset, 1816-2001.” International Studies Quarterly 60(4): 719-730. Goemans, Henk E., Kristian Skrede Gleditsch, Giacomo Chiozza. 2009. \"Introducing Archigos: Dataset Political Leaders\" Journal Peace Research 46(2): 269--83.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":null,"dir":"Reference","previous_headings":"","what":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"simple data set 71 arms races reported Gibler et al. 2005 article Journal Peace Research.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"","code":"grh_arms_races"},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"data frame following five variables. race_id arms race identifier ccode1 numeric vector Correlates War state code first state ccode2 numeric vector Correlates War state code second state styear start year arms race endyear end year arms race","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"Data taken appendix Gibler, Rider, Hutchison's 2005 article Journal Peace Research. Read article appendix information coding procedures.","code":""},{"path":"http://svmiller.com/reference/grh_arms_races.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conventional Arms Races During Periods of Rivalry — grh_arms_races","text":"Gibler, Douglas M., Toby J. Rider, Marc L. Hutchison. 2005. \"Taking Arms Sea Troubles: Conventional Arms Races Periods Rivalry\" Journal Peace Research 42(2): 131--47.","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":null,"dir":"Reference","previous_headings":"","what":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"complete list capitals capital transitions Gleditsch-Ward state system members. use internally calculating capital--capital distances add_capital_distances() function.","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"","code":"gw_capitals"},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"data frame 248 observations following 7 variables. gwcode numeric vector Gleditsch-Ward state code statenme character vector state capital character vector name capital styear character vector start year. See details section information. endyear character vector end year. See details section information. lat numeric vector latitude coordinates capital lng numeric vector longitude coordinates capital","code":""},{"path":"http://svmiller.com/reference/gw_capitals.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A complete list of capitals and capital transitions for Gleditsch-Ward state system members — gw_capitals","text":"convenience, start year states 1816. Samoa, example, state 1816. However, functions use gw_capitals data create observations states exist given point time. data current end 2020. Cases start year 1816 indicate capital transition. example, Brazil's capital moved Rio de Janeiro Brasilia (planned capital) 1960. 25 states data experienced capital transition. recent Burundi 2018. Indonesia, writing, planning capital transition, completed yet. Kazakhstan renamed capital state leader 2019. data retain name Astana. changed event software use records change. capitals data without peculiarities. Prominently, Portugal transferred Portuguese court Lisbon Rio de Janeiro 1808 1821. recorded data. knowledge inter-state conflict data note war dispute , say, Portugal Spain (Portugal country) point time, create weirdness suggest massive distance two countries, like Portugal Spain, otherwise land-contiguous. Spain: republican government moved capital start civil war (1936) Valencia. However, abandoned capital 1937. elect record capital transition. Myanmar: Gleditsch-Ward system stands Myanmar entered bulk 19th century. capitals recorded Myanmar (Burma) coincide capitals Konbaung dynasty. data also (think) reasonable back-dating capitals coincide states transition without necessarily formal capitals first appearance state system membership data. concern Lithuania, Kazakhstan, Philippines. Kaunas initial post-independence capital Lithuania. Almaty initial post-independence capital Kazakhstan. Quezon City initial post-independence capital Philippines. concerns, , one two years three countries.","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":null,"dir":"Reference","previous_headings":"","what":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"complete (believe) data set Gleditsch-Ward states Correlates War states, byproduct full_join() gw_states cow_states leans largely state abbreviation variable.","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"","code":"gw_cow_years"},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"data frame 18425 observations following 6 variables. gwcode Gleditsch-Ward state code stateabb state abbreviation, greatest source agreement data sets gw_statename state name appears Gleditsch-Ward data ccode Correlates War state code cow_statename state name appears Correlates War data year numeric vector year","code":""},{"path":"http://svmiller.com/reference/gw_cow_years.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gleditsch-Ward states and Correlates of War, by year — gw_cow_years","text":"data-raw directory project's Github contains information data created. going use internal stuff. workflow going treat Gleditsch-Ward state system membership codes \"master\" codes, user can add Correlates War identifiers see fit. Data extended 2020, assuming changes state system membership either data set.","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":null,"dir":"Reference","previous_headings":"","what":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"complete directed dyad-year data frame Gleditsch-Ward state system members. offer shortcut various functions. general rule, data frame updated every calendar year include recently concluded calendar year.","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"","code":"gw_ddy"},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"data frame following 3 variables. gwcode1 numeric vector Correlates War state code first state gwcode2 numeric vector Correlates War state code second state year numeric vector year","code":""},{"path":"http://svmiller.com/reference/gw_ddy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A directed dyad-year data frame of Gleditsch-Ward state system members — gw_ddy","text":"Data quick generation create_dyadyears(system=\"gw\") function package.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":null,"dir":"Reference","previous_headings":"","what":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"non-directed dyad-year data minimum distance states Gleditsch-Ward state system 1886 2018. data generated cshapes package.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"","code":"gw_mindist"},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"data frame 868813 observations following 4 variables. gwcode1 Gleditsch-Ward state system code first state gwcode2 Gleditsch-Ward state system code second state year year mindist minimum distance states Jan. 1 year, kilometers","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"data generated cshapes package. package authors purport data generated compatible Gleditsch-Ward system. trust ; indeed, Gleditsch one authors cshapes package. Data automatically generated (default) directed dyad-years. elect make non-directed space considerations. Making non-directed dyad-year data directed dyad-year data difficult R. just looks weird see code . Previous versions data minimum distance Dec. 31 referent year. now Jan. 1. data prove elsewhere package understood data start year. process, example, capitals data get merged add_capital_distance() function. However, script generates data set Jan. 1 year Dec. 31. Right now, cshapes appear work system know . Fortunately, package authors made data available.","code":""},{"path":"http://svmiller.com/reference/gw_mindist.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The Minimum Distance Between States in the Gleditsch-Ward System, 1886-2019 — gw_mindist","text":"Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, Kristian Skrede Gleditsch. 2022. \"Mapping International System, 1886-2017: CShapes 2.0 Dataset.\" Journal Conflict Resolution. 66(1): 144-161. Weidmann, Nils B. Kristian Skrede Gleditsch. 2010. \"Mapping Measuring Country Shapes: cshapes Package.\" R Journal 2(1): 18-24","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":null,"dir":"Reference","previous_headings":"","what":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"state-year level data surplus gross domestic product Correlates War state system members. Data also include population estimates per capita standardization.","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"","code":"gw_sdp_gdp"},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"data frame 27387 observations following five variables. gwcode numeric vector Gleditsch-Ward state code year numeric vector year wbgdp2011est numeric vector estimated natural log GDP 2011 USD (log-transformed) wbpopest numeric vector estimated population size (log-transformed) sdpest numeric vector estimated surplus domestic product (log-transformed) wbgdppc2011est numeric vector estimated GDP per capita (log-transformed)","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"provided Anders separate Github repository project. data ultimately simulated, user can expect slight differences Correlates War version data (Anders et al. published) Gleditsch-Ward version data (appear one authors vigorously support going forward). Space considerations compel round data three decimal points. \"economic\" data routinely biggest package, decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. original simulations available remote download like. Type ?download_extdata() information.","code":""},{"path":"http://svmiller.com/reference/gw_sdp_gdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Surplus and Gross) Domestic Product for Gleditsch-Ward States — gw_sdp_gdp","text":"Anders, Therese, Christopher J. Fariss, Jonathan N. Markowitz. 2020. \"Bread Guns Butter: Introducing Surplus Domestic Product (SDP)\" International Studies Quarterly 64(2): 392--405.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":null,"dir":"Reference","previous_headings":"","what":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"independent states Gleditsch Ward's data.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"","code":"gw_states"},{"path":"http://svmiller.com/reference/gw_states.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"data frame 216 observations following 5 variables. gwcode numeric vector Gleditsch-Ward country code stateabb character vector state abbreviation statename character vector state name startdate start date data enddate end date data","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"Data originally provided Gleditsch column names. Column names added light re-cleaning order generate data. \"Wuerttemberg\" \"Cote D'Ivoire\" statename column needed renamed ensure maximal compliance CRAN, raises notes every non-ASCII character appears package. think problematic , , state names never basis something like match merge countrycode.","code":""},{"path":"http://svmiller.com/reference/gw_states.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Gleditsch-Ward (Independent States) System Membership Data (1816-2017) — gw_states","text":"Gleditsch, Kristian S. Michael D. Ward. 1999. \"Revised List Independent States since Congress Vienna.\" International Interactions 25(4): 393--413.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":null,"dir":"Reference","previous_headings":"","what":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"democracy data Correlates War state system members.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"","code":"gwcode_democracy"},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"data frame 18289 observations following 5 variables. gwcode Gleditsch-Ward system code year numeric vector year v2x_polyarchy Varieties Democracy \"polyarchy\" estimate polity2 polity2 score Polity project xm_qudsest extension Unified Democracy Scores (UDS) estimates, made possibly QuickUDS package Xavier Marquez.","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"Missing data connote data unavailable various reasons. Either democracy data code , case Polity project, state system member outright evaluated variable. Polity data 2017. Varieties Democracy data version 10. Xavier Marquez' QuickUDS estimates (.e. extensions Pemstein et al. (2010)) come package Marquez makes available Github (https://github.com/xmarquez/QuickUDS).","code":""},{"path":"http://svmiller.com/reference/gwcode_democracy.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Democracy data for all Gleditsch-Ward states — gwcode_democracy","text":"Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan . Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Agnes Cornell, Lisa Gastaldi, Haakon Gjerlow, Valeriya Mechkova, Johannes von Romer, Aksel Sundtrom, Eitan Tzelgov, Luca Uberti, Yi-ting Wang, Tore Wig, Daniel Ziblatt. 2020. \"V-Dem Codebook v10\" Varieties Democracy (V-Dem) Project. Marshall, Monty G., Ted Robert Gurr, Keith Jaggers. 2017. \"Polity IV Project: Political Regime Characteristics Transitions, 1800-2017.\" Center Systemic Peace. Marquez, Xavier, \"Quick Method Extending Unified Democracy Scores\" (March 23, 2016). doi: 10.2139/ssrn.2753830 Pemstein, Daniel, Stephen Meserve, James Melton. 2010. \"Democratic Compromise: Latent Variable Analysis Ten Measures Regime Type.\" Political Analysis 18(4): 426-449.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":null,"dir":"Reference","previous_headings":"","what":"Historical Index of Ethnic Fractionalization data — hief","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data set state-year estimates ethnic fractionalization.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Historical Index of Ethnic Fractionalization data — hief","text":"","code":"hief"},{"path":"http://svmiller.com/reference/hief.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data frame 8808 observations following 5 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code year year efindex numeric vector estimate ethnic fractionalization","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Historical Index of Ethnic Fractionalization data — hief","text":"data-raw directory project's Github contains information data created.","code":""},{"path":"http://svmiller.com/reference/hief.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Historical Index of Ethnic Fractionalization data — hief","text":"Drazanova, Lenka. 2020. \"Introducing Historical Index Ethnic Fractionalization (HIEF) Dataset: Accounting Longitudinal Changes Ethnic Diversity.\" Journal Open Humanities Data 6:6 doi: 10.5334/johd.16","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":null,"dir":"Reference","previous_headings":"","what":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"simple data set matches, well one can, leader codes across Archigos 4.1, Archigos 2.9, LEAD data set.","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"","code":"leader_codes"},{"path":"http://svmiller.com/reference/leader_codes.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"data frame following four variables. obsid observation ID Archigos data leadid leader ID version 4.1 Archigos data leadid29 leader ID version 2.9 Archigos data leaderid leader ID LEAD data","code":""},{"path":"http://svmiller.com/reference/leader_codes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A Data Set of Leader Codes Across Archigos 4.1, Archigos 2.9, and the LEAD Data — leader_codes","text":"data treat version 4.1 Archigos data gospel leader data () observation ID (obsid) master code indicating leader tenure period. also builds assumption various observations duplicate LEAD data duplicated. concerns Francisco Aguilar Barquer (appears twice), Emile Reuter (appears twice), Gunnar Thoroddsen (appears three times) LEAD data despite uninterrupted tenures office. None covariates associated leaders change LEAD data, assume duplicates.","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":null,"dir":"Reference","previous_headings":"","what":"Leader Willingness to Use Force — lwuf","title":"Leader Willingness to Use Force — lwuf","text":"estimates leader willingness use force estimated Carter Smith (2020).","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Leader Willingness to Use Force — lwuf","text":"","code":"lwuf"},{"path":"http://svmiller.com/reference/lwuf.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Leader Willingness to Use Force — lwuf","text":"data frame 3409 observations following 9 variables. obsid observational ID archigos theta1_mean mean simulated M1 theta, estimated Carter Smith (2020) theta1_sd standard deviation simulated M1 thetas theta2_mean mean simulated M2 theta, estimated Carter Smith (2020) theta2_sd standard deviation simulated M2 thetas theta3_mean mean simulated M3 theta, estimated Carter Smith (2020) theta3_sd standard deviation simulated M3 thetas theta4_mean mean simulated M4 theta, estimated Carter Smith (2020) theta4_sd standard deviation simulated M4 thetas","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Leader Willingness to Use Force — lwuf","text":"letter published authors contains information thetas refer. \"M1\" theta variation standard Rasch model boilerplate information LEAD data. authors consider \"theoretically relevant\" \"risk-related\" refer conflict risk-taking. \"M2\" theta expands \"M1\" including political orientation psychological characteristics. \"M3\" \"M4\" expand \"M1\" \"M2\" considering 36 variables LEAD data. authors construct include measures, though analyses suggest \"M2\" best-performing measure.","code":""},{"path":"http://svmiller.com/reference/lwuf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Leader Willingness to Use Force — lwuf","text":"Carter, Jeff Charles E. Smith, Jr. 2020. \"Framework Measuring Leaders' Willingness Use Force.\" American Political Science Review 114(4): 1352--1358.","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":null,"dir":"Reference","previous_headings":"","what":"Zeev Maoz' Regional/Global Power Data — maoz_powers","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"Zeev Maoz' data states regional global powers given point time. extensions Correlates War major power data, codes \"major\" power without consideration regional global distinctions. Think Austria-Hungary intuitive issue . Austria-Hungary major power Correlates War data, good reason treat Austria-Hungary major power within Europe. Zeev Maoz tries .","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"","code":"maoz_powers"},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"data frame 20 observations following 5 variables. ccode numeric vector Correlates War country code regstdate start date regional power status regenddate end date regional power status globstdate start date global power status globenddate end date global power status","code":""},{"path":"http://svmiller.com/reference/maoz_powers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Zeev Maoz' Regional/Global Power Data — maoz_powers","text":"Maoz, Zeev. 2010. Network Nations: Evolution, Structure, Impact International Networks, 1816-2001. Cambridge University Press.","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":null,"dir":"Reference","previous_headings":"","what":"A BibTeX Data Frame of Citations — ps_bib","title":"A BibTeX Data Frame of Citations — ps_bib","text":"BibTeX file, loaded data frame, assist user properly citing source material used package.","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A BibTeX Data Frame of Citations — ps_bib","text":"","code":"ps_bib"},{"path":"http://svmiller.com/reference/ps_bib.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A BibTeX Data Frame of Citations — ps_bib","text":"data frame following columns. CATEGORY BibTeX entry type BIBTEXKEY BibTeX unique entry key ADDRESS another BibTeX field ANNOTE another BibTeX field AUTHOR list authors entry BOOKTITLE another BibTeX field, book title (appropriate) CHAPTER another BibTeX field, chapter (appropriate) CROSSREF another BibTeX field EDITION another BibTeX field, edition book (appropriate) EDITOR another BibTeX field, book editor (appropriate) HOWPUBLISHED another BibTeX field INSTITUTION another BibTeX field JOURNAL another BibTeX field, journal name (appropriate) KEY another BibTeX field MONTH another BibTeX field NOTE another BibTeX field NUMBER another BibTeX field, journal volume number (appropriate) ORGANIZATION another BibTeX field PAGES another BibTeX field, pages entry PUBLISHER another BibTeX field, book publisher (appropriate) SCHOOL another BibTeX field SERIES another BibTeX field TITLE another BibTeX field, title entry TYPE another BibTeX field VOLUME another BibTeX field, journal volume (appropriate) YEAR another BibTeX field, year publication KEYWORDS another BibTeX field, used primarily selective filtering package URL another BibTeX field, website (appropriate) OWNER another BibTeX field TIMESTAMP another BibTeX field, used occasionally started populating master file (see old entries ) DOI another BibTeX field, digital object identifier (used rarely) EPRINT another BibTeX field JOURNALTITLE another BibTeX field, think actually BibLaTeX field ISSN another BibTeX field ABSTRACT another BibTeX field, entry abstract (appropriate) DATE.ADDED another BibTeX field DATE.MODIFIED another BibTeX field","code":""},{"path":"http://svmiller.com/reference/ps_bib.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A BibTeX Data Frame of Citations — ps_bib","text":"See data-raw directory data generated. data created bib2df, now package dependency. assume user familiarity BibTeX. entries copy-pasted master bibliography file started 2008 .","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":null,"dir":"Reference","previous_headings":"","what":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"ps_cite() allows user get citations scholarship include papers incorporate functions data package.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"","code":"ps_cite(x, column = \"keywords\")"},{"path":"http://svmiller.com/reference/ps_cite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"x character vector column character vector particular column ps_bib user wants search. default \"keywords\", searches KEYWORDS column ps_bib general search. option \"bibtexkey\", search BIBTEXKEY column ps_bib. Use latter option pairing output ps_version()","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"ps_cite() takes character vector scans ps_bib data package return BibTeX citation (citations) researcher use properly cite material getting package. citations returned full BibTeX entry (entries) can copy-paste BibTeX file.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"base functionality simple pattern-matching keywords ps_bib. simple pattern-matching base R. assume user familiarity BibTeX.","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/ps_cite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get BibTeX Entries Associated with peacesciencer Data and Functions — ps_cite","text":"","code":"# Cite the package ps_cite(\"peacesciencer\") #> @ARTICLE{peacesciencer-package, #> AUTHOR = {Steven V. Miller}, #> JOURNAL = {Conflict Management and Peace Science}, #> TITLE = {peacesciencer}: An R Package for Quantitative Peace Science Research}, #> YEAR = {2022}, #> KEYWORDS = {peacesciencer, add_capital_distance(), add_ccode_to_gw(), add_gwcode_to_cow(), capitals}, #> URL = {http://svmiller.com/peacesciencer/}} #>"},{"path":"http://svmiller.com/reference/ps_data_version.html","id":null,"dir":"Reference","previous_headings":"","what":"The Version Numbers for Data Included in peacesciencer — ps_data_version","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"simple data set communicates version numbers data included package. companion data frame ps_bib, information functions like ps_cite() ps_version(). latter uses data set.","code":""},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"","code":"ps_data_version"},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"data frame following four variables. category category type data data name particular data source coinciding category version version number included peacesciencer data source bibtexkey character key BibTeX key corresponding appropriate citation ps_bib","code":""},{"path":"http://svmiller.com/reference/ps_data_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Version Numbers for Data Included in peacesciencer — ps_data_version","text":"Version numbers years understood data sources formal version numbering system, per se. Instead, communicate year last update. example, Correlates War formally version number state system data MID data. Likewise, Anders et al. (2020) simulations population surplus/gross domestic product formally versioned, per se. Instead, data published last updated 2020.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Version Information About Data Included in peacesciencer — ps_version","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"ps_version() allows user see version information data included peacesciencer.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"","code":"ps_version(cat)"},{"path":"http://svmiller.com/reference/ps_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"cat category data type user wants, character","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"ps_version() takes character vector scans ps_data_version data package return information particular data versions included peacesciencer well suggested citation key scanning ps_cite(). category specified searching, just returns version information data included functions package.","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"base functionality simple pattern-matching keywords ps_data_version. simple pattern-matching base R. assume user familiarity types data included package. searching done category included ps_data_version data. Users may want just minimally run ps_version() argument specified see . Typing unique(ps_data_version$category) may also get started. user can consider companion function ps_cite(). Whereas ps_cite() return appropriate citation use bibliography, may tell version number . example, classic suggested citations Correlates War National Material Capabilities data Singer et al. (1972) Singer (1987), though data included package 30 years older recent citation two. information communicated can/included alongside parenthetical citation. example, contiguity data quite bit current suggested citation Stinnett et al. (2002). Thus, user may want cite data paper something like (Stinnett et al. 2002, v. 3.2).","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/ps_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Version Information About Data Included in peacesciencer — ps_version","text":"","code":"# What can you search for... unique(ps_data_version$category) #> [1] \"states\" \"leaders\" \"alliance\" #> [4] \"democracy\" \"capitals\" \"contiguity\" #> [7] \"igo\" \"majors\" \"conflict_interstate\" #> [10] \"distance\" \"capabilities\" \"gdp\" #> [13] \"sdp\" \"population\" \"trade\" #> [16] \"conflict_intrastate\" \"fractionalization\" \"polarization\" #> [19] \"terrain\" \"rivalries\" \"dyadic_similarity\" # will show the data versions for everything ps_version() #> # A tibble: 32 × 4 #> category data version bibtexkey #> #> 1 states Correlates of War State System Membership 2016 cowstates2016 #> 2 leaders LEAD 2015 ellisetal2015le… #> 3 leaders Archigos 4.1 goemansetal2009… #> 4 alliance ATOP 5 leedsetal2002at… #> 5 alliance Correlates of War Formal Alliances 4.1 gibler2009ima #> 6 democracy Polity 2017 marshalletal201… #> 7 democracy {QuickUDS} 0.2.3 marquez2016qme #> 8 democracy V-Dem 10 coppedgeetal202… #> 9 capitals {peacesciencer} 2020 peacesciencer-p… #> 10 contiguity Correlates of War Direct Contiguity 3.2 stinnettetal200… #> # … with 22 more rows # will show data versions for particular categories of data ps_version(\"democracy\") #> # A tibble: 3 × 4 #> category data version bibtexkey #> #> 1 democracy Polity 2017 marshalletal2017p #> 2 democracy {QuickUDS} 0.2.3 marquez2016qme #> 3 democracy V-Dem 10 coppedgeetal2020vdem ps_version(\"leaders\") #> # A tibble: 3 × 4 #> category data version bibtexkey #> #> 1 leaders LEAD 2015 ellisetal2015lead #> 2 leaders Archigos 4.1 goemansetal2009ia #> 3 leaders Leader Willingness to Use Force 2020 cartersmith2020fml"},{"path":"http://svmiller.com/reference/rugged.html","id":null,"dir":"Reference","previous_headings":"","what":"Rugged/Mountainous Terrain Data — rugged","title":"Rugged/Mountainous Terrain Data — rugged","text":"data set state-level estimates \"ruggedness\" state's terrain.","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rugged/Mountainous Terrain Data — rugged","text":"","code":"rugged"},{"path":"http://svmiller.com/reference/rugged.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Rugged/Mountainous Terrain Data — rugged","text":"data frame 192 observations following 6 variables. ccode Correlates War state code gwcode Gleditsch-Ward state code rugged terrain ruggedness index newlmtnest (natural log) percentage estimate state's terrain mountainous","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rugged/Mountainous Terrain Data — rugged","text":"data-raw directory project's Github contains information data created. goes without saying data move slowly data really applicable making state--state comparisons states--time comparisons. terrain ruggedness index originally introduced Riley et al. (1999) amended Nunn Puga (2012). mountain terrain data originally created Fearon Laitin (2003) extended amended Gibler Miller (2014). data functionally time-agnostic---use caution state-year analyses---data sets seem benchmark around 1999-2000. sure matters much, matters little margins, suppose, suspect major differences interpretation much \"rugged\" Soviet Union Russia, Yugoslavia Serbia.","code":""},{"path":"http://svmiller.com/reference/rugged.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rugged/Mountainous Terrain Data — rugged","text":"Fearon, James D., David Laitin, \"Ethnicity, Insurgency, Civil War\" American Political Science Review 97: 75–90. Gibler, Douglas M. Steven V. Miller. 2014. \"External Territorial Threat, State Capacity, Civil War.\" Journal Peace Research 51(5): 634-646. Nunn, Nathan Diego Puga. 2012. \"Ruggedness: Blessing Bad Geography Africa.\" Review Economics Statistics. 94(1): 20-36. Riley, Shawn J., Stephen D. DeGloria, Robert Elliot. 1999. \"Terrain Ruggedness Index Quantifies Topographic Heterogeneity,” Intermountain Journal Sciences 5: 23–27.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"show_duplicates() shows data duplicated data generated peacesciencer. useful diagnostic tool users --functions peacesciencer.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"","code":"show_duplicates(data)"},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"data dyad-year data frame state-year data frame created peacesciencer.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"show_duplicates() takes dyad-year data frame state-year data frame generated peacesciencer shows observations duplicated unique combination dyad-year state-year, contingent supplied .","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"function leans attributes data provided create_dyadyear() create_stateyear() function. Make sure function (data created function) appear top proverbial pipe. data returned also new column called duplicated. Thus, implicit assumption function user column data name interest user. overwritten.","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/show_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame — show_duplicates","text":"","code":"# just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% show_duplicates() #> # A tibble: 1,838 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2981 2 40 1983 1 1 1 0 1 0 #> 2 3058 2 40 1983 1 1 1 0 1 0 #> 3 1554 2 70 1836 1 1 0 1 0 0 #> 4 1555 2 70 1836 1 1 1 0 0 0 #> 5 1556 2 70 1836 1 0 1 0 0 0 #> 6 1548 2 70 1860 1 0 1 0 0 0 #> 7 1549 2 70 1860 1 1 1 0 1 0 #> 8 2347 2 93 1982 1 0 0 1 1 1 #> 9 2977 2 93 1982 1 1 1 0 1 0 #> 10 2741 2 95 1988 1 0 1 0 1 0 #> # … with 1,828 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% show_duplicates() #> # A tibble: 2,152 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2981 2 40 1983 1 1 1 0 0 0 #> 2 3058 2 40 1983 1 1 1 0 1 2 #> 3 69 2 42 1916 1 0 1 0 0 0 #> 4 322 2 42 1916 1 1 1 0 -9 -9 #> 5 1554 2 70 1836 1 1 0 1 0 0 #> 6 1555 2 70 1836 1 1 1 0 0 0 #> 7 1548 2 70 1860 1 0 1 0 0 0 #> 8 1549 2 70 1860 1 1 1 0 -9 -9 #> 9 2 2 200 1902 1 1 1 0 0 0 #> 10 254 2 200 1902 1 1 0 1 0 0 #> # … with 2,142 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2"},{"path":"http://svmiller.com/reference/td_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"simple summary strategic (inter-state) rivalries Thompson Dreyer (2012).","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"","code":"td_rivalries"},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"data frame 197 observations following 10 variables. rivalryno numeric vector rivalry number rivalryname character vector rivalry name ccode1 Correlates War state code state lowest Correlates War state code rivalry ccode2 Correlates War state code state highest Correlates War state code rivalry styear numeric vector start year rivalry endyear numeric vector end year rivalry region character vector region rivalry, per Thompson Dreyer (2012) type1 character vector primary type rivalry (spatial, positional, ideological, interventionary) type2 character vector secondary type rivalry, applicable (spatial, positional, ideological, interventionary) type3 character vector tertiary type rivalry, applicable (spatial, positional, ideological, interventionary)","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"Information gathered appendix Thompson Dreyer (2012). Ongoing rivalries right-bound 2010, date publication Thompson Dreyer's handbook. Users free change like. Data effectively identical strategic_rivalries stevemisc, include behind--scenes processing (described blog post http://svmiller.com) available see project's Github repository. data object also renamed avoid conflict.","code":""},{"path":"http://svmiller.com/reference/td_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thompson and Dreyer's (2012) Strategic Rivalries, 1494-2010 — td_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R. David Dreyer. 2012. Handbook International Rivalries. CQ Press.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":null,"dir":"Reference","previous_headings":"","what":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"simple summary strategic (inter-state) rivalries Thompson et al. (2021). simple spreadsheet entry job (light cleaning) based information provided pages 34 46 book.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"","code":"tss_rivalries"},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"data frame 264 observations following 12 variables. tssr_id numeric vector rivalry number rivalry character vector rivalry name ccode1 Correlates War state code state lowest Correlates War state code rivalry ccode2 Correlates War state code state highest Correlates War state code rivalry start numeric vector start year rivalry end numeric vector end year rivalry positional numeric vector 1 Thompson et al. (2021) say rivalry positional element (NA otherwise) spatial numeric vector 1 Thompson et al. (2021) say rivalry spatial element (NA otherwise) ideological numeric vector 1 Thompson et al. (2021) say rivalry ideological element (NA otherwise) interventionary numeric vector 1 Thompson et al. (2021) say rivalry interventionary element (NA otherwise) principal numeric vector 1 Thompson et al. (2021) say rivalry primary (principal) rivalry rivals (NA otherwise) aprin numeric vector 1 Thompson et al. (2021) say asymmetric principal rivalry (NA otherwise)","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"Information gathered chapter 2 Thompson et al. (2021). Ongoing rivalries right-bound 2020. several cases, start dates 1494 1816 originally \"P\" attached , indicating ongoing particular year. captured \"raw\" spreadsheet included \"data-raw\" directory, though adjusted finished data product. file adjusts assuredly two print errors Thompson et al. (2021). print, Thompson et al. (2021) say Italy-Turkey rivalry extends 1884-1843 say Mauritania-Morocco rivalry extends 1060-1969. meant end year 1943 first case start year 1960 second case. fixed version. Venice never appears data set Correlates War ecosystem data, gave country code 324 sake data (previous Thompson Dreyer (2012) version ). never use , worth saying loud . Thompson et al. (2021) dedicate book expanding various types rivalry. Users know Thompson Dreyer (2012) version see differences . First, rivalries longer formal primary, secondary, tertiary types. Instead, rivalries /markers whether particular element rivalry type present rivalry. read far Thompson et al. (2021), along ordering information Chapter 2, reads like just made informal otherwise formal classification component Thompson Dreyer (2012) rivalry data. Positional rivalries seem informal \"type 1\" Thompson et al. (2021) discuss , dissimilar classic alliance scholarship treats defense \"type 1\" pledge. matter, book already explicit positional spatial rivalries clearly different ideological interventionary rivalries, certainly interventionary rivalries. \"Principal\" \"asymmetric principal\" rivalries new classification Thompson et al. (2021), relative Thompson Dreyer (2012). \"Principal\" rivalries exist 1) two rivals rivalry 2) two rivals elevate rivalry primary rivalry among rivalries. Asymmetric principal rivalries one two rivals sees primary rival. Consider two U.S.-Russian rivalries illustrative. Tge rivalry Soviet Union (tssr_id = 100) primary rivalry U.S. (Soviet Union). However, U.S. presently sees China main rival (tssr_id = 211). ongoing rivalry Russia (tssr_id = 246) one Russia sees U.S. primary rival U.S. see Russia way.","code":""},{"path":"http://svmiller.com/reference/tss_rivalries.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thompson et al. (2021) Strategic Rivalries, 1494-2020 — tss_rivalries","text":"Miller, Steven V. 2019. \"Create Extend Strategic (International) Rivalry Data R\". URL: http://svmiller.com/blog/2019/10/create-extend-strategic-rivalry-data-r/ Thompson, William R., Kentaro Sakuwa, Prashant Hosur Suhas. 2021. Analyzing Strategic Rivalries World Politics: Types Rivalry, Regional Variation, Escalation/De-escalation. Springer.","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":null,"dir":"Reference","previous_headings":"","what":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"(kind ) dyadic, mostly state-level data, used internally stuff UCDP armed conflict data","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"","code":"ucdp_acd"},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"data frame 4164 observations following 15 variables. conflict_id conflict identifier, confused episode identifier (think UCDP offers) year numeric vector year gwno_a Gleditsch-Ward state code state side armed conflict gwno_a_2nd Gleditsch-Ward state code state actively supported side armed conflict use troops gwno_b Gleditsch-Ward state code actor side B armed conflict gwno_b_2nd Gleditsch-Ward state code state actively supported side B armed conflict use troops incompatibility character vector main conflict issue (\"territory\", \"government\", \"\") intensity_level numeric vector intensity level calendar year (1 = minor (25-999 deaths), 2 = war (>1,000 deaths)) type_of_conflict character vector type conflict (\"extrasystemic\", \"interstate\", \"intrastate\", \"II\"). \"II\" simple abbreviation \"internationalized intrastate\" start_date date first battle-related death conflict, confused first battle-related death episode start_prec level precision start_date start_date2 date first battle-related death episode, confused first battle-related death conflict start_prec2 level precision start_date2 ep_end dummy variable whether conflict episode ended calendar year observation ep_end_date episode end date, applicable","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"data-raw directory project's Github show processed multiple strings multiple states given side.","code":""},{"path":"http://svmiller.com/reference/ucdp_acd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"UCDP Armed Conflict Data (ACD) (v. 20.1) — ucdp_acd","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"UCDP Onset Data (v. 19.1) — ucdp_onsets","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"state-year level data armed conflict onsets provided Uppsala Conflict Data Program (UCDP).","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"","code":"ucdp_onsets"},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"data frame 10142 observations following eight variables. gwcode numeric vector Gleditsch-Ward state code year numeric vector year sumnewconf numeric vector sum new conflicts/conflict-dyads sumonset1 numeric vector sum new conflict episodes, whether new conflict one year since last conflict episode sumonset2 numeric vector sum new conflict episodes, whether new conflict two years since last conflict episode sumonset3 numeric vector sum new conflict episodes, whether new conflict three years since last conflict episode sumonset5 numeric vector sum new conflict episodes, whether new conflict five years since last conflict episode sumonset10 numeric vector sum new conflict episodes, whether new conflict 10 years since last conflict episode","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"user want note data provided UCDP technically country-year observations. instead duplicate observations cases new conflicts new conflict episodes. , original data provide information conflict-dyad question duplicates pertain. means data can package's mission provide summary information. user probably recode variables something else may want particular application","code":""},{"path":"http://svmiller.com/reference/ucdp_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"UCDP Onset Data (v. 19.1) — ucdp_onsets","text":"Gleditsch, Nils Petter; Peter Wallensteen, Mikael Eriksson, Margareta Sollenberg & Havard Strand (2002) Armed Conflict 1946–2001: New Dataset. Journal Peace Research 39(5): 615–637. Pettersson, Therese; Stina Hogbladh & Magnus Oberg (2019). Organized violence, 1989-2018 peace agreements. Journal Peace Research 56(4): 589-603.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"whittle_conflicts_duration() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest estimated duration.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"","code":"whittle_conflicts_duration(data, durtype = \"mindur\") wc_duration(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"data data frame declared conflict attribute type. durtype duration filter/whittle data. Options include \"mindur\" \"maxdur\". default \"mindur\". ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"whittle_conflicts_duration() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible cut later procedure (whittling onsets whittle_conflicts_onsets(), maybe things extent dispute-level duration heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). conflicts can unknown length often come estimates minimum duration maximum duration. concern durtype parameter function. many/conflicts, certainly thinking inter-state dispute data, dates known precision (day) estimate minimum conflict duration equal estimate maximum conflict duration. conflicts, estimates vary. importantly imply using particular whittle function default (mindur) produce different results using particular whittle function asking retain highest maximum duration (maxdur). Use function mind. wc_duration() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_duration.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Duration — whittle_conflicts_duration","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_duration() #> # A tibble: 9,308 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,298 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_duration() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,268 × 20 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,258 more rows, 10 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , mindur , maxdur , and abbreviated variable names #> # ¹​disponset, ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"whittle_conflicts_fatality() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest observed fatality.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"","code":"whittle_conflicts_fatality(data) wc_fatality(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"whittle_conflicts_fatality() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible second cut (whittling onsets whittle_conflicts_onsets() extent dispute-level fatality good heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). writing, Correlates War Gibler-Miller-Little conflict data record -9s fatalities. cases, dispute-level fatality momentarily recoded .5 (.e. fatal, without many fatalities). missing data problem Gibler Miller correct forthcoming publication Journal Conflict Resolution. , function makes kind determination disputes missing fatalities. wc_fatality() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_fatality.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Highest Fatality — whittle_conflicts_fatality","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_fatality() #> # A tibble: 9,504 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,494 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_fatality() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,536 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,526 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , fatality , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"whittle_conflicts_hostility() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations highest observed hostility.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"","code":"whittle_conflicts_hostility(data) wc_hostility(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"whittle_conflicts_hostility() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations highest observed dispute-level fatality. eliminate duplicates, far , sensible second third cut (whittling onsets whittle_conflicts_onsets() extent dispute-level hostility good heuristic dispute-level severity/importance.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). wc_hostility() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_hostility.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Hostility — whittle_conflicts_hostility","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_hostility() #> # A tibble: 9,550 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,540 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_hostility() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,596 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,586 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , hostlev , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Just Dropping Something (","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"whittle_conflicts_jds() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function just drop something, kind nuclear option.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"","code":"whittle_conflicts_jds(data) wc_jds(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"whittle_conflicts_jds() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). really absolute last exclusion rules researcher uses. \"nuclear option\", . Assuming run case exclusion rules isolate onsets severe disputes, remains end duplicates functionally equivalent observations. data duplicates, remaining observations basically . Therefore, just drop something. wc_jds() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_jds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Just Dropping Something (","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_jds() #> # A tibble: 9,284 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,274 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_jds() #> # A tibble: 10,234 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,224 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"whittle_conflicts_reciprocation() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function drop ongoing conflicts presence unique onsets.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"","code":"whittle_conflicts_onsets(data) wc_onsets(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"whittle_conflicts_onsets() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations unique onsets duplicates exist. eliminate duplicates, far , sensible place start.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). wc_onsets() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_onsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Unique Conflict Onset-Years from Conflict-Year Data — whittle_conflicts_onsets","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() #> # A tibble: 9,802 × 40 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2 2 200 1902 1 1 1 0 1 1 #> 2 2 200 2 1902 1 1 0 1 1 1 #> 3 3 300 345 1913 1 1 1 0 1 0 #> 4 3 345 300 1913 1 1 0 1 0 1 #> 5 4 200 339 1946 1 1 0 1 0 0 #> 6 4 339 200 1946 1 1 1 0 0 0 #> 7 7 200 651 1951 1 1 1 0 0 1 #> 8 7 200 651 1952 1 0 1 0 0 1 #> 9 7 651 200 1951 1 1 0 1 1 0 #> 10 7 651 200 1952 1 0 0 1 1 0 #> # … with 9,792 more rows, 30 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , duplicated , … cow_mid_dirdisps %>% whittle_conflicts_onsets() #> # A tibble: 10,874 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2 2 200 1902 1 1 1 0 0 0 #> 2 2 200 2 1902 1 1 0 1 0 0 #> 3 3 300 345 1913 1 1 1 0 0 0 #> 4 3 345 300 1913 1 1 0 1 0 0 #> 5 4 200 339 1946 1 1 0 1 2 0 #> 6 4 339 200 1946 1 1 1 0 0 2 #> 7 7 200 651 1951 1 1 1 0 1 2 #> 8 7 200 651 1952 1 0 1 0 1 2 #> 9 7 651 200 1951 1 1 0 1 2 1 #> 10 7 651 200 1952 1 0 0 1 2 1 #> # … with 10,864 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , duplicated , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"whittle_conflicts_reciprocation() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations reciprocated (.e. militarized actions sides conflict).","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"","code":"whittle_conflicts_reciprocation(data) wc_recip(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"whittle_conflicts_reciprocation() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations militarized actions sides conflict. eliminate duplicates, far , sensible cut later procedure (whittling onsets whittle_conflicts_onsets() extent dispute-level reciprocation heuristic dispute-level severity/importance (considerations).","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). Scholars free use heuristic whittling conflict-year data coerced true dyad-year data, remiss offer caveat reciprocation variable inter-state dispute data. Namely, noisy scholars often think inter-state dispute data. Reciprocation observed militarized action sides conflict. definition, someone Side militarized action. every state Side B . However, scholars interpret absence militarized responses. forthcoming article Journal Conflict Resolution, Doug Gibler make case reciprocation useful variable maintain can invite errors (often case CoW-MID data) obscure fact states attacked another side routinely fight back. many occasions, also successfully repel attack. Scholars uncritically use variable, certainly hypothesis-testing audience costs, borrowing trouble measure. wc_recip() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_reciprocation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Conflict Reciprocation — whittle_conflicts_reciprocation","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_reciprocation() #> # A tibble: 9,640 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,630 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_reciprocation() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,590 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,580 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , recip , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":null,"dir":"Reference","previous_headings":"","what":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"whittle_conflicts_startmonth() class --functions coercing (.e. \"whittling\") conflict-year data cross-sectional units unique conflict-year data cross-sectional unit. inspiration clearly problem whittling dyadic dispute-year data true dyad-year data (like Gibler-Miller-Little conflict data). particular function keep observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"","code":"whittle_conflicts_startmonth(data) wc_stmon(...)"},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"data data frame declared conflict attribute type. ... optional, make shortcut work","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"whittle_conflicts_startmonth() takes dyad-year data frame leader-dyad-year data frame declared conflict attribute type , grouping dyad year, returns just observations lowest start month.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Dyads capable multiple disputes given year, can create problem merging complete dyad-year data frame. Consider case France Italy 1860, three separate dispute onsets year (MID#0112, MID#0113, MID#0306), illustrative problem. default process peacesciencer employs several rules whittle duplicate dyad-years merging dyad-year data frame. available add_cow_mids() add_gml_mids(). really one last exclusion rules researcher uses. substantive reason assume lower start month matters cause isolating \"serious\" \"severe\" disputes presence duplicates. really just way isolating duplicated observation happened first remaining duplicates otherwise similar . wc_stmon() simple, less wordy, shortcut function.","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Miller, Steven V. 2021. \"peacesciencer Coerces Dispute-Year Data Dyad-Year Data\". URL: http://svmiller.com/peacesciencer/articles/coerce-dispute-year-dyad-year.html","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"Steven V. Miller","code":""},{"path":"http://svmiller.com/reference/whittle_conflicts_startmonth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Whittle Duplicate Conflict-Years by Lowest Start Month — whittle_conflicts_startmonth","text":"","code":"# \\donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) gml_dirdisp %>% whittle_conflicts_onsets() %>% whittle_conflicts_startmonth() #> # A tibble: 9,344 × 39 #> dispnum ccode1 ccode2 year midongoing midonset sidea1 sidea2 revst…¹ revst…² #> #> 1 2968 2 20 1979 1 1 0 1 0 1 #> 2 3900 2 20 1989 1 1 0 1 0 1 #> 3 3972 2 20 1991 1 1 1 0 1 0 #> 4 4183 2 20 1997 1 1 0 1 0 1 #> 5 1665 2 40 1921 1 1 1 0 1 0 #> 6 1677 2 40 1933 1 1 1 0 1 0 #> 7 1677 2 40 1934 1 0 1 0 1 0 #> 8 246 2 40 1960 1 1 1 0 1 0 #> 9 246 2 40 1961 1 0 1 0 1 0 #> 10 61 2 40 1962 1 1 1 0 1 0 #> # … with 9,334 more rows, 29 more variables: revtype11 , revtype12 , #> # revtype21 , revtype22 , fatality1 , fatality2 , #> # fatalpre1 , fatalpre2 , hiact1 , hiact2 , #> # hostlev1 , hostlev2 , orig1 , orig2 , hiact , #> # hostlev , mindur , maxdur , outcome , settle , #> # fatality , fatalpre , stmon , endmon , recip , #> # numa , numb , ongo2010 , version , and abbreviated … cow_mid_dirdisps %>% whittle_conflicts_onsets() %>% whittle_conflicts_startmonth() #> Joining with `by = join_by(dispnum)` #> # A tibble: 10,296 × 19 #> dispnum ccode1 ccode2 year dispongoing dispo…¹ sidea1 sidea2 fatal…² fatal…³ #> #> 1 2968 2 20 1979 1 1 0 1 0 0 #> 2 3900 2 20 1989 1 1 0 1 0 0 #> 3 3972 2 20 1991 1 1 1 0 0 0 #> 4 4183 2 20 1997 1 1 0 1 0 0 #> 5 1665 2 40 1921 1 1 1 0 0 0 #> 6 1677 2 40 1933 1 1 1 0 0 0 #> 7 1677 2 40 1934 1 0 1 0 0 0 #> 8 246 2 40 1960 1 1 0 1 0 0 #> 9 246 2 40 1961 1 0 0 1 0 0 #> 10 61 2 40 1962 1 1 1 0 0 0 #> # … with 10,286 more rows, 9 more variables: fatalpre1 , fatalpre2 , #> # hiact1 , hiact2 , hostlev1 , hostlev2 , orig1 , #> # orig2 , stmon , and abbreviated variable names ¹​disponset, #> # ²​fatality1, ³​fatality2 # }"},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-110","dir":"Changelog","previous_headings":"","what":"peacesciencer 1.1.0","title":"peacesciencer 1.1.0","text":"Changes include: Package now depends version 1.6.0 {stevemisc}. comes later versions R balk use order() data frames. Changes documentation clarity/presentation. Changes file compression, appropriate. download_extdata() download augmented dyadic minimum distance data CoW G-W states 1886 2019. Add tss_rivalries updated rivalry data 1494 2020. Fixed bug atop_alliance cow_alliance. ’s less peacesciencer bug, per se, raw data presented directed actually directed . now. Fixed bug add_cow_alliance() honor temporal bound alliance data (.e. 1816-2012). b.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-100","dir":"Changelog","previous_headings":"","what":"peacesciencer 1.0.0","title":"peacesciencer 1.0.0","text":"CRAN release: 2022-03-24 version odds ends version accelerated 1.0.0 coincide acceptance manuscript describing package Conflict Management Peace Science. Clarify add_cow_mids() add_gml_mids() default case-exclusion rules dyadic analyses. Assorted documentation upgrades clarity. dyadic foreign policy similarity data now Tau-b estimates. generated , using valued alliance data, used caution (perhaps used ). Check documentation add_fpsim() download_extdata() . Update national material capabilities data (cow_nmc) version 6.0. Update cow_ddy gw_ddy, since ’s 2022 now. Add grh_arms_races arms race data. Amend/update items ps_bib. Change ps_cite() longer depend bib2df. , remove bib2df package dependency.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-070","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.7.0","title":"peacesciencer 0.7.0","text":"CRAN release: 2021-11-11 leader-intensive update. Additions/new features include: LEAD: data set select leader experience attribute descriptions (LEAD). lwuf: data set Carter Smith (2020) measuring leader willingness use force. download_extdata() now also downloads directed leader dyad-year data directed leader dyad-years 1870 2015. data come two forms. One possible (inter-state, leader-overlap) dyadic leader pairings 1870 2015, presented Archigos data. second standardizes data CoW state system data. also downloads directed dyad-yer data chance-corrected measures dyadic foreign policy similarity. Type ?download_extdata() R session updating information. create_leaderdyadyears(): create leader dyad-year data (via archigos) leader dyad-year combinations 1870 2015. function leans remote data available download download_extdata(). function returns either possible Gleditsch-Ward dyadic leader pairings (standardized Gleditsch-Ward state system dates) standardizes Archigos data Correlates War state system member data. gml_part: data set participant summary information GML MID data. add_fpsim() adds estimates dyadic foreign policy similarity dyad-year leader-dyad-year data. add_gml_mids() now works leader-year data. See documentation . add_spells() general peace spell calculations, though package now depend v. 1.3.0 {stevemisc}. add_lwuf() adds estimates leader willingness use force leader-year leader-dyad-year analyses. add_lead() adds leader attributes leader-year leader-dyad-year analyses. gml_mid_dirleaderdisps gml_mid_ddlydisps include data leader dyads conflict. declare_attributes() allows users declare package-specific attributes outside data bring R session. allows user use many shortcuts package data. ps_version() display version information data included package. false_cow_dyads false_gw_dyads list handful dyads appear year, never day year. ’re used anti-joining create_dyadyears(). leader_codes matches, well one can, leader/observation codes Archigos 4.1, Archigos 2.9, LEAD data. changes include: Several functions now leader-year leader-dyad-year corollaries. Examples include add_creg_fractionalization(), add_rugged_terrain(), add_democracy(), . functions, like add_gml_mids(), can anchored explicitly leader-level units analyses. Several functions (e.g. add_sdp_gdp() others like ) fundamentally still state-year dyad-year functions extent leaders still nested states leader-dyads just derivation inter-state dyads (.e. leaders nested states). Use caution mind, though functions still useful leader-level analyses interested covariates making state--state comparisons top leader-level analyses. data cow_sdp_gdp gw_sdp_gdp now rounded three decimal points. “economic” data routinely biggest package, ’s decimal points. justification data estimated/simulated anyways information loss 1/1000th decimal point. procedure basically cuts size data less 25% original size. huge reduction disk space. “leader-year” (leader_year) now attribute. appropriate, leader-year state-year functions treated . example, GDP data contained add_sdp_gdp() fundamentally state-year, perhaps leader-year control interest even leaders nested states. “leader-dyad-year” (leader_dyad_year) now attribute. appropriate, leader-year leader-dyad-year functions treated . possible/tractable, leader-dyad-year data explicitly anchored leader-level units analysis (e.g. add_gml_mids(), prominently). create_leaderyears() works observation ID leader ID. Observation IDs unique leader-period, leader IDs . directed leader dyad-year data indexed observation ID leader ID, per se. leaders can multiple terms office. add_peace_years() superseded add_spells(). “superseded” language communicates function still work previous releases, data types supported function, though development stop. add_spells() promises greater functionality. Communicating changes via badges brings lifecycle imported package. archigos data’s ccode renamed gwcode reflect actually Gleditsch-Ward state codes. “whittle” functions now work leader-dyadic conflict data available package. package started taking inventory non-ASCII characters appear package (e.g. spelling “Wuerttemberg” U-umlaut) replacing . functionality issue . problem CRAN raises note every single non-ASCII character sees ’d like avoid CRAN hammer can. create_leaderyears(), create_dyadyears(), create_stateyears() built-argument subsetting years returned function (subset_years). Use discretion.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-060","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.6.0","title":"peacesciencer 0.6.0","text":"CRAN release: 2021-10-13 Extend cow_mindist gw_mindist data, given new {cshapes} updates. Data now run 1886 2019. Create cow_capitals gw_capitals data. Remove capitals data redundancy. capital data sets extended 2020. add_capital_distance() now works Correlates War Gleditsch-Ward data, dyad-year state-year. Fix bug add_atop_alliance() added 0s years ATOP domain. Thanks @joshuaalley pointing . Add/start helper function file. internal functions may need write order reduce potential dependency issues resulting package archival. necessitated Oct. 5, 2021 email Brian Ripley slated removal lubridate. Earlier versions package uncritically leaned lubridate functions either write (.e. year(), now .pshf_year()) already duplicated base functions R (.e. ymd(), wrapper .Date() use ). , lubridate longer requirement package. Upgrade GML conflict data sets 2.2.1. Fix/update documentation . Add dispute-level summary GML conflict data assist user-run whittle functions. gml_mid_disps. Add ps_conflict_type attributes conflict data (e.g. CoW-MID, GML). Add messages case exclusion rules add_cow_mids() add_gml_mids(). Add “whittle” class functions. include whittle_conflicts_onsets(), whittle_conflicts_fatality(), whittle_conflicts_hostility(), whittle_conflicts_duration(), whittle_conflicts_reciprocation(), whittle_conflicts_startmonth(), whittle_conflicts_jds(). admittedly gnarly function names type don’t IDE like RStudio assist . Thus, respective functions come shortcuts wc_ (e.g. wc_onsets()). Check package documentation see . Add show_duplicates() diagnostic tool. function useful users want advanced stuff data created peacesciencer (e.g. merging custom data) want see botched merge creating duplicate observations. Add/update stuff related leaders. archigos data frame now includes information leaders (e.g. name, gender, year birth). create_leaderyears() create leader-year data well. next update expand leader functions. now, ensuing output function treated synonymous state-year data. Add download_extdata() way side-stepping package space limitations. files stored remotely loaded user’s discretion, function . largely brought CoW trade data (cow_trade_ndy), also removed update. data may moved remotely future, though package endeavor keep bare minimum. Importantly, download_extdata() keeps inventory downloading. Data information included therein. develop implicitly assume directory package installed writable user. like 99% users, shouldn’t problem (executing .libPaths() confirm ). reach . Remove country name creg data frame.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-050","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.5.0","title":"peacesciencer 0.5.0","text":"CRAN release: 2021-06-21 Add bib2df package dependency. Force upgraded version {stevemisc} package dependency. Add LazyDataCompression: xz DESCRIPTION Add “system” attributes create_dyadyears(), create_statedays(), create_stateyears(). Add add_cow_wars() function. Add add_ccode_to_gw(). Fix underlying data cow_gw_years. Add gw_cow_years. Add add_strategic_rivalries(). Add add_ucdp_acd(). , update ucdp_acd data functionality. Add add_rugged_terrain(). Add cow_trade_ndy data. , update add_cow_trade() function speed upgrades. Add cow_war_inter, cow_war_intra data. Add creg data. Add gwcode_democracy data. add_democracy() now takes CoW G-W data. Add hief data. Add rugged data. Add td_rivalries data. Add ps_cite() ps_bib. Remove citations. Add log-transformed GDP per capita estimates cow_sdp_gdp gw_sdp_gdp. Update add_sdp_gdp() reflect change. Clarify documentation add_contiguity() non-contiguous dyads 0s 6s. Briefly: don’t think data ordinal don’t encourage researcher think ordinal either. Expand add_peace_years(), now works UCDP conflict data. filter_prd() now shortcut add_contiguity() /add_cow_majors() called near top pipe (.e. user executed commands required calculate politically relevant dyad status). Fix bug add_nmc() (cow_nmc). -9 now explicitly NA, . Fix typos/incomplete information documentation. concerned references scholarship topics. Patch add_peace_years(), can now used anywhere chain commands (instead just last). add_peace_years() also bit “general” includes derivation sbtscs() function {stevemisc} package. Remove mandatory “system” calls add_minimum_distance() add_sdp_gdp(). merges now lean system attributes declared create_dyadyears() create_stateyears(). Remove add_mids(). Use add_gml_mids() instead. Update cow_ddy documentation.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-040","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.4.0","title":"peacesciencer 0.4.0","text":"CRAN release: 2021-05-31 Add cow_mid_ddydisps, cow_mid_dirdisps, cow_mid_disps data. Add gml_mid_ddydisps data. Add add_cow_mids() function. Add add_gml_mids() function. Add add_peace_years() function. Deprecate add_mids(). Use add_gml_mids() instead. Assign ps_data_type == \"dyad_year\" attribute cow_mid_dirdisps gml_dirdisp. allows peacesciencer functions data sets. File compression data files ()","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-030","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.3.0","title":"peacesciencer 0.3.0","text":"CRAN release: 2021-04-28 Add atop_alliance (directed dyad-year) data Add archigos data Add cow_sdp_gdp gw_sdp_gdp data Add ucdp_acd data Add ucdp_onsets data Add add_archigos() function Add add_atop_alliance() function Add add_minimum_distance() function. now, default. must specify “gw” “cow”. Add add_sdp_gdp() function. now, default. must specify “gw” “cow”. Add add_ucdp_onset() function. Add “stops” force correct merge correct system code. applications, Correlates War codes. File compression data files () Fixed bug filter_prd(). Past versions code treated non-contiguous dyads 6s. , ’re 0s. created situations wasn’t filtering anything function. Rename variables cow_alliance distinguish ATOP equivalents.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-020","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.2.0","title":"peacesciencer 0.2.0","text":"CRAN release: 2021-03-05 Fix stupid mistake(s) README. File compression data files. Add Correlates War intergovernmental organizations data. Add function adding Correlates War intergovernmental organizations data. Add Correlates War trade data (state-year dyad-year). Add minimum distance data Add citations data frame assistance properly citing things. Add create_statedays() function.","code":""},{"path":"http://svmiller.com/news/index.html","id":"peacesciencer-010","dir":"Changelog","previous_headings":"","what":"peacesciencer 0.1.0","title":"peacesciencer 0.1.0","text":"CRAN release: 2020-12-19 Initial developmental release","code":""}]