Skip to contents

Extracts key diagnostic statistics from an instrumental variables regression, including the first-stage F-statistic, Wu-Hausman endogeneity test, and effective F-statistic (when available). Supports fixest IV models and ivreg models.

Usage

iv_diagnostic_summary(model, conf_level = 0.95)

Arguments

model

An IV model object. Supported classes: fixest (from feols with IV syntax) or ivreg (from ivreg).

conf_level

Numeric. Confidence level for decision thresholds. Default is 0.95.

Value

A data frame with columns:

test

Character. Name of the diagnostic test.

statistic

Numeric. Test statistic value.

p_value

Numeric. P-value (where applicable; NA for effective F).

decision

Character. Plain-language interpretation at the given confidence level.

Examples

if (FALSE) { # \dontrun{
# IV regression with fixest
mod <- feols(y ~ x1 | z1 + z2 ~ endo1, data = mydata)
iv_diagnostic_summary(mod)

# IV regression with ivreg
library(ivreg)
mod2 <- ivreg(y ~ endo1 + x1 | z1 + z2 + x1, data = mydata)
iv_diagnostic_summary(mod2)
} # }