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 few more functions that map streets to colors. … Continue reading NYC Motor Vehicle Collisions – Street-Level Heat Map

# Simulating Endogeneity

Introduction 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 other specification issues such as heteroskedasticity, multicollinearity, and collider bias. The Data-Generating Process Consider the data-generating process (DGP) of some outcome variable $latex Y $: … Continue reading Simulating Endogeneity

# Motor Vehicle Collision Density in NYC

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 to 2015. The data tracks the type of … Continue reading Motor Vehicle Collision Density in NYC

# Visualizing Hubway Trips in Boston

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 from financial … Continue reading Visualizing Hubway Trips in Boston

# Drug Crime Density in Boston

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 https://data.cityofboston.gov/. In the code below, I bring in crime data as a csv file. The data … Continue reading Drug Crime Density in Boston

# Finding and Plotting Lorenz Solution using MATLAB

I use MATLAB to solve the following Lorenz initial value problem: $latex \begin{cases} x'=-10(x+y) \\ y'=-x(z+28)-y \\ z'=xy-\frac{8}{3}z \\ x(0)=y(0)=z(0)=5 \end{cases} $ I wrote a function, LorenzRK4IVP(), that takes the system of three differential equations as input and solves the system using the Runge-Kutta method with step size $latex h=.01$. I plot the strange attractor as … Continue reading Finding and Plotting Lorenz Solution using MATLAB

# Interactive Cobb-Douglas Web App with R

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 R code works on the user interface (UI) … Continue reading Interactive Cobb-Douglas Web App with R