Created
August 22, 2013 23:46
-
-
Save cigrainger/6314084 to your computer and use it in GitHub Desktop.
Dissertation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prices <- read.csv("~/Documents/CEX0711/prices.csv") | |
colnames(prices) <- sub("[.]", " ", colnames(prices)) | |
prices <- melt(prices) | |
prices$Date <- as.yearmon(prices$Date,format="%b-%Y") | |
colnames(prices) <- c('time','statename','price') | |
prices$year <- format(prices$time,format="%Y") | |
statetax <- read.csv("~/Documents/CEX0711/statetax.csv") | |
colnames(statetax)[1] <- "statename" | |
colnames(statetax) <- sub("[X]", "", colnames(statetax)) | |
statetax <- melt(statetax) | |
colnames(statetax) <- c('statename','year','tax') | |
pricetax <- merge(statetax,prices) | |
pricetax$federaltax <- rep(18.4,length(pricetax$tax)) | |
pricetax$totaltax <- (pricetax$tax + pricetax$federaltax)/100 | |
pricetax$nprc <- pricetax$price + pricetax$totaltax | |
pricemerge <- data.frame("statename"=pricetax$statename,"time"=pricetax$time,"nprc"=pricetax$nprc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment