Instrumental Variables Continued

Endogeneity Problem

A Possible Solution: Instrumental Variables

IV assumptions

IV asymptotics

Example application: Estimating a demand curve

Example: Cigarette demand

ivreg(log(packs) ~ log(rprice) | tdiff, data = c1995)

Example: Cigarette demand (Code)

#Load library containing IV command 'ivreg'
library(AER)
# Load data on cigarette prices and quantities
data("CigarettesSW")
#Use real prices as X
CigarettesSW$rprice <- with(CigarettesSW, price/cpi)
#Use changes in cigarette tax as
# instrument which shifts supply curve
CigarettesSW$tdiff <- with(CigarettesSW, (taxs - tax)/cpi)
#data from different states in 1995
c1995 <- subset(CigarettesSW, year == "1995")

IV estimate of demand elasticity for cigarettes (code)

#To get IV estimate of effect of x on y using
#  z as instrument syntax is ivreg(y ~ x | z)
# Effect of log(price) on log(quantity)
# Elasticity
fm_ivreg <- ivreg(log(packs) ~ log(rprice)
                  | tdiff, data = c1995)
#Obtain (robust) standard errors
fm_ivreg.results<-coeftest(fm_ivreg,
         vcov = vcovHC(fm_ivreg, type = "HC0"))

OLS estimate of demand elasticity for cigarettes (code)

#OLS estimate of effect of log(price)
 #on log(quantity)  with no instrument
fm_ols <- lm(formula= log(packs) ~
               log(rprice), data = c1995)
#Obtain (robust) standard errors
fm_ols.results<-coeftest(fm_ols,
    vcov = vcovHC(fm_ols, type = "HC0"))

Components of IV estimates of demand elasticity for cigarettes (code)

# First stage: z on x
firststage<-lm(formula= log(rprice) ~
                 tdiff, data = c1995)
firststage.results<-coeftest(firststage,
    vcov = vcovHC(firststage, type = "HC0"))
# Reduced form
reducedform<-lm(formula= log(packs) ~
                tdiff, data = c1995)
reducedform.results<-coeftest(reducedform,
         vcov = vcovHC(reducedform, type = "HC0"))

Results of IV estimates of demand elasticity for cigarettes (code)

#Display results in big fancy table
library(stargazer)
stargazer(fm_ols.results,fm_ivreg.results,
          reducedform.results,firststage.results,
    type="html", 
    title="Cigarette Demand Elasticity: OLS, 
      IV, Reduced Form, First Stage",
    header=FALSE,
    column.labels=c("log(packs)","log(packs)",
                    "log(packs)","log(price)"),
    omit.table.layout="n")

Results of IV estimates of demand elasticity for cigarettes

Cigarette Demand Elasticity: OLS, IV, Reduced Form, First Stage
Dependent variable:
log(packs) log(packs) log(packs) log(price)
(1) (2) (3) (4)
log(rprice) -1.213*** -1.084***
(0.190) (0.312)
tdiff -0.033*** 0.031***
(0.010) (0.005)
Constant 10.339*** 9.720*** 4.717*** 4.617***
(0.915) (1.496) (0.064) (0.028)

Results

Potential Outcomes Again

Potential Outcomes in IV

IV Estimate in Binary Z, Binary X case

Goal of potential outcome interpretation

Causal effect of Z on X

Reduced form in potential outcomes framework

Reduced form in potential outcomes framework, ctd

Monotonicity

First stage in potential outcomes framework

LATE

Interpretation

\[\hat{\beta}^{IV}_1\overset{p}{\rightarrow}E[Y^1_i-Y^0_i|X_i^1=1,X_i^0=0]\]

Extensions

Example: Charter School Effectiveness

Results (from Angrist and Pischke, Table 3.1)

Interpretation

Conclusions

Next Class or Two