1  Introduction

A number of open-source tools now exist for accessing data relevant for studying conflict. Many recent advances in particular have been made using the R programming language. R itself is an open-source tool used by a large community of researchers. When it comes to studying conflict, my anecdotal impression is that a majority of quantitative conflict scholars use R for their research.1 It’s certainly no surprise that a number of R packages have been created that make it easy for other conflict scholars to access commonly used datasets.

One of the central R packages that we’ll be working with is {peacesciencer} which was introduced by Miller (2022) in the Journal of Conflict Management and Peace Science. As far as R packages go, this is by far one of the most comprehensive developed for accessing datasets used in conflict research. We’ll also consider other packages and data sources that may be useful as well. When we do, we’ll use {peacesciencer} as our starting point and cover some of the basics of “cross-walking” and merging in new datasets.

It is impossible to walk through all the possible ways of querying and merging conflict datasets in a single set of notes, but hopefully walking through a number of examples will be a good enough start. Whatever new datasets you work with in the future, the process of working with and combining new datasets will look very much like the examples demonstrated here.

These notes are organized in a straightforward way. For those new to R and statistical programming, the next two chapters provide some essential prerequisites. If you already are familiar with R, you can jump ahead to the second part of these notes where the {peacesciencer} package is introduced.

After summarizing the basics, the remainder of these notes are dedicated to working through applied data and analysis examples following topics and themes covered in the book Why We Fight by Blattman (2023). This book provides a great set of motivating examples for studying conflict with data. Blattman (2023) summarizes five key reasons for war:

  1. Unchecked interests
  2. Intangible incentives
  3. Uncertainty
  4. Commitment problems
  5. Misperceptions

For each one of these reasons for war, we’ll explore ways of quantifying these factors and assessing their correlation with conflict.

Blattman (2023) also covers four factors that help to promote peace by limiting the above factors:

  1. Interdependence
  2. Checks and balances
  3. Rules and enforcement
  4. Interventions

We will consider ways of studying each of these factors with data as well.

Importantly, none of the analyses presented here are meant to be either a refutation and confirmation of the arguments laid out in Why We Fight. The goal is to demonstrate the basics of quantitative data analysis for studying conflict. Any findings that either support or contradict the arguments made by Blattman (2023) are secondary. This isn’t a peer reviewed scholarly work, and shouldn’t be treated as such.

Now, without further ado, let’s get to it.


  1. If someone has formally surveyed IR scholars about their software habits, I’m not aware of it. But it’d be nice if someone would.↩︎