# The data is adapted from the dataset in Card and Krueger (1994), which estimates # the causal effect of an increase in the state minimum wage on the employment. # # On April 1, 1992, New Jersey raised the state minimum wage from $4.25 to $5.05 # while the minimum wage in Pennsylvania stays the same at $4.25. # # Data about the employment in the fast food restaurants in NJ (0) and PA (1) were # collected in February 1992 and in November 1992. # # Total 384 restaurants after removing null values. # # Card and Krueger (1994) Minimum Wages and Employment: A Case Study of the # Fast-Food Industry in New Jersey and Pennsylvania, The American Economic Review, # 84(4), 772-793. https://davidcard.berkeley.edu/papers/njmin-aer.pdf # # time=0 : February 1992 # time=1 : November 1992 # # treatment=1 : NJ raised the state minimum wage from $4.25 to %5.05 # treatment=0 : PA minimum wage stays the same at $4.25 # data = read.table("https://hedibert.org/wp-content/uploads/2024/10/card-krueger.txt",header=TRUE) attach(data) pretreatment.untreated = mean(outcome[time==0 & treatment==0]) pretreatment.treated = mean(outcome[time==0 & treatment==1]) posttreatment.untreated = mean(outcome[time==1 & treatment==0]) posttreatment.treated = mean(outcome[time==1 & treatment==1]) A = posttreatment.treated - pretreatment.treated B = posttreatment.untreated - pretreatment.untreated effect = A-B c(A,B,effect) interaction = time*treatment summary(lm(outcome~time+treatment+interaction)) plot(c(0,0),xlim=c(0,3),ylim=c(19.5,23.5),col=0,axes=FALSE,xlab="",ylab="Employment growth") box();axis(2) abline(v=1.5) text(1,pretreatment.untreated,round(pretreatment.untreated,2),col=2) text(2,posttreatment.untreated,round(posttreatment.untreated,2),col=2) text(1,pretreatment.treated,round(pretreatment.treated,2),col=4) text(2,posttreatment.treated,round(posttreatment.treated,2),col=4) text(1,19.5,"Pre-treatment") text(2,19.5,"Post-treatment") legend("topright",legend=c("Control Group","Treated Group"),col=c(2,4),pch=16,bty="n")