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 VAR.py | |
# | DATE: 2/23/21 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: source: https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python/ | |
# *---------------------------------------------------------------- | |
# see also my blog post: http://econometricsense.blogspot.com/2011/05/vector-autoregressions-and-bayesian.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.py | |
# | DATE: 2/13/21 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: intuition for the application of synthetic control methods 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
ID | state | years | UN | college | fastfood | cost | |
---|---|---|---|---|---|---|---|
1 | CA | 1990 | 0.032392552299425 | 0.24544457978569 | 2.4977055855561 | 1950.83661026321 | |
1 | CA | 1991 | 0.0318986003333703 | 0.256238439888693 | 2.08406292251311 | 1643.05610202369 | |
1 | CA | 1992 | 0.033461097353138 | 0.256421657577157 | 2.22463607857935 | 1749.31302200537 | |
1 | CA | 1993 | 0.0370203721290454 | 0.257437539133243 | 2.76596341095865 | 2157.34212906682 | |
1 | CA | 1994 | 0.0388986587245017 | 0.248881499939598 | 2.01657752273604 | 1594.10284639918 | |
1 | CA | 1995 | 0.0252047811541706 | 0.258736467873678 | 2.19277501036413 | 1721.8677653186 | |
1 | CA | 1996 | 0.0260166791034862 | 0.251568139037117 | 2.95559096685611 | 2292.5935994531 | |
1 | CA | 1997 | 0.0363858704548329 | 0.2518281813059 | 2.19790341798216 | 1729.57754404051 | |
1 | CA | 1998 | 0.0210772675042972 | 0.250085048945621 | 2.80991377192549 | 2180.49522493267 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 state level synthetic controls.R | |
# | DATE: 2/12/21 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: This code builds some intuition for how synthetic control methods work | |
# | using simulated data synthetic controls are created for a treatment state | |
# | placebo plots visualize uncertainty/rarity of the treatment | |
# *---------------------------------------------------------------- |
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 basics.py | |
# | DATE: 1/25/21 (original: 12/28/18) | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: examples of data munging and analysis in python | |
# *---------------------------------------------------------------- | |
# see also: https://pandas.pydata.org/pandas-docs/stable/getting_started/comparison/comparison_with_r.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: Regression_and_IV.py | |
# | DATE: 12/31/20 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: demonstrate basic concepts related to to selection bias, regression, and instrumental variables | |
# *---------------------------------------------------------------- |
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 bootstrapped inference.py | |
# | DATE: 10/16/20 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: example of bootstrapped inference for comparing two sample means | |
# *---------------------------------------------------------------- | |
import numpy as np |
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 mean bootstrap CI.py | |
# | DATE: 10/16/20 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: example calculation of bootstrapped confidence interval for mean | |
# *---------------------------------------------------------------- | |
import numpy as np |
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 power sim repeated measures anova.R | |
# | DATE: 10/10/20 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: https://gist.github.com/BioSciEconomist | |
# *---------------------------------------------------------------- | |
# | PURPOSE: annotated code based on reference cited below | |
# *---------------------------------------------------------------- | |
# reference: https://www.r-bloggers.com/2012/01/power-and-sample-size-for-repeated-measures-anova-with-r/ |