Skip to content

Materials for Stats I Coding Workshop, Harris School of Public Policy, Fall 2020

License

Notifications You must be signed in to change notification settings

sebcl/lab-seb-update

 
 

Repository files navigation

Summer and Fall Coding Lab

This website (harris-coding-lab.github.io) contains the content for the Harris School's Summer and Fall Coding Labs. The workshop aims to introduce R programming concepts with a focus on preparing and analyzing data, and conducting statistical simulations. We will cover how to read data into R, manipulate data with a suite of tools from the tidyverse package dplyr. We will also discuss some basic programming concepts including data types, operators, control flow with if statements and for loops, and how to write your own functions.

Prerequisites

We ask that Coding Lab attendees have the latest stable versions of R and RStudio pre-installed on their local machine. If you need help getting set up, Harris IT is hosting office hours during on Sept 1 and 2 (you should have an email with the details.) and you can email the amazing staff of Harris IT at [email protected].

Fall Lab Materials: Accelerated pace

Accelerated coding lab meets twice in the quarter. You will either attend week 1 and week 3 or week 2 and week 4.

Class Videos Slides & Code Problem sets Additional Resources
Accelerated Class 1: Functions video slides
slide code
- basics review
- acc. lab 1
- acc. lab 1 solved
Accelerated Class 2: Iteration video slides
slide code
- basics review
- acc lab 2

Fall Lab Materials: Regular pace

Recap slides for all of our meetings here.

Class Videos Slides & Code Problem sets Additional Resources
Class 1: Why R? & Vectors and Data Types video part 1: why R?
video part 2: a quick introduction to R, Rstudio and tidyverse
video: vectors
-slides: video part 1 and 2
- slides code: video part 1 and 2
- slides: vectors
- slides: vectors slide code
- intro to r (dataquest)
- basics review
-read me for labs
- lab 1
- lab 1 solved
Class 2: Reading data files and manipulating data with dplyr video 1: reading data
video 2: manipulating data with dplyr
video 3: grouped analysis
- slides: reading data
- slide code: reading data
- slides: manipulating data with dplyr
- slide code: manipulating data with dplyr
- slides: grouped analysis
-slide code: grouped analysis
- basics review (dataquest)
- lab 2
- lab 2 solved
FED data from slides (you can download to follow along)
texas data from slides
drug cartel data from slide (you'll need to download the dta from Dataverse)
Class 3: If Statements video slides
slide code
- basic review
- lab 3
- lab 3 solved
Class 4: Functions video slides
slide code
- basics review
- lab 4
- lab 4 solved
Class 5: Iteration video slides
slide code
- basics review
- lab 5
- lab 5 solved
Additional material: Visualizing data with ggplot video slides
slide code
basic review

Your final project is quite simple. You will pick a data set that speaks to you and try to uncover something interesting which you will visualize in a plot. You will also compute some summary statistics that you will show in a summary table. We'll provide feedback on your submission. Click on the link for details.

Summer Lab Materials

Links to materials for each week's workshop will be posted here as provided. For each class, watch the video. Then, go to lab and attempt the lab

Class Videos Slides & Code Problem sets Additional Resources
Class 0: Why R? video part 1: why R? (~ 12 min)
video part 2: a quick introduction to R, Rstudio and tidyverse (~ 14 min)
slides
slide code
lab
solutions
load covid_data code
Class 1: Reading data files and manipulating data with dplyr video 1: reading data (~ 10 min)
video 2: manipulating data with dplyr (~ 18 min)
- slides: reading data
- slides: manipulating data with dplyr
- slide code: reading data
- slide code: manipulating data with dplyr
lab 1
solutions
FED data from slides (you can download to follow along)
texas data from slides
drug cartel data from slide (you'll need to download the dta from Dataverse)
Class 2: Vectors and Data Types video (~ 22 min) slides
slide code
lab 2
basics review
solutions
lab code
Class 3: If Statements video (~ 20 min) slides
slide code
lab 3
basic review
solutions
lab code
Class 4: Grouped analysis with dplyr video (~13 min) slides
slide code
lab 4
basic review
solutions
lab code
Class 5: Visualizing data with ggplot video (~ 18 min) slides
slide code to come
Work on final project with TA and peer support
basic review

The first three weeks of fall coding lab covers the same material (minus ggplot). Week 4 and 5 cover new material on for loops and functions. Accelerated fall coding lab consists solely of new material on for loops and functions.

Questions

Post questions on Piazza

Additional Resources

Instructors

The instructors for this course are (see Canvas for emails):

  • Ari Anisfeld
  • Terence Chau

Teaching Assistants

The teaching assistants for this course are:

  • Michael Gorman
  • Nguyen Luong
  • Alysha Rashid
  • Milan Rivas
  • Paola Riveros
  • Dominic Teo
  • Ryan Webb
  • Fanmei Xia

About

Materials for Stats I Coding Workshop, Harris School of Public Policy, Fall 2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 98.6%
  • R 1.4%