Inference Methods for the Categorical Instrumental Variable Estimator.
Source:R/civ.R
summary.civ.Rd
Inference methods for the categorical instrumental variable
estimators. Simple wrapper for AER::summary.ivreg()
.
Usage
# S3 method for civ
summary(object, ...)
Arguments
- object
An object of class
civ
as fitted byciv()
.- ...
Additional arguments passed to
summary.ivreg
. SeeAER::summary.ivreg()
for a complete list of arguments.
References
Fox J, Kleiber C, Zeileis A (2023). "ivreg: Instrumental-Variables Regression by '2SLS', '2SM', or '2SMM', with Diagnostics". R package.
Wiemann T (2023). "Optimal Categorical Instruments." https://arxiv.org/abs/2311.17021
Examples
# Simulate data from a simple IV model with 800 observations
nobs = 800 # sample size
Z <- sample(1:20, nobs, replace = TRUE) # observed instrument
Z0 <- Z %% 2 # underlying latent instrument
U_V <- matrix(rnorm(2 * nobs, 0, 1), nobs, 2) %*%
chol(matrix(c(1, 0.6, 0.6, 1), 2, 2)) # first and second stage errors
D <- Z0 + U_V[, 2] # endogenous variable
y <- D + U_V[, 1] # outcome variable
# Estimate categorical instrument variable estimator with K = 2
civ_fit <- civ(y, D, Z, K = 3)
summary(civ_fit)
#>
#> Call:
#> AER::ivreg(formula = y ~ D | m_hat)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2.755541 -0.590251 -0.005237 0.581280 3.469159
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.05130 0.04616 -1.111 0.267
#> D 1.07359 0.06420 16.723 <2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.9307 on 798 degrees of freedom
#> Multiple R-Squared: 0.7347, Adjusted R-squared: 0.7343
#> Wald test: 279.7 on 1 and 798 DF, p-value: < 2.2e-16
#>