Lab Scripts/Problem Sets
This page contains link to lab scripts throughout the semester. Clicking the title of the lab script will go directly to the “spun” HTML document from the underlying R code. The bottom left icons link to the underlying R script () and the HTML document ().
-
An Intro to R, Rstudio, and {tidyverse}
tl;dr: A {tidyverse}-oriented lab for introducing students to R and Rstudio.
-
Some Basics of Descriptive Inference
tl;dr: A lab session on things like modes, medians, means, variable types, and recoding things.
-
Bivariate OLS
tl;dr: We start a discussion of linear regression in the simple case of two variables.
-
Extending OLS
tl;dr: Multiple regression is just OLS with more stuff glued onto it, but be mindful about what you're doing when interacting things.
-
OLS Diagnostics (and What to Do if You Flunk One)
tl;dr: OLS has assumptions, and you should perform various diagnostic tests on them to see if you have any issues. If there are issues, there are assorted things you can do (depending on the problem).
Problem Sets
Here are the five problem sets you’ll need to complete through the semester. Observe the deadlines for these problem sets in the syllabus, as they typically coincide with a little over 24 hours from the relevant lab session.
I’ve attached an answer template for your consideration as well. Download this file (i.e. right-click the link and save): eh6105-ps1-svensson-sven.Rmd
. Open it in Rstudio, take a quick look at its contents, and then press the “Knit” button. In the same directory in which you saved the R Markdown file, there’ll be a corresponding Word document. Open that in your Word document reader to see what you did. From there, you might be able to follow your intuition as to what’s happening. You can read more about R Markdown here.
-
Problem Set #1
The first problem set makes use of the Systemic Banking Crises Database II in
{stevedata}
to learn about basic data summary, data exploration, and data manipulation. -
Problem Set #2
The second problem set makes use of the National Epidemiologic Survey on Alcohol and Related Conditions (NESARC) data set in
{stevedata}
to learn about basic descriptive statistics, recoding things, and, importantly, how you should always read the codebook. -
Problem Set #3
The third problem introduces students to simple bivariate linear regression by way of a classic chicken-and-egg problem in political science/IR: the relationship between democracy and economic development.
-
Problem Set #4
The fourth problem set makes use of replication data of Ghobarah et. al (2004)) to prompt students to replicate a published analysis in the field of international relations.
-
Problem Set #5
The final problem set makes use of General Social Survey (GSS) data on attitudes about government spending in
{stevedata}
to learn about OLS model diagnostics. Students will also have the option of bootstrapping their regression model here if they want to go hardcore in the last question. Nothing in the course plan said I couldn’t have you choose this path if I wanted. 😜