diff --git a/Do/abortion_ddd.do b/Do/abortion_ddd.do index dbb0ec2..ac74a54 100644 --- a/Do/abortion_ddd.do +++ b/Do/abortion_ddd.do @@ -1,6 +1,6 @@ use https://github.com/scunning1975/mixtape/raw/master/abortion.dta, clear -* DDD estimate for 15-19 year olds vs. 20-24 year olds in repeal vs Roe states +* DDD estimate for 15-19 year olds vs. 25-29 year olds in repeal vs Roe states gen yr=(repeal) & (younger==1) gen wm=(wht==1) & (male==1) gen wf=(wht==1) & (male==0) diff --git a/Do/collider_discrimination.do b/Do/collider_discrimination.do index ec8eafa..606b3ee 100644 --- a/Do/collider_discrimination.do +++ b/Do/collider_discrimination.do @@ -15,8 +15,8 @@ generate occupation = (1) + (2)*ability + (0)*female + (-2)*discrimination + rno generate wage = (1) + (-1)*discrimination + (1)*occupation + 2*ability + rnormal() * Regressions -regress wage female -regress wage female occupation -regress wage female occupation ability +regress wage discrimination +regress wage discrimination occupation +regress wage discrimination occupation ability diff --git a/Do/synth_6.do b/Do/synth_6.do index 0b2cf94..4405fb2 100644 --- a/Do/synth_6.do +++ b/Do/synth_6.do @@ -4,7 +4,7 @@ matlist state`i', names(rows) } #delimit ; -matstate=state1/state2/state4/state5/state6/state8/state9/state10/state11/state12/state13/state15/state16/state17/state18/state20/state21/state22/state23/state24/state25/state26/state27/state28/state29/state30/state31/state32/state33/state34/state35/state36/state37/state38/state39/state40/state41/state42/state45/state46/state47/state48/state49/state51/state53/state55; +mat state=state1/state2/state4/state5/state6/state8/state9/state10/state11/state12/state13/state15/state16/state17/state18/state20/state21/state22/state23/state24/state25/state26/state27/state28/state29/state30/state31/state32/state33/state34/state35/state36/state37/state38/state39/state40/state41/state42/state45/state46/state47/state48/state49/state51/state53/state55; #delimit cr * ssc install mat2txt mat2txt, matrix(state) saving(../inference/rmspe_bmprate.txt) replace diff --git a/Do/thornton_ri.do b/Do/thornton_ri.do index d837917..0c44bf3 100644 --- a/Do/thornton_ri.do +++ b/Do/thornton_ri.do @@ -58,6 +58,6 @@ save "`final'", replace gsort -ate gen rank = _n su rank if iteration==1 -gen pvalue = (`r(mean)'/1000) +gen pvalue = rank/1000 list if iteration==1 diff --git a/Giffen.dta b/Giffen.dta new file mode 100644 index 0000000..e4d91bd Binary files /dev/null and b/Giffen.dta differ diff --git a/R/abortion_dd.R b/R/abortion_dd.R index afb4f47..b192d52 100644 --- a/R/abortion_dd.R +++ b/R/abortion_dd.R @@ -5,7 +5,7 @@ library(estimatr) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/abortion_dd2.R b/R/abortion_dd2.R index ecd6e3b..25e6395 100644 --- a/R/abortion_dd2.R +++ b/R/abortion_dd2.R @@ -4,7 +4,7 @@ library(estimatr) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -21,4 +21,4 @@ abortion <- read_data("abortion.dta") %>% reg <- abortion %>% filter(race == 2 & sex == 2 & age == 20) %>% lm_robust(lnr ~ repeal*year + fip + acc + ir + pi + alcohol+ crack + poverty+ income+ ur, - data = ., weights = totpop, clusters = fip) \ No newline at end of file + data = ., weights = totpop, clusters = fip) diff --git a/R/abortion_ddd.R b/R/abortion_ddd.R index 64f76a6..b48a0eb 100644 --- a/R/abortion_ddd.R +++ b/R/abortion_ddd.R @@ -4,7 +4,7 @@ library(estimatr) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -40,4 +40,4 @@ abortion_plot %>% geom_text(aes(label = year), hjust=-0.002, vjust = -0.03)+ geom_hline(yintercept = 0) + geom_errorbar(aes(ymin = mean-sd*1.96, ymax = mean+sd*1.96), width = 0.2, - position = position_dodge(0.05)) \ No newline at end of file + position = position_dodge(0.05)) diff --git a/R/abortion_ddd2.R b/R/abortion_ddd2.R index 1575ce3..d728694 100644 --- a/R/abortion_ddd2.R +++ b/R/abortion_ddd2.R @@ -4,7 +4,7 @@ library(estimatr) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -27,4 +27,4 @@ abortion <- read_data("abortion.dta") %>% regddd <- abortion %>% filter(bf == 1 & (age == 20 | age ==25)) %>% lm_robust(lnr ~ repeal*year + acc + ir + pi + alcohol + crack + poverty + income + ur, - data = ., weights = totpop, clusters = fip) \ No newline at end of file + data = ., weights = totpop, clusters = fip) diff --git a/R/bail.R b/R/bail.R index dc9f7a0..2aed15f 100644 --- a/R/bail.R +++ b/R/bail.R @@ -6,7 +6,7 @@ library(SteinIV) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/card.R b/R/card.R index 8194b3b..2ff6c79 100644 --- a/R/card.R +++ b/R/card.R @@ -4,7 +4,7 @@ library(tidyverse) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/castle_1.R b/R/castle_1.R index 0001215..c626d25 100644 --- a/R/castle_1.R +++ b/R/castle_1.R @@ -5,7 +5,7 @@ library(lfe) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/lmb_1.R b/R/lmb_1.R index b44f09b..b3d8a66 100644 --- a/R/lmb_1.R +++ b/R/lmb_1.R @@ -4,7 +4,7 @@ library(estimatr) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -21,4 +21,4 @@ lm_3 <- lm_robust(democrat ~ lagdemocrat, data = lmb_subset, clusters = id) summary(lm_1) summary(lm_2) -summary(lm_3) \ No newline at end of file +summary(lm_3) diff --git a/R/nsw_experimental.R b/R/nsw_experimental.R index 66d454d..fcb4353 100644 --- a/R/nsw_experimental.R +++ b/R/nsw_experimental.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -37,4 +37,4 @@ ate <- unique(nsw_dw$y1 - nsw_dw$y0) nsw_dw <- nsw_dw %>% filter(treat == 1) %>% - select(-y1, -y0) \ No newline at end of file + select(-y1, -y0) diff --git a/R/nsw_pscore.R b/R/nsw_pscore.R index 82a1282..67c0928 100644 --- a/R/nsw_pscore.R +++ b/R/nsw_pscore.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/ols4.R b/R/ols4.R index a065131..aab251c 100644 --- a/R/ols4.R +++ b/R/ols4.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/read_data.R b/R/read_data.R index 6c6e7f6..96fe36c 100644 --- a/R/read_data.R +++ b/R/read_data.R @@ -2,8 +2,8 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) -} \ No newline at end of file +} diff --git a/R/reganat.R b/R/reganat.R index 214303c..215c08c 100644 --- a/R/reganat.R +++ b/R/reganat.R @@ -2,7 +2,7 @@ library(tidyverse) library(haven) read_data <- function(df) { - full_path <- paste0("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste0("https://github.com/scunning1975/mixtape/raw/master/", df) haven::read_dta(full_path) } diff --git a/R/ri.R b/R/ri.R index 2bf0cb8..48416b6 100644 --- a/R/ri.R +++ b/R/ri.R @@ -4,7 +4,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/sasp.R b/R/sasp.R index 712c8d7..e73d191 100644 --- a/R/sasp.R +++ b/R/sasp.R @@ -5,7 +5,7 @@ library(plm) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/synth_1.R b/R/synth_1.R index 73ae592..718e372 100644 --- a/R/synth_1.R +++ b/R/synth_1.R @@ -2,12 +2,11 @@ library(tidyverse) library(haven) library(Synth) library(devtools) -if(!require(SCtools)) devtools::install_github("bcastanho/SCtools") library(SCtools) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/teffects_ipw.R b/R/teffects_ipw.R index 9395494..9676225 100644 --- a/R/teffects_ipw.R +++ b/R/teffects_ipw.R @@ -4,7 +4,7 @@ library(ipw) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -26,4 +26,4 @@ ipw <- ipwpoint(exposure = treat, data = nsw_dw_cpscontrol) -#NOT WORKING# #DO NOT USE IT# \ No newline at end of file +#NOT WORKING# #DO NOT USE IT# diff --git a/R/thornton_ri.R b/R/thornton_ri.R index fc7faf9..600f526 100644 --- a/R/thornton_ri.R +++ b/R/thornton_ri.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/titanic.R b/R/titanic.R index 62f97c9..fe13c80 100644 --- a/R/titanic.R +++ b/R/titanic.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) @@ -22,4 +22,4 @@ ey0 <- titanic %>% pull(survived) %>% mean() -sdo <- ey1 - ey0 \ No newline at end of file +sdo <- ey1 - ey0 diff --git a/R/training_bias_reduction.R b/R/training_bias_reduction.R index 62ba9a8..e1cbf9a 100644 --- a/R/training_bias_reduction.R +++ b/R/training_bias_reduction.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/training_example.R b/R/training_example.R index 0d389e4..c914cb4 100644 --- a/R/training_example.R +++ b/R/training_example.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/R/yule.R b/R/yule.R index e55ade2..2e8a378 100644 --- a/R/yule.R +++ b/R/yule.R @@ -3,7 +3,7 @@ library(haven) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/Texas/R/synth_1.R b/Texas/R/synth_1.R index 73ae592..f9d127d 100644 --- a/Texas/R/synth_1.R +++ b/Texas/R/synth_1.R @@ -7,7 +7,7 @@ library(SCtools) read_data <- function(df) { - full_path <- paste("https://raw.github.com/scunning1975/mixtape/master/", + full_path <- paste("https://github.com/scunning1975/mixtape/raw/master/", df, sep = "") df <- read_dta(full_path) return(df) diff --git a/Untitled.dta b/Untitled.dta new file mode 100644 index 0000000..c2f9e11 Binary files /dev/null and b/Untitled.dta differ diff --git a/observables.dta b/observables.dta new file mode 100644 index 0000000..199499e Binary files /dev/null and b/observables.dta differ diff --git a/python/abortion_dd.py b/python/abortion_dd.py index a52bc58..16c8f1d 100644 --- a/python/abortion_dd.py +++ b/python/abortion_dd.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/abortion_dd2.py b/python/abortion_dd2.py index 1ce1c4e..5c94280 100644 --- a/python/abortion_dd2.py +++ b/python/abortion_dd2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) @@ -28,4 +28,4 @@ def read_data(file): method='pinv') ) -regdd.summary() \ No newline at end of file +regdd.summary() diff --git a/python/abortion_ddd.py b/python/abortion_ddd.py index 3bce75c..bee7cf5 100644 --- a/python/abortion_ddd.py +++ b/python/abortion_ddd.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/abortion_ddd2.py b/python/abortion_ddd2.py index e716d29..bdf5b2b 100644 --- a/python/abortion_ddd2.py +++ b/python/abortion_ddd2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) abortion = read_data('abortion.dta') abortion = abortion[~pd.isnull(abortion.lnr)] diff --git a/python/bail.py b/python/bail.py index 5c3d3e2..65c8ea1 100644 --- a/python/bail.py +++ b/python/bail.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) judge = read_data("judge_fe.dta") diff --git a/python/card.py b/python/card.py index 3e1eee2..b3f193a 100644 --- a/python/card.py +++ b/python/card.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) card = read_data("card.dta") diff --git a/python/castle_1.py b/python/castle_1.py index cec7b5f..54315d8 100644 --- a/python/castle_1.py +++ b/python/castle_1.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) castle = read_data('castle.dta') diff --git a/python/castle_2.py b/python/castle_2.py index 86065fc..4b5004d 100644 --- a/python/castle_2.py +++ b/python/castle_2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) castle['time_til'] = castle['year'] - castle['treatment_date'] diff --git a/python/castle_3.py b/python/castle_3.py index fb2cbcf..562a669 100644 --- a/python/castle_3.py +++ b/python/castle_3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/castle_5.py b/python/castle_5.py index fce3972..4cbb281 100644 --- a/python/castle_5.py +++ b/python/castle_5.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/cluster1.py b/python/cluster1.py index e98d313..53accee 100644 --- a/python/cluster1.py +++ b/python/cluster1.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/cluster2.py b/python/cluster2.py index cea0549..97c8195 100644 --- a/python/cluster2.py +++ b/python/cluster2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def gen_cluster(param = (.1, .5), n = 1000, n_cluster = 50, rho = .5): diff --git a/python/cluster3.py b/python/cluster3.py index 05652eb..6e344e9 100644 --- a/python/cluster3.py +++ b/python/cluster3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def gen_cluster(param = (.1, .5), n = 1000, n_cluster = 50, rho = .5): diff --git a/python/cluster4.py b/python/cluster4.py index 6d1a092..3351a5f 100644 --- a/python/cluster4.py +++ b/python/cluster4.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/collider_discrimination.py b/python/collider_discrimination.py index 3814e03..8b1ec65 100644 --- a/python/collider_discrimination.py +++ b/python/collider_discrimination.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/independence.py b/python/independence.py index 9b5a44e..f234175 100644 --- a/python/independence.py +++ b/python/independence.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/ipw.py b/python/ipw.py index 7309359..b7efce5 100644 --- a/python/ipw.py +++ b/python/ipw.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/ks.py b/python/ks.py index 3b8671c..651ff46 100644 --- a/python/ks.py +++ b/python/ks.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/lm_3.py b/python/lm_3.py index fce3972..4cbb281 100644 --- a/python/lm_3.py +++ b/python/lm_3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/lmb_1.py b/python/lmb_1.py index c5ee56f..4686c51 100644 --- a/python/lmb_1.py +++ b/python/lmb_1.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_2.py b/python/lmb_2.py index 0333c8e..d4bfd97 100644 --- a/python/lmb_2.py +++ b/python/lmb_2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_3.py b/python/lmb_3.py index 608977d..e707e64 100644 --- a/python/lmb_3.py +++ b/python/lmb_3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_4.py b/python/lmb_4.py index 9aab049..9cc6bba 100644 --- a/python/lmb_4.py +++ b/python/lmb_4.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_5.py b/python/lmb_5.py index cd01bcb..a312e05 100644 --- a/python/lmb_5.py +++ b/python/lmb_5.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_6.py b/python/lmb_6.py index 4fef52f..1878dab 100644 --- a/python/lmb_6.py +++ b/python/lmb_6.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/lmb_7.py b/python/lmb_7.py index e3140a5..66b181c 100644 --- a/python/lmb_7.py +++ b/python/lmb_7.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) def lm_robust(formula, data): regression = sm.OLS.from_formula(formula, data = data) diff --git a/python/moviestar.py b/python/moviestar.py index 5b5cfda..5eeb789 100644 --- a/python/moviestar.py +++ b/python/moviestar.py @@ -10,7 +10,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/nsw_experimental.py b/python/nsw_experimental.py index fc04c53..1d110eb 100644 --- a/python/nsw_experimental.py +++ b/python/nsw_experimental.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) nsw_dw = read_data('nsw_mixtape.dta') diff --git a/python/nsw_pscore.py b/python/nsw_pscore.py index 4243c4c..6ee089c 100644 --- a/python/nsw_pscore.py +++ b/python/nsw_pscore.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) # Prepare data for logit diff --git a/python/ols.py b/python/ols.py index d16c8e6..fe79170 100644 --- a/python/ols.py +++ b/python/ols.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) np.random.seed(1) diff --git a/python/ols2.py b/python/ols2.py index 9ba6d00..6d0777f 100644 --- a/python/ols2.py +++ b/python/ols2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) tb = pd.DataFrame({ diff --git a/python/ols3.py b/python/ols3.py index 0a06157..009aad8 100644 --- a/python/ols3.py +++ b/python/ols3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) coefs = np.zeros(1000) for i in range(1000): diff --git a/python/ols4.py b/python/ols4.py index fce3972..4cbb281 100644 --- a/python/ols4.py +++ b/python/ols4.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/rdd_simulate1.py b/python/rdd_simulate1.py index dc2f0e2..5910e60 100644 --- a/python/rdd_simulate1.py +++ b/python/rdd_simulate1.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) np.random.seed(12282020) diff --git a/python/rdd_simulate2.py b/python/rdd_simulate2.py index 80527a7..0aae7ae 100644 --- a/python/rdd_simulate2.py +++ b/python/rdd_simulate2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) np.random.seed(12282020) diff --git a/python/rdd_simulate3.py b/python/rdd_simulate3.py index a136c7d..7180307 100644 --- a/python/rdd_simulate3.py +++ b/python/rdd_simulate3.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) np.random.seed(12282020) diff --git a/python/rdd_simulate4.py b/python/rdd_simulate4.py index 794d843..c652069 100644 --- a/python/rdd_simulate4.py +++ b/python/rdd_simulate4.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) np.random.seed(12282020) diff --git a/python/read_data.py b/python/read_data.py index fce3972..4cbb281 100644 --- a/python/read_data.py +++ b/python/read_data.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/reganat.py b/python/reganat.py index 9fa6faf..9ea4b9d 100644 --- a/python/reganat.py +++ b/python/reganat.py @@ -9,10 +9,10 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) -auto = pd.read_stata('https://raw.github.com/scunning1975/mixtape/master/auto.dta') +auto = pd.read_stata('https://github.com/scunning1975/mixtape/raw/master/auto.dta') auto['length'] = auto['length'] - auto['length'].mean() lm1 = sm.OLS.from_formula('price ~ length', data=auto).fit() diff --git a/python/ri.py b/python/ri.py index a6e5f47..318d092 100644 --- a/python/ri.py +++ b/python/ri.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/sasp.py b/python/sasp.py index bc2bca9..8e47a08 100644 --- a/python/sasp.py +++ b/python/sasp.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/synth_1.py b/python/synth_1.py index fa4605e..bbc9ef9 100644 --- a/python/synth_1.py +++ b/python/synth_1.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/synth_2.py b/python/synth_2.py index 5c6d4f0..32f0b5c 100644 --- a/python/synth_2.py +++ b/python/synth_2.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/tea.py b/python/tea.py index fd88fbd..b333ec2 100644 --- a/python/tea.py +++ b/python/tea.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) correct = pd.DataFrame({'cup': np.arange(1,9), diff --git a/python/teffects_ipw.py b/python/teffects_ipw.py index fce3972..4cbb281 100644 --- a/python/teffects_ipw.py +++ b/python/teffects_ipw.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/thornton_ri.py b/python/thornton_ri.py index 21b751d..5208d62 100644 --- a/python/thornton_ri.py +++ b/python/thornton_ri.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) hiv = read_data("thornton_hiv.dta") diff --git a/python/titanic.py b/python/titanic.py index 175837e..1140b78 100644 --- a/python/titanic.py +++ b/python/titanic.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/titanic_subclassification.py b/python/titanic_subclassification.py index b0af933..62ef64b 100644 --- a/python/titanic_subclassification.py +++ b/python/titanic_subclassification.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) @@ -44,4 +44,4 @@ def weighted_avg_effect(df): wate = titanic.groupby('s').apply(weighted_avg_effect).sum() -print("The weigthted average treatment effect estimate is {:.2%}".format(wate)) \ No newline at end of file +print("The weigthted average treatment effect estimate is {:.2%}".format(wate)) diff --git a/python/training_bias_reduction.py b/python/training_bias_reduction.py index f29752b..f622bd8 100644 --- a/python/training_bias_reduction.py +++ b/python/training_bias_reduction.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) training_bias_reduction = read_data("training_bias_reduction.dta") diff --git a/python/training_example.py b/python/training_example.py index e87e513..592d0c7 100644 --- a/python/training_example.py +++ b/python/training_example.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/python/yule.py b/python/yule.py index 09c4d81..f3d2b03 100644 --- a/python/yule.py +++ b/python/yule.py @@ -9,7 +9,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context def read_data(file): - return pd.read_stata("https://raw.github.com/scunning1975/mixtape/master/" + file) + return pd.read_stata("https://github.com/scunning1975/mixtape/raw/master/" + file) diff --git a/texas.dta b/texas.dta index f45a3c7..51351f2 100644 Binary files a/texas.dta and b/texas.dta differ diff --git a/training.dta b/training.dta new file mode 100644 index 0000000..10f68fb Binary files /dev/null and b/training.dta differ diff --git a/training_approximate.dta b/training_approximate.dta new file mode 100644 index 0000000..f60db80 Binary files /dev/null and b/training_approximate.dta differ diff --git a/training_approximate.xlsx b/training_approximate.xlsx new file mode 100644 index 0000000..b3c7372 Binary files /dev/null and b/training_approximate.xlsx differ diff --git a/training_biasadj.do b/training_biasadj.do new file mode 100644 index 0000000..8ce3ca7 --- /dev/null +++ b/training_biasadj.do @@ -0,0 +1,31 @@ +* Matching with and without bias adjustment +capture log close +clear +use https://github.com/scunning1975/mixtape/raw/master/training_biasadj.dta, clear + +* Recall the ATT was estimated to be $1607.50 +su earnings if treat==1 +local y1 = `r(mean)' +gen y1=`y1' +su y1 + +su earnings if treat==0 +local y2 = `r(mean)' +gen y2=`y2' +su y2 + +gen att = y1-y2 +su att // ATT $1607.50 + +* Estimate earnings using OLS on age and gpa but only control group +reg earnings gpa if treat==0 ,nocons +predict mu + +reshape wide age gpa earning unit mu, i(matched) j(treat) + +gen diff = (earnings1 - earnings0) +su diff // $1607.50 + +gen diff_biasadj = (earnings1 - earnings0) - (mu1 - mu0) +su diff_biasadj + diff --git a/training_biasadj.dta b/training_biasadj.dta new file mode 100644 index 0000000..8c03299 Binary files /dev/null and b/training_biasadj.dta differ diff --git a/training_exact.dta b/training_exact.dta new file mode 100644 index 0000000..5812d66 Binary files /dev/null and b/training_exact.dta differ