Blog Archives

Plotting Indifference Curves with R Contour Function

March 11, 2011
By
Plotting Indifference Curves with R Contour Function

The following post at Constructing Difference Curves - Part 3 from economics.about.com provides a discussion on indifference curves (but actually I think they are isoquants) and how to construct them. I think I have a grasp on how to do this in R if yo...

Read more »

Copula Functions, R, and the Financial Crisis

March 10, 2011
By
Copula Functions, R, and the Financial Crisis

From: In defense of the Gaussian copula, The Economist"The Gaussian copula provided a convenient way to describe a relationship that held under particular conditions. But it was fed data that reflected a period when housing prices were not correlated to the extent that they turned out to be when the housing bubble popped."Decisions about...

Read more »

Merging Multiple Data Frames in R

January 23, 2011
By
Merging Multiple Data Frames in R

Earlier I had a problem that required merging 3 years of trade data, with about 12 csv files per year. Merging all of these data sets with pairwise left joins using the R merge statement worked (especially after correcting some errors pointed out by Ha...

Read more »

Flexibility of R Graphics

January 21, 2011
By
Flexibility of R Graphics

(note scroll all the way down to see 'old code' and 'new more flexible code' Recall and older post that presented overlapping density plots using R (Visualizing Agricultural Subsidies by KY County) see image below.The code I used to produce this plot m...

Read more »

Posted Question for R Users

January 21, 2011
By
Posted Question for R Users

I recently undertook a project where a colleague had about 12 .csv files that they wanted to merge. Each file had a common (key) variable 'Partner' (which is trading partner) with differing columns (variables) except for the common key variable. Actual...

Read more »

R Code Documentation Template

January 15, 2011
By
R Code Documentation Template

# *------------------------------------------------------------------# | PROGRAM NAME: # | DATE: # | CREATED BY: # | PROJECT FILE: # *----------------------------------------------------------------# | PURPOSE: # |# *-------...

Read more »

R Code for googleVis Demo

January 12, 2011
By
R Code for googleVis Demo

# ------------------------------------------------------------------# | PROGRAM NAME: googleVis_R# | DATE: 1/12/11 # | CREATED BY: Matt Bogard# | PROJECT FILE: # |----------------------------------------------------------------# | PURPOSE: ...

Read more »

Visualizing Agricultural Subsidies by Kentucky County

December 12, 2010
By
Visualizing Agricultural Subsidies by Kentucky County

In this post,  I provide results from my first full blown application of R to read, merge, clean, subset, manipulate, analyze and visualize data related to agricultural subsidies by Kentucky counties. This is very similar to the work I do on a daily basis, and was a great test of the capabilities of doing these tasks open source...

Read more »

R Code Example for Neural Networks

December 12, 2010
By
R Code Example for Neural Networks

See also NEURAL NETWORKS. In this past June's issue of R journal, the 'neuralnet' package was introduced. I had recently been familiar with utilizing neural networks via the 'nnet' package (see my post on Data Mining in A Nutshell) but I find the neuralnet package more useful because it will allow you to actually plot...

Read more »

Data Mining in A Nutshell

September 20, 2010
By
Data Mining in A Nutshell

# The following code may look rough, but simply paste into R or# a text editor (especially Notepad++) and it will look# much better.# PROGRAM NAME: MACHINE_LEARNING_R# DATE: 4/19/2010# AUTHOR : MATT BOGARD# PURPOSE: BASIC EXAMPLES OF MACHINE LEAR...

Read more »