Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/scunning1975/mixtape
Browse files Browse the repository at this point in the history
  • Loading branch information
scunning1975 committed Mar 7, 2023
2 parents 8f5b41c + feb1406 commit bfc9653
Show file tree
Hide file tree
Showing 88 changed files with 122 additions and 92 deletions.
2 changes: 1 addition & 1 deletion Do/abortion_ddd.do
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Do/collider_discrimination.do
Original file line number Diff line number Diff line change
Expand Up @@ -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


2 changes: 1 addition & 1 deletion Do/synth_6.do
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Do/thornton_ri.do
Original file line number Diff line number Diff line change
Expand Up @@ -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

Binary file added Giffen.dta
Binary file not shown.
2 changes: 1 addition & 1 deletion R/abortion_dd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/abortion_dd2.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
data = ., weights = totpop, clusters = fip)
4 changes: 2 additions & 2 deletions R/abortion_ddd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
position = position_dodge(0.05))
4 changes: 2 additions & 2 deletions R/abortion_ddd2.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
data = ., weights = totpop, clusters = fip)
2 changes: 1 addition & 1 deletion R/bail.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/card.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/castle_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/lmb_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,4 +21,4 @@ lm_3 <- lm_robust(democrat ~ lagdemocrat, data = lmb_subset, clusters = id)

summary(lm_1)
summary(lm_2)
summary(lm_3)
summary(lm_3)
4 changes: 2 additions & 2 deletions R/nsw_experimental.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -37,4 +37,4 @@ ate <- unique(nsw_dw$y1 - nsw_dw$y0)

nsw_dw <- nsw_dw %>%
filter(treat == 1) %>%
select(-y1, -y0)
select(-y1, -y0)
2 changes: 1 addition & 1 deletion R/nsw_pscore.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/ols4.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/read_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion R/reganat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion R/ri.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/sasp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions R/synth_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/teffects_ipw.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -26,4 +26,4 @@ ipw <- ipwpoint(exposure = treat,
data = nsw_dw_cpscontrol)


#NOT WORKING# #DO NOT USE IT#
#NOT WORKING# #DO NOT USE IT#
2 changes: 1 addition & 1 deletion R/thornton_ri.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/titanic.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -22,4 +22,4 @@ ey0 <- titanic %>%
pull(survived) %>%
mean()

sdo <- ey1 - ey0
sdo <- ey1 - ey0
2 changes: 1 addition & 1 deletion R/training_bias_reduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/training_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/yule.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Texas/R/synth_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file added Untitled.dta
Binary file not shown.
Binary file added observables.dta
Binary file not shown.
2 changes: 1 addition & 1 deletion python/abortion_dd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
4 changes: 2 additions & 2 deletions python/abortion_dd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand All @@ -28,4 +28,4 @@ def read_data(file):
method='pinv')
)

regdd.summary()
regdd.summary()
2 changes: 1 addition & 1 deletion python/abortion_ddd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
2 changes: 1 addition & 1 deletion python/abortion_ddd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion python/bail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion python/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion python/castle_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion python/castle_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion python/castle_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
2 changes: 1 addition & 1 deletion python/castle_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Loading

0 comments on commit bfc9653

Please sign in to comment.