1 Introduction
1.1 Where I’m taking you
The better part of being a political scientist is working with data and using models and statistics to describe the world, make predictions, and identify causal links between policies and outcomes. Most political scientists don’t label themselves as “data scientists,” but they do data science on a regular basis (at least according to the way IBM defines it). My goal in writing this Quarto book is to provide a free resource on the basics of the data science of political science. I’ll do so by introducing you to three broad approaches to political research:
- Description: Using data, models, and statistics to uncover basic facts about the world.
- Prediction: Using data, models, and statistics to predict future events.
- Causation: Using data, models, and statistics to determine whether a causal relationship exists.
This is an introductory course to these modes of making sense of the world, so if you’re looking for a comprehensive and deeply technical treatment of these issues, this isn’t it. But if you’re just getting started, I hope that the content of this book provides you with a solid foundation.
This book is divided into four parts. The first is an introduction to software. While there are many great tools in existence for doing quantitative research and analysis, this book will offer applied instruction using the R programming language and the RStudio IDE. Why? For one, these are open source so you don’t have to pay money to use them. And two, a large community of analysts uses these tools (especially political scientists), which means there are a lot of helpful resources out there if you ever have a question about R or need to troubleshoot a problem. And of course, three, these are the tools I use in my own research and have the greatest expertise in, so I’m most qualified to teach about them as opposed to the alternatives.
Once the basics are covered, the book then moves to Part II, which deals with descriptive analysis. As the name implies, the goal of descriptive research is to, well, describe things (essentially to establish basic facts about the world). To give you something to really sink your teeth into, this section will be animated by a thematic focus on answering an important question: Did the U.S. show any favoritism toward certain countries in 2025 when it implemented unprecedented cuts to its foreign aid budget? To help you answer this question, I’ll cover the basics of looking at data by way of data visualization, regression analysis, and statistical inference.
In Part III I’ll shift gears to a different kind of research design: predictive analysis. Specifically, I’ll focus on the problem of trying to forecast U.S. Presidential elections. I’ll cover how you can generate new predictions from old data, and how you can refine your predictions by using methods of model validation and selection.
Finally, Part IV will cover causal inference. In this section, I’ll introduce you to the world of scientific policy evaluation, which is rapidly growing both at the U.S. federal level with offices like the Office of Evaluation Sciences, and across many large U.S. metros. There are even many similar organizations internationally. All of these groups are committed to using social science theory to guide the development and implementation of randomized controlled trials in existing and new policies to uncover evidence of what works and what doesn’t. They also use a variety of methodologies for uncovering evidence of causal impacts retrospectively (what are called quasi-experimental designs). Along the way, I’ll talk about the science and philosophy behind causal inference, and show you four foundational types of research designs for identifying causal relationships between policies and outcomes.
By the end of this course, you won’t be an expert in any of the methods I talk about. That takes longer than a single semester to develop. However, my hope is that you walk away with a sense of the analytical tools available to you and some critical thinking skills to evaluate quantitative research that you encounter in the real world.
1.2 Where I’m not taking you: AI
In this class you’ll learn how to write analysis code, and you’ll do research projects where I expect you write up analysis results in a paper. And I want you to actually write the code and do your own writing.
I’m not such a Luddite that I never use artificial intelligence—or what I prefer to call “pattern engines” or PEs because I think this is a better description of what these things actually are. But these PEs require critical judgement and attention to detail, both of which assume that the user has relevant competencies.
You don’t have relevant competencies. Not yet, anyway. You may think you do, and I don’t mean to imply that you aren’t intelligent. You are. But I doubt you already have fully formed intellectual habits and technical skills of the sort required to direct PEs to accomplish certain tasks, validate their work, and use them strategically (that is, sparingly and only when they provide a clear value-add).
The only way that you will develop the requisite competencies to use PEs well is to actually take the time to develop these competencies independent of PEs. Using these tools will stunt your growth, and as a result you’ll actually be at a disadvantage when using them compared to a person who actually spent some time building a solid foundation of skills and critical faculties before gaining access to top-of-the-line PEs.
One of my favorite takes on why you should just say “no” to using these tools comes from Andrew Heiss, an academic and professor at Georgia State University. In his words, even the best PEs are “bullshit machines”:
LLMs and AI systems like ChatGPT, Gemini, Claude, and so on are bullshit machines. That might sound hyperbolic, but at a technological level, that’s literally what they do. LLMs use fancy statistics to take an initial prompt or starting phrase and then generate the most plausible words or phrases that are likely to follow. They don’t care whether the text it creates is true—they only care about whether it looks plausible.
The technical definition of “bullshit” isn’t that it’s a lie. Someone who bullshits doesn’t care about the truth at all. To lie, you have to know and care about the truth. A bullshitter just says what sounds right (whatever it takes to sound credible, or smart, or plausible). PEs just provide something that seems likely based on what you asked for. They don’t have a firm grounding in the truth. This is why sometimes these tools will return hallucinations (fake citations or, in the case of coding, code that looks plausible but is actually totally incorrect).
To detect bullshit, you need to actually have some competencies. If you just jump headlong into using a bullshit machine, how will you know right from wrong, truth from hallucination, fact from fiction? If a PE returns something incorrect and you don’t catch it, it’s not the PE’s fault; it’s yours.
So do yourself a favor in this class and build up some skills. Put in some reps, to use the vernacular of weight lifting. You’ll actually be a better user of PEs down the road if you don’t use PEs now.