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: simulate negbin.R | |
# |DATE: 4/29/18 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: /Users/amandabogard/Google Drive/R Training | |
# |---------------------------------------------------------------- | |
# | PURPOSE: example:simulate data for negative binomial count model | |
# |---------------------------------------------------------------- | |
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: power sim poisson.R | |
# |DATE: 4/29/18 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: /Users/amandabogard/Google Drive/R Training | |
# |---------------------------------------------------------------- | |
# | PURPOSE: simulated power analysis for difference in counts modifed code originally from egap.org | |
# |---------------------------------------------------------------- | |
# reference: http://egap.org/content/power-analysis-simulations-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: simulate poisson.R | |
# |DATE: 4/29/18 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: /Users/amandabogard/Google Drive/R Training | |
# |---------------------------------------------------------------- | |
# | PURPOSE: simulate data for poisson regression | |
# |---------------------------------------------------------------- | |
# this can be modified to generate data for any glm model |
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: power sim logit.R | |
# |DATE: 4/29/18 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: /Users/amandabogard/Google Drive/R Training | |
# |---------------------------------------------------------------- | |
# | PURPOSE: compare modified simulated power analysis for difference in proportions from egap.org | |
# | to results from the 'pwr' function 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: power sim means.R | |
# |DATE: 4/29/18 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: | |
# |---------------------------------------------------------------- | |
# | PURPOSE: compare simulated power analysis for difference in means from egap.org | |
# | to results from the 'pwr' function 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: ex toy synthetic controls.R | |
# | DATE: 4/23/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: Macintosh HD ▸ Users ▸ amandabogard ▸ Google Dive ▸ R Training | |
# *---------------------------------------------------------------- | |
# | PURPOSE: intuition for how sytnthetic control methods work | |
# *---------------------------------------------------------------- | |
library(Synth) # load Synth 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
# *----------------------------------------------------------------- | |
# | PROGRAM NAME: ex LATE and IV.R | |
# | DATE: 4/18/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: /Google Drive/R Training | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demonstrate how an IV captures the treatment effect of the compliers, or LATE | |
# *---------------------------------------------------------------- | |
# see companion blog post: https://econometricsense.blogspot.com/2019/04/intent-to-treat-instrumental-variables.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 microsynth | |
# | DATE: 4/7/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: /Google Drive/R Training | |
# *---------------------------------------------------------------- | |
# | PURPOSE: work through of code snippets and excerpts for synthetic controls for | |
# | micro level data from: https://cran.r-project.org/web/packages/microsynth/vignettes/introduction.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 synthetic controls.R | |
# | DATE: 3/28/19 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: Macintosh HD ▸ Users ▸ amandabogard ▸ Google Dive ▸ R Training | |
# *---------------------------------------------------------------- | |
# | PURPOSE: code based on Synth: An R Package for Synthetic Control Methods in Comparative Case Studies | |
# | Journal of Statistical Software June 2011, Volume 42, Issue 13 | |
# *---------------------------------------------------------------- |
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 custom distance.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/ | |
# *---------------------------------------------------------------- |