Learn R Programming

LARF (version 1.3)

larf: Local Average Response Functions for Instrumental Variable Estimation of Treatment Effects

Description

The function provides instrumental variable estimation of treatment effects when both the endogenous treatment and its instrument are binary. Applicable to both binary and continuous outcomes. If you use this package, pleae cite it as follows.

An, Weihua and Xuefu Wang. 2013. ``LARF: Local Average Response Functions for Instrumental Variable Estimation of Treatment Effects." An R package available at CRAN. http://cran.r-project.org/web/packages/LARF/index.html.

Usage

larf(formula, treatment, instrument, data, method = "LS", AME = FALSE, optimizer = "Nelder-Mead", zProb = NULL)

Arguments

formula
specification of the outcome model in the form like either y ~ x1 + x2 or y ~ X where X is a matrix containing all the covariates excluding the treatment.
treatment
A vector containing the binary treatment.
instrument
A vector containing the binary instrument for the endogenous treatment.
data
an optional data frame. If unspecified, the data will be taken from the working environment.
method
the estimation method to be used. The default is ``LS", standing for least squares. ``ML", standing for maximum likelihood, is an alternative.
AME
whether average marginal effects (AME) should be reported. The default is FALSE, in which case marginal effects at the means (MEM) are reported.
optimizer
the optimization algorithm for the ML method. It should be one of ``Nelder-Mead", ``BFGS", ``CG", ``L-BFGS-B", ``SANN", or ``Brent". See optim in R for more detail.
zProb
a vector containing the probability of receiving the treatment inducement (i.e., instrument = 1) that have been estimated by semiparametrical methods.

Value

coefficients
Estimated coefficients.
SE
Standard errors of the estimated coefficients.
MargEff
Estimated marginal effects, available only for binary outcomes.
MargStdErr
Standard errors of the estimated marginal effects, available only for binary outcomes.
vcov
Variance covariance matrix of the estimated coefficients.
fitted.values
Predicted outcomes based on the estimated model. They are probabilities when the outcome is binary.

Details

larf is the high-level interface to the work-horse function larf.fit. A set of standard methods (including print, summary, coef, vcov, fitted, resid, predict) can be used to extract the corresponding information from a larf object.

The function provides instrumental variable estimation of treatment effects when both the endogenous treatment and its instrument (i.e., the treatment inducement) are binary. The method (Abadie, 2003) involves two steps. First, pseudo-weights are constructed from the probability of receiving the treatment inducement. By default the function estimates the probability by a Probit regression. But it also allows users to employ the probability that has been estimated by semiparametric methods. Second, the pseudo-weights are used to estimate the local average response function of the outcome conditional on the treatment and covariates. The function provides both least squares and maximum likelihood estimates of the conditional treatment effects.

References

Abadie, Alberto. 2003. "Semiparametric Instrumental Variable Estimation of Treatment Response Models." Journal of Econometrics 113: 231-263.

See Also

larf.fit, c401k

Examples

Run this code
data(c401k)
attach(c401k)

## Not run: 
# # Continuous outcome. Treatment effects of participation in 401(k) 
# # on net family financial assest
# est1 <- larf(nettfa ~ inc + age + agesq + marr + fsize, treatment = p401k, 
# instrument = e401k, data = c401k)
# summary(est1)
# 
# # Nonparametric estimates of the probability of 
# # receiving the treatment inducement
# library(mgcv)
# firstStep <- gam(e401k ~ s(inc) + s(age) + s(agesq) + marr + s(fsize), 
# data=c401k, family=binomial(link = "probit"))
# zProb <- firstStep$fitted
# est2<- larf(nettfa ~ inc + age + agesq + marr + fsize, treatment = p401k, 
# instrument = e401k, data = c401k, zProb = zProb)
# summary(est2) 
# 
# # Binary outcome. Treatment effects of participation in 401(k) 
# # on participation in IRA
# est3 <- larf(pira ~ inc + age + agesq + marr + fsize, treatment = p401k, 
# instrument = e401k, data = c401k)
# summary(est3) 
# ## End(Not run)

Run the code above in your browser using DataLab