Skip to content

doriathais/teaching-notes

Repository files navigation

Cross-National Panel Data Analysis in R

A teaching walkthrough of quantitative methods for political science and international relations, using a research project on international projection and the North-South divide as a worked example.

Read the rendered notes →

What this covers

The document builds a complete cross-national panel data analysis from scratch, progressing through ten sections:

  1. Foundational concepts — what regression can and cannot tell us; associations vs. causes; partial associations; omitted variable bias
  2. Research design — formulating a research question at the intersection of IR/IPE literatures; choosing the dependent and independent variables; why panel data
  3. Data selection — the KOF Globalisation Index, V-Dem political indicators, and World Bank Development Indicators; what each dataset allows and does not allow us to test; variable transformation (log, z-score, centering)
  4. Data preparation — merging multi-source international datasets; country code standardisation; classification decisions (Global South, Non-Aligned Movement); merge validation
  5. Descriptive analysis — summary statistics; the wrong and right way to run a t-test on panel data; correlation analysis and collinearity
  6. Regression analysis — a sequence of eight models (pooled OLS, lagged IVs, country fixed effects, two-way fixed effects, first differences, random effects, interaction, subsample), each explained with its assumptions, rationale, expected output, and interpretation
  7. Diagnostic tests — Hausman, Breusch-Pagan LM, Breusch-Godfrey serial correlation, VIF; a decision tree for model selection
  8. Synthesis — what the results tell us and what they do not; connecting findings to IR/IPE debates
  9. Exercises — nine exercises including reversing the equation, the tautology test, residual analysis, and sensitivity to classification decisions
  10. Questioning the design — is the DV the right measure? Is OLS the right model family? Are we asking the right question? Findings from trajectory analysis that challenge the binary framing

Files

File Description
teaching-notes-international-projection.R Executable R script with embedded commentary (1,800+ lines)
index.html Rendered HTML with table of contents, code chunks, and output (served at the link above)
nam_members.csv Non-Aligned Movement membership list (117 countries, COW codes)
global_south.csv Global South classification (132 countries, COW codes)

Data

All data is downloaded programmatically when the script runs:

  • KOF Globalisation Index via the kofdata R package (ETH Zurich API)
  • V-Dem via the vdemdata R package (Varieties of Democracy)
  • World Development Indicators via the WDI R package (World Bank API)

No raw data files are distributed. Classification lists (nam_members.csv, global_south.csv) are included because they encode research decisions, not external data.

Requirements

  • R 4.1 or later
  • Packages: tidyverse, countrycode, kofdata, vdemdata, WDI, plm, lmtest, sandwich, stargazer, corrplot, car

Install V-Dem (not on CRAN):

remotes::install_github("vdeminstitute/vdemdata")

How to use

Open the R script (teaching-notes-international-projection.R) in RStudio and execute chunks sequentially. The commentary explains each step before the code runs.

Context

This document grew from an applied research project that asks whether the North-South divide in structural globalisation narrowed between 1998 and 2023. The project assembles a panel of 183 countries over 26 years, applies panel data econometrics, trajectory modelling, and network analysis to the question, and finds that the divide widened rather than narrowed. The teaching notes use the regression component of that project as a vehicle for teaching quantitative methods in political science.

Author

Thais Doria — PhD Candidate, Department of Politics and International Studies, University of Warwick.

License

MIT License

About

Cross-national panel data analysis in R: a teaching walkthrough using the KOF Globalisation Index, V-Dem, and World Bank data to study the North-South divide (1998-2023)

Topics

Resources

License

Stars

Watchers

Forks

Contributors