Articles by Benevolent Planner

Modeling Contagion Using Airline Networks in R

May 30, 2015 | 0 Comments

I first became interested in networks when reading Matthew O’Jackson’s 2010 paper describing networks in economics. At some point during the 2014 ebola outbreak, I became interested in how the disease could actually come to the U.S. I was caught up with work/classes at the time, but decided ...
[Read more...]

NYC Motor Vehicle Collisions – Street-Level Heat Map

March 10, 2015 | 0 Comments

In this post I will extend a previous analysis creating a borough-level heat map of NYC motor vehicle collisions. The data is from NYC Open Data. In particular, I will go from borough-level to street-level collisions. The processing of the code is very similar to the previous analysis, with a ...
[Read more...]

Econometrics Sim – 1: Endogeneity

March 9, 2015 | 0 Comments

Introduction This is the first post in a series devoted to explaining basic econometric concepts using R simulations. The topic in this post is endogeneity, which can severely bias regression estimates. I will specifically simulate endogeneity caused by an omitted variable. In future posts in this series, I’ll simulate ...
[Read more...]

Motor Vehicle Collision Density in NYC

March 6, 2015 | 0 Comments

In a previous post, I visualized crime density in Boston using R’s ggmap package. In this post, I use ggmap to visualize vehicle accidents in New York City. R code and data are included in this post. The data comes from NYC Open Data. My data cut ranges from 2012 ...
[Read more...]

Visualizing Hubway Trips in Boston

February 21, 2015 | 0 Comments

Most Popular Hubway Stations (in order): Post Office Sq. – located in the heart of the financial district. Charles St. & Cambridge – the first Hubway stop after crossing from Cambridge over Longfellow Bridge. Tremont St & West – East side of the Boston Common South Station Cross St. & Hannover – entrance to North End combing ...
[Read more...]

Drug Crime Density in Boston

January 15, 2015 | 0 Comments

The original map can be found in my previous post, Spatial Data Visualization with R. As a review, I use get_map function in the ggmap package to grab a map of Boston from Google Maps. The “crime report” data can be found at In the ...
[Read more...]

Interactive Cobb-Douglas Web App with R

November 4, 2014 | 0 Comments

I used Shiny to make an interactive cobb-douglass production surface in R. It reacts to user’s share of labor and capital inputs and allows the user to rotate the surface. The contour plot (isoquants) is also dynamic. Shiny works using two R codes stored in the same folder. One ...
[Read more...]

Iterative OLS Regression Using Gauss-Seidel

October 24, 2014 | 0 Comments

I just finished covering a few numerical techniques for solving systems of equations, which can be applied to find best-fit lines through a give set of data points. The four points  are arranged into an inconsistent system of four equations and two unknowns: The system can be represented in matrix ...
[Read more...]

Spatial Data Visualization with R

August 31, 2014 | 0 Comments

I’ve been fooling around with spatial data lately. As it turns out, there are some great R packages for visualizing this kind of data. Below is a set of charts I put together. It’s a good sample of the possibilities. keeps a dataset with characteristics of ...
[Read more...]

Using Markov Chains to Model Mortgage Defaults in R

April 18, 2014 | 0 Comments

The goal of this post is to blend the material I’ve been learning in my night class with my day-job and R. If we have some object that switches between states over time according to fixed probabilities, we can model the long-term behavior of this object using Markov chains*. ...
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)