3 Conduct Tests Separately
ivDiag can compute the effective F statistic and run the AR test and the tF procedure separately. The syntax of eff_F and AR_test is similar to that of ivDiag.
The examples use the McClendon (2014) data from Chapter 2.
3.1 Effective F statistic
eff_F(data = mcclendon, Y = Y, D = D, Z = Z, controls = NULL)
#> [1] 207.17983.2 AR test
AR_test(data = mcclendon, Y = Y, D = D, Z = Z, controls = NULL)
#> $Fstat
#> F df1 df2 p
#> 11.9462 1.0000 3645.0000 0.0006
#>
#> $ci.print
#> [1] "[0.1394, 0.4917]"
#>
#> $ci
#> [1] 0.1394 0.4917
#>
#> $bounded
#> [1] TRUEWhen the instrument is weak, the AR confidence set can be unbounded. In the simulated example below, the first stage is weak. Values of the treatment effect far from the 2SLS estimate in either direction cannot be rejected. The confidence set is therefore the union of two rays and contains the true effect, 1. AR_test finds both rays however far they lie from the estimate.
set.seed(2)
n <- 300
z <- rnorm(n); u <- rnorm(n)
d <- 0.05 * z + 0.8 * u + rnorm(n) # weak first stage
y <- 1 * d + u
weak <- data.frame(y = y, d = d, z = z)
AR_test(data = weak, Y = "y", D = "d", Z = "z", controls = NULL)
#> $Fstat
#> F df1 df2 p
#> 0.1641 1.0000 298.0000 0.6857
#>
#> $ci.print
#> [1] "(-Inf, 1.4360] Union [2.8222, Inf)"
#>
#> $ci
#> [1] -Inf 1.4360 2.8222 Inf
#>
#> $bounded
#> [1] FALSE3.3 tF procedure
tF takes a 2SLS estimate, its standard error (SE), and a first-stage F statistic. Compute the F statistic with the same variance estimator as the SE. With one instrument and robust or cluster-robust SEs, that statistic is the effective F, which ivDiag() uses. The procedure applies to one instrument only.
tF(coef = 0.3149, se = 0.0890, Fstat = 207.18)
#> F cF Coef SE t CI2.5% CI97.5% p-value
#> 207.1800 1.9600 0.3149 0.0890 3.5382 0.1405 0.4893 0.0004