This document demonstrates how to perform several routine tasks in the analysis of state-level economic and political data for multiple countries over time, using the programming language R. It is aimed toward first-year graduate students with little or no experience using R. The .Rmd file which generated this document may prove especially useful as a template from which students may wish to get started. All one needs to do is download and install R, RStudio, and LaTex, open the .Rmd file in Rstudio, modify/extend the examples already coded here, and click “Knit PDF.” This will turn the .Rmd file into the PDF file linked above. Users can then use this as a starting point for producing their own article.
This tutorial downloads and merges two widely used data sources (the World Bank’s World Development Indicators and the Polity IV measure of democracy), cleans and transforms some variables, visualizes some variables with different graphs suited for cross-sectional time-series data, runs simple models, and generates automatically formatted tables.
[Updated November 22, 2014.]
Share this post:
Murphy, Justin. 2014. "Intro to R for graduate students," http://jmrphy.net/blog/2014/11/22/intro-to-r-for-grad-students/ (March 12, 2018).