Skip to contents

Computes the effective F statistic.

Usage

eff_F(data, Y, D, Z, controls = NULL, FE = NULL, cl = NULL, 
  weights = NULL, prec = 4)

Arguments

data

name of a dataframe.

Y

a string indicating the outcome variable.

D

a string indicating the treatment variable.

Z

a vector of strings indicating the instrumental variables.

controls

a vector of strings indicating the control variables.

FE

a vector of strings indicating the fixed effects variables.

cl

a string indicating the clustering variable.

weights

a string indicating the variable that stores weights.

prec

precision of results (4 by default).

Value

the effective F statistic.

See also

References

Olea, José Luis Montiel, and Carolin Pflueger. 2013. "A Robust Test for Weak Instruments."" Journal of Business & Economic Statistics 31 (3): 358–69.

Examples

effF <- eff_F(data = rueda, Y = "e_vote_buying", D = "lm_pob_mesa", 
    Z = "lz_pob_mesa_f", controls = c("lpopulation", "lpotencial"), 
    cl = "muni_code")
library(testthat)
test_that("Check effective F", {
  expect_equal(floor(as.numeric(effF)), 8598)
})
#> Test passed 🌈