What's On This Page?
- The code and real-world datasets used in the exercises in the book
- Links to interactive graphs to help students develop an intuition about some of the trickier concepts in statistics
- Other resources under development such as review exercises, videos, and additional readings.
Other Resources:
- DSS Instructor Resources: This website hosts some of the materials we provide instructors who are using DSS as the main textbook in their course.
- Official Book Website (hosted by Princeton University Press)
STUDENT RESOURCES for DATA ANALYSIS FOR SOCIAL SCIENCE (DSS)
The student resources on this page are organized by chapter:
- Chapter 1: Introduction
- Chapter 2: Estimating Causal Effects with Randomized Experiments
- Chapter 3: Inferring Population Characteristics via Survey Research
- Chapter 4: Predicting Outcomes Using Linear Regression
- Chapter 5: Estimating Causal Effects with Observational Data
- Chapter 6: Probability
- Chapter 7: Quantifying Uncertainty
Although also provided below chapter-by-chapter, all the code and all the real-world datasets used in the exercises in the book are in a folder named DSS here. We recommend downloading this folder, unzipping it, and saving it directly on your Desktop, which is where the code used throughout the book assumes the DSS folder is located.
IMPORTANT NOTE: Any errors found in the these resources are my own. If you find any, I would really appreciate it if you could let me know by sending me an email at ellaudet@gmail.com. (Updated: 11/02/2023)
CHAPTER 1: INTRODUCTION
In chapter 1, we start from the very beginning by installing and familiarizing ourselves with the two programs we use―R and RStudio―and by laying the groundwork for forthcoming analyses.Code and Data Used in Book Exercises:
- Introduction.R (R script with the code)
- STAR.csv (CSV file with the data)
Review Exercises:
- To access them run the code in this R script in RStudio
Additional Readings:
CHAPTER 2: ESTIMATING CAUSAL EFFECTS WITH RANDOMIZED EXPERIMENTS
In chapter 2, we learn what causal effects are and how to estimate them using randomized experiments. We analyze data from Project STAR to answer: What is the effect of small classes on student performance?Code and Data Used in Book Exercises:
- Experimental.R (R script with the code)
- STAR.csv (CSV file with the data)
Review Exercises:
- To access them run the code in this R script in RStudio
Interactive Graphs:
- Random Treatment Assignment Makes Treatment and Control Groups Comparable When the Sample Size is Large Enough (If link doesn't work, run the code in this R script in RStudio)
Videos:
CHAPTER 3: INFERRING POPULATION CHARACTERISTICS VIA SURVEY RESEARCH
In chapter 3, we learn about surveys and how to visualize and summarize the distribution of single variables as well as the relationship between two variables. We analyze data on the 2016 British referendum to answer: Who Supported Brexit?Code and Data Used in Book Exercises:
- Population.R (R script with the code)
- BES.csv & UK_districts.csv (CSV files with the data)
Interactive Graphs:
- Random Sampling Creates a Representative Sample of the Target Population When Sample Size is Large Enough (If link doesn't work, run the code in this R script in RStudio)
- How the Mean and Standard Deviation Change the Distribution of a Variable (If link doesn't work, run the code in this R script in RStudio)
- The Two Characteristics the Correlation Coefficient Captures (If link doesn't work, run the code in this R script in RStudio)
CHAPTER 4: PREDICTING OUTCOMES USING LINEAR REGRESSION
In chapter 4, we learn how to predict outcomes using simple linear regression models. We analyze data from 170 countries to predict GDP growth using night-time light emissions as measured from space.Code and Data Used in Book Exercises:
- Prediction.R (R script with the code)
- countries.csv (CSV file with the data)
Interactive Graphs:
- The Role the Intercept and the Slope Play in Defining a Line (If link doesn't work, run the code in this R script in RStudio)
- The Least Squares Method (If link doesn't work, run the code in this R script in RStudio)
Videos:
CHAPTER 5: ESTIMATING CAUSAL EFFECTS WITH OBSERVATIONAL DATA
In chapter 5, we learn how to estimate causal effects using observational data. We analyze survey and electoral data to answer: What was the effect of Russian TV propaganda on the 2014 Ukrainian elections?Code and Data Used in Book Exercises:
- Observational.R (R script with the code)
- UA_survey.csv & UA_precincts.csv (CSV files with the data)
CHAPTER 6: PROBABILITY
In chapter 6, we cover basic probability. We learn about random variables and their distributions, the distinction between population parameters and sample statistics, and the two large sample theorems that enable us to measure statistical uncertainty.Code and Data Used in Book Exercises:
- Probability.R (R script with the code)
Interactive Graphs:
- The Law of Large Numbers (coming soon)
- The Central Limit Theorem (coming soon)
CHAPTER 7: QUANTIFYING UNCERTAINTY
In chapter 7, we learn how to quantify the uncertainty in our empirical findings in order to draw conclusions at the population level. We complete some of the analyses we started in chapters 2 through 5.Code and Data Used in Book Exercises:
- Uncertainty.R (R script with the code)
- STAR.csv, BES.csv, countries.csv & UA_survey.csv (CSV files with the data)
Interactive Graphs:
- Hypothesis Testing (coming soon)