/DSS

Datasets and Code for Data Analysis for Social Science

Primary LanguageR

DSS

The DSS folder

This repository contains the R scripts (.R files) and datasets (.csv files) used in the book exercises.

  • Chapter 1: Introduction

    • Goal: Lay Groundwork for Forthcoming Analyses
    • R Script: Introduction.R
    • Dataset: STAR.csv
  • Chapter 2: Estimating Causal Effects with Randomized Experiments

    • Research Question: Do Small Classes Improve Student Performance?
    • Based on: Frederick Mosteller, "The Tennessee Study of Class Size in the Early School Grades," Future of Children 5, no. 2 (1995): 113-27.
    • R Script: Experimental.R
    • Dataset: STAR.csv
  • Chapter 3: Inferring Population Characteristics via Survey Research

    • Research Question: Who Supported Brexit?
    • Based on: Sara B. Hobolt, "The Brexit Vote: A Divided Nation, a Divided Continent," Journal of European Public Policy 23, no. 9 (2016): 1259-77, and Sascha O. Becker, Thiemo Fetzer, and Dennis Novy, "Who Voted for Brexit? A Comprehensive District-Level Analysis," Economic Policy 32, no. 92 (2017): 601–50.
    • R Script: Population.R
    • Datasets: BES.csv, UK_districts.csv
  • Chapter 4: Predicting Outcome Using Linear Regression

    • Goal: Predict GDP Growth Based on Night-Time Light Emissions
    • Based on: J. Vernon Henderson, Adam Storeygard, and David N. Weil, "Measuring Economic Growth from Outer Space," American Economic Review 102, no. 2 (2012): 994–1028.
    • R Script: Prediction.R
    • Dataset: countries.csv
  • Chapter 5: Estimating Causal Effects with Observational Data

    • Research Question: What Was the Effect of Russian TV Propaganda on Ukrainians' 2014 Voting Behavior?
    • Based on: Leonid Peisakhin and Arturas Rozenas, "Electoral Effects of Biased Media: Russian Television in Ukraine," American Journal of Political Science 62, no. 3 (2018): 535–50.
    • R Script: Observational.R
    • Datasets: UA_survey.csv, UA_precincts.csv
  • Chapter 6: Probability

    • Goal: Learn Basic Probability
    • R Script: Probability.R
    • Dataset: STAR.csv
  • Chapter 7: Quantifying Uncertainty

    • Goal: Complete Some of the Analyses from Chapters 2 through 5 by Quantifying the Uncertainty in the Empirical Findings
    • R Script: Uncertainty.R
    • Datasets: BES.csv, STAR.csv, countries.csv, UA_survey.csv

We recommend downloading the whole folder, saving it directly on your Desktop, and re-naming it DSS. The code provided assumes that the folder with all of the datasets is (1) named DSS (all in capital letters and without any spaces) and (2) saved directly on your Desktop. If you choose to save the folder elsewhere, the book provides instructions for making the necessary changes to the code.