Skip to content

Instantly share code, notes, and snippets.

View kaywenger's full-sized avatar

Kay Wenger kaywenger

  • Minerva Schools
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kaywenger
kaywenger / Using Bayesian Inference to Predict Call Centre Rates (Numeric via Conjugate Priors & Sampling via Stan).ipynb
Last active March 11, 2020 08:34
Using Bayesian Inference to Predict Call Centre Rates (Numeric via Conjugate Priors & Sampling via Stan)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kaywenger
kaywenger / Synthetic Control Model (SCM) for India post-1991 Financial Liberalization, Stata, SS154 Econometrics
Last active January 23, 2020 15:37
Synthetic Control Model (SCM) for India post-1991 Financial Liberalization, Stata, SS154 Econometrics
//code written by Kay Wenger, pieces of structure taken from 13.1 pre-class and in-class code
// with debugging support and code contributions from Julia Minichelli & Sohit Miglani
tsset state_number year
// data exploration
graph twoway (line gdp year), xline(1994, lpattern(shortdash) lcolor(black)), if code == 29
graph twoway (line fx_res_minus_gold year), xline(1994, lpattern(shortdash) lcolor(black)), if code == 29
graph twoway (line ex_rate_avg year), xline(1994, lpattern(shortdash) lcolor(black)), if code == 29
graph twoway (line ex_rate_end year), xline(1994, lpattern(shortdash) lcolor(black)), if code == 29
@kaywenger
kaywenger / Assignment 2, Stata, SS154 Econometrics
Last active January 23, 2020 15:34
Assignments 2 & 3, Stata, SS154 Econometrics
import delimited "/Users/estherwenger/Desktop/Stata1/Assignments/Homework 2/Koop-Tobias.csv", clear
save "/Users/estherwenger/Desktop/Stata1/Assignments/Homework 2/homework 2 full dataset.dta"
// pre-processing data
bys personid: gen order = _n
keep if order == 1 & personid <= 15
global x1 educ potexper ability
global x2 mothered fathered siblings, nocons
// Kay & Perpetua
//creating new variables
//account
generate received_account = 1 if fin29a == 1 | fin34a == 1 | fin39a == 1 | fin43a == 1 | fin47a == 1
foreach x of varlist received_account{
replace `x' = 0 if(`x' == .)
}
################################
#OUR CODE STARTS
################################
#cleaning rows where people did not report physician visits or ER visits (i.e, "NAs," which were 98,99, or 999)
#data2 is now 262,000 entries
data2 <- subset(data2, ahernoy2 < 98)
data2 <- subset(data2, ahcnoyr2 < 98)
set.seed(123)
@kaywenger
kaywenger / # Replication code from Harvard Dataverse, Catillon & Sandoe, Original
Last active January 23, 2020 15:25
# Code for CS112 Final Project, CATILLON AND SANDOE ORIGINAL
######################################################################################
# Code for CS112 Final Project, CATILLON AND SANDOE ORIGINAL
## Replication paper
# Dowload necessary packages
# install.packages("foreign")
# install.packages("Zelig")
#CS112 Final, code from Perpetua
######################################################################################
## Replication paper
# Dowload necessary packages
# install.packages("foreign")
# install.packages("Zelig")
# install.packages("stargazer")