Course Hub for Conduct of Inquiry I Lab - SPA 612

This course is a lab supplement to the SPA 612: Conduct of Inquiry I. This lab is an introduction to R and Stata programming, focusing on data wrangling, visualization, basic regression and result output. The course aims to equip students with essential skills to manipulate, analyze, and visualize data using R and Stata.

Syllabus

The syllabus outlines the course objectives, grading, and schedule for the Conduct of Inquiry I Lab.

Download Syllabus

Session 1: Basic R Operations

Session 1 covers the basic R operations to introduce students to basic data manipulation, arithmetic, and vectorized operations in R.

Download Handout

Session 2: Introduction to dplyr

Session 2 covers dplyr package for data manipulation in R. You will learn how to use its key functions such as select(), filter(), arrange(), and mutate(). We will also cover advanced topics like using across() for applying functions to multiple columns.

Download Handout

Session 3: Basic Stata Operations and Data Manipulation

Session 3 covers into the basic Stata operations, and provides an introduction to the Data Manipulation equivalent of dplyr in Stata.

Download Handout

Session 4: R Practice A

Session 4 is a in-class pratice session for R, we will use R packages we learned so far to complete a in-class practice.

Download Handout

Session 5: Aggregating and reshaping DataA

The summarize() function from the dplyr package is a powerful tool for creating summary statistics of your data. It allows you to collapse a dataset to a single row or a summary for each group of observations. In this tutorial, we’ll explore the basic and advanced uses of summarize(), as well as ways to reshape data.

Download Handout