add_democracy()
allows you to add estimates of democracy to your data.
add_democracy(data, keep)
add_democracy()
takes a (dyad-year, leader-year, leader-dyad-year,
state-year) data frame and adds information about the level of democracy
for the state or two states in the dyad in a given year. If the data are
dyad-year or leader-dyad-year, the function adds six total columns for
the first state (i.e. ccode1
or gwcode1
) and the second state (i.e.
ccode2
or gwcode2
) about the level of democracy measured by the
Varieties of Democracy project (v2x_polyarchy
), the Polity project
(polity2
), and Xavier Marquez' QuickUDS
extensions/estimates. If the
data are state-year or leader-year, the function returns three additional
columns to the original data that contain that same information for a given
state in a given year.
a data frame with appropriate peacesciencer attributes
an optional parameter, specified as a character vector, about what democracy estimates the user wants to return from this function. If not specified, everything from the underlying democracy data is returned.
Steven V. Miller
As of version 1.2, this function leans on the information made available in the isard package. This is a spin-off package I maintain for data that require periodic updates for the functionality in this package. As of writing, peacesciencer only requires that you have the isard package installed. It does not require you to have any particular version of the package installed. Thus, what exactly this function returns may depend on the particular version of isard you have installed. This will assuredly concern the right-bound of the temporal domain of data you get.
You can read more about the data in the documentation for isard.
Be mindful that the data are fundamentally state-year and that extensions to leader-level data should be understood as approximations for leaders in a given state-year.
included in the cw_democracy
or gw_democracy
data in the isard
data. Otherwise, it will return an error that it cannot subset columns that
do not exist.
A vignette on the package's website talks about how these data are here
primarily to encourage you to maximize the number of observations in the
analysis to follow. Xavier Marquez' QuickUDS
estimates have the best
coverage. If democracy is ultimately a control variable, or otherwise a
variable not of huge concern for the analysis (i.e. the user has no
particular stake on the best measurement of democracy or the best
conceptualization and operationalization of "democracy"), please
use Marquez' estimates instead of Polity or V-dem. If the user is
doing an analysis of inter-state conflict, and across the standard
post-1816 domain in conflict studies, definitely don't use
the Polity data because the extent of its missingness is both large and
unnecessary. Please read the vignette describing these issues
here: http://svmiller.com/peacesciencer/articles/democracy.html
Please cite Miller (2022) for peacesciencer. Beyond that, consult the documentation in isard for additional citations (contingent on which democracy estimate you are using).
# just call `library(tidyverse)` at the top of the your script
library(magrittr)
cow_ddy %>% add_democracy()
create_stateyears(system="gw") %>% add_democracy()
create_stateyears(system="cow") %>% add_democracy()
Run the code above in your browser using DataLab