cf {controlfunctionIV}R Documentation

Control-Function

Description

Implement the control function method for the inference of nonlinear treatment effects.

Usage

cf(formula, d1 = NULL, d2 = NULL)

Arguments

formula

A formula describing the model to be fitted.

d1

The baseline treatment value.

d2

The target treatment value.

Details

For example, the formula Y ~ D + I(D^2)+X|Z+I(Z^2)+X describes the models Y = \alpha_0 + D\beta_1 + D^2\beta_2 + X\phi + u and D = \gamma_0 + Z\gamma_1 + Z^2\gamma_2 + X\psi + v. Here, the outcome is Y, the endogenous variables is D, the baseline covariates are X, and the instrument variables are Z. The formula environment follows that in the ivreg function in the AER package. The endogenous variable D must be in the first term of the formula for the outcome model. If either one of d1 or d2 is missing or NULL, CausalEffect is calculated assuming that the baseline value d1 is the median of the treatment and the target value d2 is d1+1.

Value

cf returns an object of class "cf", which is a list containing the following components:

coefficients

The estimate of the coefficients in the outcome model.

vcov

The estimated covariance matrix of coefficients.

CausalEffect

The causal effect when the treatment changes from d1 to d2.

CausalEffect.sd

The standard error of the causal effect estimator.

CausalEffect.ci

The 95% confidence interval of the causal effect.

References

Guo, Z. and D. S. Small (2016), Control function instrumental variable estimation of nonlinear causal effect models, The Journal of Machine Learning Research 17(1), 3448–3482.

Examples

data("nonlineardata")
Y <- log(nonlineardata[,"insulin"])
D <- nonlineardata[,"bmi"]
Z <- as.matrix(nonlineardata[,c("Z.1","Z.2","Z.3","Z.4")])
X <- as.matrix(nonlineardata[,c("age","sex")])
cf.model <- cf(Y~D+I(D^2)+X|Z+I(Z^2)+X)
summary(cf.model)


[Package controlfunctionIV version 0.1.1 Index]