# Difference between AR confidence intervals reported in weakiv versus twostepweakiv

Should the Anderson-Rubin confidence intervals reported in weakiv and twostepweakiv be equal to each other? Sun (2018) does not say if it should.

I tried the following estimations on stata 15:

ssc install avar
ssc install ranktest
ssc install ivreg2
ssc install xtivreg2
ssc install weakiv
ssc install twostepweakiv

* Example 1
use "http://www.stata.com/data/jwooldridge/eacsap/cornwell.dta", clear
xtset county year
xtivreg2 d.lcrmrte (d.l.lcrmrte = l2.lcrmrte l3.lcrmrte), fe cluster(county)
weakiv, usegrid md
twostepweakiv 2sls d.lcrmrte (d.l.lcrmrte = l2.lcrmrte l3.lcrmrte) i.county, cluster(county)

*Example 2
use "http://www.stata.com/data/jwooldridge/eacsap/cornwell.dta", clear
xtset county year
xtivreg2 d.lcrmrte (d.l.lcrmrte = l3.lcrmrte), fe cluster(county)
weakiv, usegrid md
twostepweakiv 2sls d.lcrmrte (d.l.lcrmrte = l3.lcrmrte) i.county, cluster(county)

*Example 3
use "http://www.stata.com/data/jwooldridge/eacsap/cornwell.dta", clear
xtset county year
ivreg2 d.lcrmrte (d.l.lcrmrte = l3.lcrmrte)
weakiv, usegrid md
twostepweakiv 2sls d.lcrmrte (d.l.lcrmrte = l3.lcrmrte)


What I get:

Example 1:
AR(weakiv) confidence interval: [ .193828, .657586]
AR(twostepweakiv) confidence interval:  [ .215564, .657013]

Example 2:
AR(weakiv) confidence interval:  [ .020064, .685184]
AR(twostepweakiv) confidence interval:   [ .023143, .669788]

Example 3:
AR(weakiv) confidence interval:   [ ... ,-2.00356] U [-.063193, ... ]
AR(twostepweakiv) confidence interval:   entire grid


The difference in magnitudes here do not seem related to whether we use fixed effects or not. Incidentally, the Wald confidence intervals for Example 2, gives the same values from both methods. Also, in Sun (2018) page (17), the AR confidence intervals are the same as those using rivtest in Findlay and Magnusson (2009) page (410).

References:

rivtest Finlay, Keith & Magnusson, Leandro. (2009). Implementing Weak Instrument Robust Tests for a General Class of Instrumental Variables Models. The Stata Journal. 9. 10.1177/1536867X0900900304.

weakiv Keith Finlay & Leandro Magnusson & Mark E Schaffer, (2013). "WEAKIV: Stata module to perform weak-instrument-robust tests and confidence intervals for instrumental-variable (IV) estimation of linear, probit and tobit models," Statistical Software Components S457684, Boston College Department of Economics, revised 18 Oct 2016.

twostepweakiv Sun, Liyang. (2018). Implementing valid two-step identification-robust confidence sets for linear instrumental-variables models. Stata Journal 18(4), 803–825.