summary.civ {civ}R Documentation

Inference Methods for the Categorical Instrumental Variable Estimator.

Description

Inference methods for the categorical instrumental variable estimators. Simple wrapper for AER::summary.ivreg().

Usage

## S3 method for class 'civ'
summary(object, ...)

Arguments

object

An object of class civ as fitted by civ().

...

Additional arguments passed to summary.ivreg. See AER::summary.ivreg() for a complete list of arguments.

Value

An object of class summary.ivreg with inference results.

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."

See Also

AER::summary.ivreg()

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)

[Package civ version 0.1.0 Index]