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: MatchIt demo.R | |
# | DATE: 3/6/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demo of R matchit based on: Matching as Nonparametric Preprocessing for | |
# | Reducing Model Dependence in Parametric Causal Inference by Ho,Imai,King,and Stuart | |
# | Political Analysis (2007) 15:199-236 See also: http://www.biostat.jhsph.edu/~estuart/ | |
# *---------------------------------------------------------------- |
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: DiD demo.R | |
# | DATE: 2/5/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demo of difference-in-difference estimation | |
# *---------------------------------------------------------------- | |
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: ivreg demo.R | |
# | DATE: 1/29/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demo of ivreg | |
# *---------------------------------------------------------------- | |
# make up data (this took some thought) |
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: MatchIt intro.R | |
# | DATE: 1/12/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: /Google Drive/R Training | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demo of R matchit based on: Matching as Nonparametric Preprocessing for | |
# | Reducing Model Dependence in Parametric Causal Inference by Ho,Imai,King,and Stuart | |
# | Political Analysis (2007) 15:199-236 | |
# *---------------------------------------------------------------- |
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
# make a data frame manually | |
data = {'GARST' :[150,140,145,137,141,145,149,153,157,161], | |
'PIO':[160,150,146,138,142,146,150,154,158,162], | |
'MYC':[137,148,151,139,143,120,115,136,130,129], | |
'DEK':[150,149,145,140,144,148,152,156,160,164], | |
'PLOT':[1,2,3,4,5,6,7,8,9,10], | |
'BT': ['Y','Y', 'N','N','N','N','Y','N','Y','Y'], | |
'RR':['Y','N','Y','N','N','N','N','Y','Y','N'], | |
'ID':[1,2,3,4,5,6,7,8,9,10] | |
} |
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: ex_logit_analytics_R | |
# | DATE: 3/14/11 | |
# | CREATED BY: Matt Bogard | |
# | PROJECT FILE:Desktop/R Programs | |
# *---------------------------------------------------------------- | |
# | PURPOSE: example of predictive model and reporting | |
# | from blog post: from http://econometricsense.blogspot.com/2011/03/predictive-modeling-and-custom.html | |
# | | |
# *------------------------------------------------------------------ |
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: ex banking model | |
# |DATE: 4/5/18 | |
# |CREATED BY: MATT BOGARD | |
# |UPDATED: 5/8/18 | |
# |PROJECT FILE: C:\Users\mtb2901\Documents\Tools and References\R References | |
# |---------------------------------------------------------------- | |
# | PURPOSE: predictive modeling example | |
# |------------------------------------------------------------------ |
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: ex fibonacci.R | |
# | DATE:6/26/18 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: /Users/amandabogard/Google Drive/ | |
# *---------------------------------------------------------------- | |
# | PURPOSE: code based on http://mindymallory.com/R-Companion-Price-Analysis/chapter-2-getting-started.html#working-with-apis | |
# *---------------------------------------------------------------- | |
library(RCurl) # necessary for reading data from url |
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: corn technical analysis | |
# | DATE: 4/21/18 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: | |
# *---------------------------------------------------------------- | |
library(TTR) |
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
#----------------------------------- | |
# poisson regression basic example | |
#----------------------------------- | |
# see also: http://econometricsense.blogspot.com/2017/03/count-model-regressions.html | |
# this code is adapted from a more extensive GEE application | |
# set up to allow for repeated measures | |
http://nbviewer.jupyter.org/urls/umich.box.com/shared/static/ir0bnkup9rywmqd54zvm.ipynb |