pretest: Prestest estimator

View source: R/pretest.R

pretestR Documentation

Prestest estimator

Description

This function implements the pretest estimator by comparing the control function and the TSLS estimators.

Usage

pretest(formula, alpha = 0.05)

Arguments

formula

A formula describing the model to be fitted.

alpha

The significant level. (default = 0.05)

Details

For example, the formula Y ~ D + I(D^2)+X|Z+I(Z^2)+X describes the models Y = α_0 + Dβ_1 + D^2β_2 + Xφ + u and D = γ_0 + Zγ_1 + Z^2γ_2 + Xψ + 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.

Value

pretest returns an object of class "pretest", 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.

Hausman.stat

The Hausman test statistic used to test the validity of the extra IV generated by the control function.

p.value

The p-value of the Hausman test.

cf.check

The indicator that the extra IV generated by the control function is valid.

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")])
pretest.model <- pretest(Y~D+I(D^2)+X|Z+I(Z^2)+X)
summary(pretest.model)


controlfunctionIV documentation built on Dec. 28, 2022, 1:38 a.m.