Learn R Programming

LARF (version 1.1)

larf: Local Average Response Functions

Description

Provides instrumental variable estimation of treatment effects for compliers when the treatment variable is binary. Applicable to both binary and continuous outcomes.

Usage

larf(formula, treatment, instrument, data, outcome = "binary", 
      method = "NLS", discrete = TRUE)

Arguments

formula
Formula specification of the regression of the outcome on the covariates in the form like either y ~ x1 + x2 or y ~ X where X is the design matrix containing all the covariates excluding the treatment variable.
treatment
A vector containing the binary treatment variable.
instrument
A vector containing the binary instrumental variable, for example, the treatment assignment.
data
An optional data frame including the corresponding data for the model. If not specified, the data will be taken from the current environment.
outcome
A character string for the type of outcomes. The default is "binary". The other option is "continuous".
method
A character string for the estimation method to be used for binary outcome models. The default is "NLS", standing for nonlinear least squares. Maximum likelihood method (MLE) may be added in future versions.
discrete
A logical flag for whether marginal effects should be reported. The default is TRUE. This option is valid only for binary outcomes.

Value

  • coefficientsEstimated coefficients for treatment and covariates.
  • StdErrStandard errors of the estimated coefficients.
  • MargEffEstimated marginal effects of treatment and covariates, available only for binary outcomes.
  • MargStdErrStandard errors of the estimated marginal effects, available only for binary outcomes.
  • vcovVariance covariance matrix between the parameters with the first entry being the treatment variable.
  • fitted.valuesThe predicted outcomes based on the estimated coefficients and the observed covariates. They are probabilities when the outcome is binary.
  • residualsThe differnece between the observed outcomes and the fitted values.

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 treatment variable and instrumental variable are binary. First, pseudo weights are constructed from a probit regression of the instrumental variable on covariates. Then, the weights are used in the regression of the outcome on the treatment and covariates. When the outcome is binary, weighted nonlinear least squares method with a probit link is used. When the outcome is continuous, weighted least squares is used. More details of the methods can be found in Abadie (2003).

References

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

See Also

larf.fit, c401k

Examples

Run this code
data(c401k)

# Choose the first 500 units for a small example
c401k <- c401k[1:500,]

Y <- c401k$pira
X <- as.matrix(c401k[c("inc", "incsq", "marr",  "male", "age", "agesq",  "fsize"  )])
D <- c401k$p401k
Z <- c401k$e401k

# high-level interface
est <- larf(Y~X, D, Z)

# low-level interface
est2 <- larf.fit(Y, X, D, Z)

Run the code above in your browser using DataLab