R Open Lab Fall 2018 – Data manipulation

Today we covered the topic of data manipulation. We first reviewed the basic ways to subset data frames such as logical expression and subset function. Then, we looked at ways to combine, merge, and split data frames. Finally, we covered the usage of package plyr. Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018 […]

Read More…

Python Open Lab October 26

This week we learned functions, which is very important for programmers. Functions are useful for procedural decomposition, maximize code reuse and minimize redundancy. Functions should be declared like a variable before using. def function(parameter1, parameter2…): do something return value ‘def’ is the keyword to show that we are defining a function. ‘function’ can be replaced […]

Read More…

CQ Voting and Elections database

http://www.columbia.edu/cgi-bin/cul/resolve?clio4996822 CQ Press offers primary and general election data for all presidential, gubernatorial or congressional elections from 1789 – 2016. 2018 midterm returns with be verified and uploaded in 2019. As a secondary source, CQ Press takes the raw data from election results and makes it easier to read and digest. PROS – Comprehensive – […]

Read More…

Introduction to R ‘plm’ package (1)

This blog is an introduction to use ‘plm’ package for panel data analysis. Panel data means datasets with the same observations (respondents) and variables across different time units (such as year, month). And it’s common for researchers to have an unbalanced panel dataset in practice (for example, GDP data could be missing in different years […]

Read More…