Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 059
Research workflow/4 steps

Quantitative Social Science: data and code (qss)

01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 4 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 4
01
Data prep

Install and load qss

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Install the teaching package from GitHub and load the resume audit-experiment dataset from the Causality chapter.

Reads fromNot specified Feeds into#2
Key code
# Install:  remotes::install_github("kosukeimai/qss-package")
# devtools::install_github("kosukeimai/qss-package", build_vignettes = TRUE)
library(qss)
data(resume, package = "qss")

Reference / docs ↗

Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

No user data required—the package supplies the textbook's bundled datasets and chapter vignettes.

Show data format & exampleHide example
dataset description rows
elections U.S. election returns 1000+
afghan Afghanistan survey 2754
resume resume audit experiment 4870
social social-pressure experiment 305866
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 0
01FigureRésumé-callback rates by perceived race — the 3.2-percentage-point gap.

Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.

The estimate

\tau=\mathbb E\big[Y(1)-Y(0)\big]

Context & interpretation

⚠️ Unofficial community showcase of qss (docs). Not affiliated with the authors — all credit to Kosuke Imai & coauthors; this summarizes public documentation.

What it does: qss is the official companion R package to Kosuke Imai's textbook Quantitative Social Science: An Introduction (Princeton University Press, 2017). It packages all of the book's datasets and reproducible code so students and instructors can follow along chapter by chapter. How it works: the package ships ready-to-load datasets (elections, civil war, social-media, intervention studies, and more) and a set of vignettes—one per chapter (causality, measurement, prediction, probability, uncertainty)—that walk through the analyses using base R. Rather than introducing new estimators, it provides a curated, classroom-tested foundation for learning causal inference, measurement, prediction, and statistical inference through real social-science data. Assumptions: none statistical—it is a pedagogical resource. Installed from GitHub (not CRAN), typically with build_vignettes = TRUE to access the chapter tutorials. It anchors a wider teaching ecosystem, including tidyverse and learnr adaptations of the same material.

What you get — Loadable datasets and per-chapter vignettes reproducing the book's analyses (causality, measurement, prediction, probability, uncertainty).

Example output

       call
race       0    1
  black 2278  157
  white 2200  235

prop.table(race.call.tab, margin = 1)[, 2]
     black      white 
0.06447639 0.09650924 

callback.rate["white"] - callback.rate["black"]
     white 
0.03203285 

Links: package · paper

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion