Skip to contents

Kleibergen-Paap rank statistic

Usage

morie_iv_kleibergen_paap(data, endogenous, instruments, exogenous = NULL)

Arguments

data

A data.frame (or tibble) holding the outcome, endogenous regressors, instruments, and any exogenous controls.

endogenous

Character vector; column names of the endogenous regressors.

instruments

Character vector; column names of the instrumental variables.

exogenous

Optional character vector of additional exogenous regressors included in both the structural equation and the first stage. NULL (default) for a just-identified design.

Value

A named list with elements statistic, p_value, name, details.

Examples

set.seed(1)
n <- 300
z <- rbinom(n, 1, 0.5); u <- rnorm(n)
d <- rbinom(n, 1, plogis(0.8 * z + 0.3 * u))
y <- 0.5 * d + 0.4 * u + rnorm(n, sd = 0.5)
df <- data.frame(y, d, z)
out <- morie_iv_kleibergen_paap(df, "d", "z")
out$statistic
#> [1] 12.63993