eff_F: Effective F

View source: R/effF.R

eff_FR Documentation

Effective F

Description

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. A factor or character instrument enters as dummy variables for all its levels but the first (base) level, named <instrument>_<level>, so a factor with K levels counts as K - 1 instruments.

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

Details

The instruments must be identified: after the intercept, controls and fixed effects are partialled out, they must be linearly independent of each other and not (numerically) zero. Otherwise eff_F() stops with an error. Collinear controls are harmless and are ignored. The instruments are centred and scaled internally; the effective F does not depend on their scale or mean. This is not done with two or more clustering variables: lfe then repairs the multiway cluster variance in a way that depends on the scale of the regressors, and the instruments are used as they are, so that with one instrument the effective F equals the cluster-robust F of ivDiag().

Value

the effective F statistic.

References

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

See Also

ivDiag

Examples

data(ivDiag)
effF <- eff_F(data = mcclendon, Y = "intended", D = "openedesteem", 
    Z = "esteem", controls = NULL)

ivDiag documentation built on Nov. 12, 2026, 5:06 p.m.