create_leaderyears() allows you to generate leader-year data from leader-level data provided in peacesciencer

## Usage

create_leaderyears(system = "archigos", standardize = "none", subset_years)

## Arguments

system

a leader system with which to create leader-years. Right now, only "archigos" is supported.

standardize

a character vector of length one: "cow", "gw", or "none". If "cow", the function standardizes the leader-years to just those that overlap with state system membership in the Correlates of War state system (see: cow_states). If "gw", the function standardizes the leader-years to just those that overlap with the state system dates of the Gleditsch-Ward date (see: gw_states). If "none", the function returns all leader-years as presented in Archigos (which is nominally denominated in Gleditsch-Ward state system codes, if not necessarily Gleditsch-Ward state system dates). Default is "none".

subset_years

and optional character vector for subsetting the years returned to just some temporal domain of interest to the user. For example, c(2000:2005) would subset the data to just all leader-years in 2000, 2001, 2002, 2003, 2004, and 2005 Be advised that it's easiest to subset the data after the full universe of leader-year data have been created. It is also agnostic about what was supplied to the standardize argument.

## Value

create_leaderyears() takes leader-level data available in peacesciencer and returns a leader-year-level data frame. This minimal output contains the observation ID from Archigos, the year, the state code for the leader (i.e. either Correlates of War or Gleditsch-Ward, depending on the standardize argument), the leader's name in Archigos (if it may help the reader to have that), an approximation of the leader's age, and the year in office for the leader (as a running count, starting at 1).

## Details

create_leaderyears(), as of writing, only supports the Archigos data set of leaders.

Many leader ages are known with precision. Many are not recorded in the Archigos data. Knowing well that years are aggregates of days, the leader age variable that gets returned in this output should be treated as an approximation of the leader's age.

Be mindful that leader tenure is calculated before any standardization argument. Archigos has some leader entries that precede the state system entry for the state, or otherwise do not coincide with state system dates. For example, Lynden Pindling was in his seventh year as leader of The Bahamas (in various titles) before independence in 1973 (in which he became prime minister). Leader tenure is not tethered to state system dates in situations like this (only the dates recorded in the Archigos data).

The leader tenure variable returned here does have the odd effect of potentially misstating leader tenure, or at least making it seem unusual. For example, Jimmy Carter (USA-1877) was president in 1977 (year 1), 1978 (year 2), 1979 (year 3), 1980 (year 4), and exited in January 1981 (year 5). Again: years are aggregates of days and it's not evident how else this information should be perfectly communicated with that in mind. Users with some R skills can extract the underlying information from the archigos data and, perhaps, calculate something like the maximum leader tenure (in days) on either Dec. 31 of the referent year, or leader exit before Dec. 31 that year, or something to that effect. No matter, I think this to at least be a defensible variable to present to the user with those limitations in mind. If the user is interested in leader tenure in a leader-year analysis, this variable should be fine. If the user is interested in something like the effect of a fifth year on some kind of leader behavior, they will want to figure out something else.

## References

Goemans, Henk E., Kristian Skrede Gleditsch, and Giacomo Chiozza. 2009. "Introducing Archigos: A Dataset of Political Leaders" Journal of Peace Research 46(2): 269--83.

Steven V. Miller

## Examples

# \donttest{
# standardize = 'none' is default
#> # A tibble: 17,686 × 7
#>    <chr>     <dbl> <chr>  <chr>  <dbl>      <dbl>     <dbl>
#>  1 USA-1869      2 Grant  M       1869          1        47
#>  2 USA-1869      2 Grant  M       1870          2        48
#>  3 USA-1869      2 Grant  M       1871          3        49
#>  4 USA-1869      2 Grant  M       1872          4        50
#>  5 USA-1869      2 Grant  M       1873          5        51
#>  6 USA-1869      2 Grant  M       1874          6        52
#>  7 USA-1869      2 Grant  M       1875          7        53
#>  8 USA-1869      2 Grant  M       1876          8        54
#>  9 USA-1869      2 Grant  M       1877          9        55
#> 10 USA-1877      2 Hayes  M       1877          1        55
#> # … with 17,676 more rows

#> Joining, by = c("gwcode", "date")
#> # A tibble: 17,361 × 7
#>    <chr>     <dbl> <chr>  <chr>  <dbl>      <dbl>     <dbl>
#>  1 USA-1869      2 Grant  M       1869          1        47
#>  2 USA-1869      2 Grant  M       1870          2        48
#>  3 USA-1869      2 Grant  M       1871          3        49
#>  4 USA-1869      2 Grant  M       1872          4        50
#>  5 USA-1869      2 Grant  M       1873          5        51
#>  6 USA-1869      2 Grant  M       1874          6        52
#>  7 USA-1869      2 Grant  M       1875          7        53
#>  8 USA-1869      2 Grant  M       1876          8        54
#>  9 USA-1869      2 Grant  M       1877          9        55
#> 10 USA-1877      2 Hayes  M       1877          1        55
#> # … with 17,351 more rows
# }