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
#------------------------------------------------------------------ | |
# PROGRAM NAME: python basic stats.py | |
# DATE: 2/20/16 | |
# CREATED BY: MATT BOGARD | |
# PROJECT FILE: | |
#---------------------------------------------------------------- | |
# PURPOSE: BASIC STATS IN PYTHON | |
#--------------------------------------------------------------- | |
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
# ------------------------------------------------------------------ | |
# |PROGRAM NAME: R basic statistics | |
# |DATE: 2/20/17 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: | |
# |---------------------------------------------------------------- | |
# | PURPOSE: BASIC STATISTICS IN R | |
# |---------------------------------------------------------------- | |
# create some toy data |
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
#------------------------------------------------------------------ | |
# PROGRAM NAME: Python Examples.py | |
# DATE: 6/1/16 | |
# CREATED BY: MATT BOGARD | |
# PROJECT FILE: | |
#---------------------------------------------------------------- | |
# PURPOSE: BASIC DATA MANAGEMENT AND STATS IN PYTHON | |
# --------------------------------------------------------------- | |
#--------------------------------- |
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
# ------------------------------------------------------------------ | |
# |PROGRAM NAME: R basic data manipulation | |
# |DATE: 2/20/17 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: | |
# |---------------------------------------------------------------- | |
# | PURPOSE: BASIC DATA MANAGEMENT AND STATS IN R | |
# |---------------------------------------------------------------- | |
# create some toy data |
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
# ------------------------------------------------------------------ | |
# |PROGRAM NAME: R basic data manipulation | |
# |DATE: 2/20/17 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: | |
# |---------------------------------------------------------------- | |
# | PURPOSE: BASIC DATA MANAGEMENT AND STATS IN R | |
# |---------------------------------------------------------------- |
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
# ------------------------------------------------------------------ | |
# |PROGRAM NAME: NEURALNET_PKG_R | |
# |DATE: 12/3/10 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: http://econometricsense.blogspot.com/2010/12/r-code-example-for-neural-networks.html | |
# |---------------------------------------------------------------- | |
# | PURPOSE: DEMO OF THE 'neuralnet' PACKAGE AND OUTPUT INTERPRETATION | |
# | | |
# | ADAPTED FROM: neuralnet: Training of Neural Networks | |
# | by Frauke Günther and Stefan Fritsch The R Journal Vol. 2/1, June 2010 |
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
# ------------------------------------------------------------- | |
# | PROGRAM NAME: Bubble_Crops | |
# | DATE: 12-4-2010 | |
# | CREATED BY: Matt Bogard | |
# | PROJECT FILE: http://econometricsense.blogspot.com/2010/12/visualizing-agricultural-subsidies-by.html | |
# |------------------------------------------------------------- | |
# | PURPOSE: Intitially to create bubble charts to demonstrate | |
# | allocation | |
# | of farm subsides to producers by KY county, but expanded to | |
# | include |
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
# ------------------------------------------------------------------ | |
# | PROGRAM NAME: googleVis_R | |
# | DATE: 1/12/11 | |
# | CREATED BY: Matt Bogard | |
# | PROJECT FILE:http://econometricsense.blogspot.com/2011/01/r-code-for-googlevis-demo.html | |
# |---------------------------------------------------------------- | |
# | PURPOSE: Tutorial for creating Motion Charts in R with the GoogleVis package | |
# | | |
# | | |
# | |
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
### r code to support: http://econometricsense.blogspot.com/2011/01/flexibility-of-r-graphics.html | |
library(colorspace) # package for rainbow_hcl function | |
ds <- rbind(data.frame(dat=KyCropsAndSubsidies[,][,"LogAcres"], grp="All"), | |
data.frame(dat=KyCropsAndSubsidies[,][KyCropsAndSubsidies$subsidy_in_millions > 2.76,"LogAcres"], grp=">median"), | |
data.frame(dat=KyCropsAndSubsidies[,][KyCropsAndSubsidies$subsidy_in_millions <= 2.76,"LogAcres"], grp="<=median")) | |
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
### r code to support: http://econometricsense.blogspot.com/2011/01/merging-multiple-data-frames-in-r.html | |
# read all Y2000 csv files | |
filenames <- list.files(path="/Users/wkuuser/Desktop/R Data Sets/TRADE_DATA/TempData00", full.names=TRUE) | |
import.list <- llply(filenames, read.csv) | |
# left join all Y2000 csv files | |
AllData00 <- Reduce(function(x, y) merge(x, y, all=FALSE,by.x="Reporting.Countries.Partner.Countries",by.y="Reporting.Countries.Partner.Countries",all.x =TRUE, all.y =FALSE),import.list,accumulate=F) |