KEMBAR78
Two-Sample Instrumental-Variables Regression | PDF | Ordinary Least Squares | Regression Analysis
0% found this document useful (0 votes)
14 views17 pages

Two-Sample Instrumental-Variables Regression

Uploaded by

maominghai1988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views17 pages

Two-Sample Instrumental-Variables Regression

Uploaded by

maominghai1988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

The Stata Journal (2019)

19, Number 3, pp. 581–597 DOI: 10.1177/1536867X19874235

Two-sample instrumental-variables regression


with potentially weak instruments
Jaerim Choi Shu Shen
University of Hawaii at Manoa University of California, Davis
Honolulu, HI Davis, CA
choijm@hawaii.edu shushen@ucdavis.edu

Abstract. We develop a command, weaktsiv, for two-sample instrumental-


variables regression models with one endogenous regressor and potentially weak
instruments. weaktsiv includes the classic two-sample two-stage least-squares es-
timator whose inference is valid only under the assumption of strong instruments.
It also includes statistical tests and confidence sets with correct size and coverage
probabilities even when the instruments are weak.
Keywords: st0568, weaktsiv, two-sample two-stage least squares, weak IV, infer-
ence

1 Introduction
Conventional instrumental-variables (IV) regression requires that the dependent vari-
able, the endogenous regressor, and the instruments come from the same dataset. But
in many cases, researchers can observe only the dependent variable and endogenous
regressor in two separate data samples (see Björklund and Jäntti [1997], Miguel [2005],
Feldman [2010], Brunner, Cho, and Reback [2012], Siminski [2013], Olivetti and Paser-
man [2015], among many others). Angrist and Krueger (1992, 1995) propose two esti-
mation strategies—two-sample IV and two-sample two-stage least-squares (TS2SLS)—for
such two-sample IV regression models. Under the assumption of strong instruments,
both two-sample IV and TS2SLS estimators are consistent. Inoue and Solon (2010) pro-
vide valid inference formulas for both estimators under the assumption of strong in-
struments and show that TS2SLS is more efficient. However, when the first stage is
weak, neither estimation strategy is valid following arguments similar to the famous
Bound, Jaeger, and Baker (1995) critiques in the classic (one-sample) two-stage IV lit-
erature.
In a recent study, Choi, Gu, and Shen (2018) develop weak-instrument robust infer-
ence for the two-sample IV regression model with one single endogenous regressor. In
this article, we develop a command companion, weaktsiv, to this newly proposed in-
ference method. Specifically, the new method extends the classic Anderson–Rubin (see
Dufour [1997], Staiger and Stock [1997], Dufour and Jasiak [2001]), Kleibergen (K) (see
Kleibergen [2002]), and conditional likelihood-ratio (see Moreira [2003, 2009], Andrews,
Moreira, and Stock [2006, 2008]) tests and confidence sets to the two-sample setting.
weaktsiv also reports for completeness the classic TS2SLS estimates and associated stan-
dard errors. Both cases of homoskedasticity and heteroskedasticity are considered in
the proposed command.

c 2019 StataCorp LLC st0568


582 Two-sample weak IV

Section 2 provides background on the two-sample IV regression model. Section 3 dis-


cusses the weak-instrument robust inference methods developed in Choi, Gu, and Shen
(2018). Section 4 introduces the new command, weaktsiv. Section 4 gives examples.

2 Model and background


Let subscript j, j = 1, 2, denote random variables in the first or second dataset with
sample size nj . Assume that n1 /n2 → τ for some fixed τ > 0. In this article, we
consider the following two-sample IV regression model with independent and identically
distributed data and a single endogenous regressor,

y 1 = w 1 β + X1 γ + ǫ 1
w j = Z j π + Xj ψ + ε j , j = 1, 2

where y1 , w1 , ǫ1 , and ε1 are n1 × 1; w2 and ε2 are n2 × 1; Zj is nj × k for j = 1, 2;


and Xj is nj × p for j = 1, 2. All variables in the above model are observed except for
w1 . Researchers are primarily interested in the parameter β in the outcome equation.
TS2SLS follows the idea of classic two-stage least-squares estimation by regressing the
outcome variable y1 on a predicted endogenous regressor, w b 1 . Let w b
b + X1 ψ.
b 1 = Z1 π
b and ψ
Unlike classic two-stage least squares, π b in TS2SLS are estimated using information
from the second data sample because w1 is not observed. Specifically, the TS2SLS
estimator for β is defined as
−1
βbTS2SLS = (w
b 1′ MX1 w
b 1) w b 1′ MX1 y1

b 1 = Z1 (Z′2 MX2 Z2 )−1 Z′2 MX2 w2 +X1 (X′2 MZ2 X2 )−1 X′2 MZ2 w2 . For any matrix
where w
X, PX is used to denote X(X′ X)−1 X′ and MX = I − PX .
Under the assumption that the first-stage correlation between the endogenous re-
gressor and instruments is strong, the TS2SLS estimator is consistent and asymptoti-
cally normal. Inoue and Solon (2010) provide inference for TS2SLS under the additional
assumptions of homoskedasticity and equal moments of [Zj Xj ] across the two sam-
ples with j = 1, 2. In our model with one endogenous regressor, the Inoue and Solon
(2010) formula inflates the second-stage standard errors (that is, standard errors from
regressing y1 on w b 1 and X1 ) by a factor of {1 + (n1 /n2 )βbTS2SLS
2 2
σu1 ) }1/2 , where
σε2 /b
(b
2 ′ 2 ′
bu1 = y1 M[Z1 :X1 ] y1 /(n1 − k − p) and σ
σ bε2 = w2 M[Z2 :X2 ] w2 /(n2 − k − p).
The additional assumptions on homoskedasticity and equal moments required in
Inoue and Solon (2010) could be restrictive in applications. Pacini and Windmeijer
(2016) provide TS2SLS inference that is robust to heteroskedasticity and unequal mo-
ments of excluded instruments and exogenous regressors, although their results are still
not robust to weak instruments. In general, TS2SLS is valid only when the first-stage
correlation between instruments and the endogenous regressor is strong.
Table 1 illustrates limitations of the TS2SLS strategy. The data-generating process
(DGP) is taken from Choi, Gu, and Shen (2018), where Z1i ∼ N (0, Ik ), (ǫ1i , e1i ) ∼
J. Choi and S. Shen 583

N (0, I2 ), ǫ1i = 0.1ε1i + 1 − 0.12 e1i , y1i = w1i β + ǫ1i , w1i = Z1i π + ε1i , Z2i ∼ N (0, Ik ),
ε2i ∼ N (0, 1), and w2i = Z2i π + ε2i . The sample sizes are n1 = 5000 and n2 = 1000.
The numberpof instruments k is set to 1, 5, or 10. The first-stage coefficient vector
π is set to λ/(n2 k) × ι, where ι is a vector of k ones and λ/k is the concentration
parameter capturing the strength of instruments. λ/k is set to 1, 4, or 16.
Table 1 reports the coverage rate of the 95% Inoue and Solon (2010) confidence in-
terval (CI) among 5,000 simulation repetitions as well as the bias and root mean squared
error of the TS2SLS estimator. The simulation results show that TS2SLS produces large
biases and unreliable CI when the instruments are weak. The 95% CI could have cover-
age rate as low as 13.7% when there are many weak instruments (k = 10, λ/k = 1). The
bias is generally negative when β = 2 and positive when β = −2 because TS2SLS suffers
from a classic attenuation bias. The attenuation bias is also inversely proportional to
the strength of instruments. See Choi, Gu, and Shen (2018) for more details.

Table 1. Properties of TS2SLS under weak instruments

Coverage of 95% CI Bias of estimator Root mean squared


error of estimator
λ/k 1 4 16 1 4 16 1 4 16
(a): β = −2
k=1 0.767 0.833 0.806 −4.442 0.297 −0.160 180.971 31.051 0.834
k=5 0.358 0.610 0.715 0.889 0.288 0.076 1.058 0.508 0.249
k = 10 0.137 0.453 0.662 0.955 0.348 0.092 1.018 0.443 0.190
(b): β = 0
k=1 0.990 0.974 0.956 −0.427 −0.036 −0.001 37.121 3.567 0.128
k=5 0.961 0.954 0.947 0.002 0.002 0.001 0.168 0.097 0.050
k = 10 0.961 0.950 0.949 0.004 0.001 −0.000 0.109 0.067 0.035
(c): β = 2
k=1 0.788 0.840 0.819 3.588 −0.370 0.159 160.209 30.845 0.832
k=5 0.389 0.628 0.735 −0.885 −0.284 −0.074 1.065 0.517 0.251
k = 10 0.165 0.473 0.685 −0.947 −0.346 −0.093 1.018 0.443 0.193

note: Sample sizes are n1 = 5000 and n2 = 1000. Results are based on 5,000 simulation
repetitions. The coverage results of the 95% Inoue and Solon (2010) CIs are also reported in
Choi, Gu, and Shen (2018).

3 Weak-instrument robust methods


In the following, we introduce the weak-instrument robust inference method discussed
in Choi, Gu, and Shen (2018). There are two versions of the method. A benchmark
strategy uses the same set of assumptions as Angrist and Krueger (1992, 1995) and
Inoue and Solon (2010), except for allowing for potentially weak instruments. The
benchmark strategy requires both homoskedasticity and equal moments of excluded
instruments and exogenous regressors across the two data samples. In contrast, a fully
robust strategy is also considered that makes the two-sample IV inference robust to
weak instruments as well as heteroskedasticity and unequal moments. In empirical ap-
584 Two-sample weak IV

plications, researchers might want to adopt the fully robust method for its generality
and the benchmark method for a direct comparison with the classic Inoue and Solon
(2010) results. Starting from this section, we follow the weak inference literature and
assume, without loss of generality, that Z′j Xj = 0 for both j = 1, 2. The orthogonality
assumption is without loss of generality because one can always define new excluded
instruments as residuals from the regression of original instruments on exogenous re-
gressors.
Consider the weak IV asymptotic where the first-stage parameter π is a local se-
quence converging to zero:

π = C/ n1 for some nonstochastic k-vector C (1)
Under this asymptotic, the TS2SLS estimator is no longer consistent. In practice, re-
searchers will consider adopting weak-instrument robust inference methods when the
instruments are expected to have weak correlations with the endogenous regressor or
when the sample size is small.

3.1 Benchmark weak-instrument robust tests and confidence sets


Let Y1 = [y1 w b 1 ], a = [β 1]′ , η = [γ ψ], and V1 = [u1 v1 ], where γ = γ 1 + ψβ,
u1 = ǫ1 + βε1 , and v1 = Z1 (b π − π) + X1 (ψb − ψ). The simultaneous equation model
described in the last section could be rewritten as
Y1 = Z1 πa′ + X1 η + V1
In this section, we follow Inoue and Solon (2010) and assume homoskedasticity and
equal moments of [Zj Xj ] for j = 1, 2. Let σu2 1 = E(u21i |Z1i , X1i ), σε22 = E(ε22i |Z2i , X2i ),
and ΣZZ be the probability limit of both Z′1 Z1 /n1 and Z′2 Z2 /n2 .
Consider the two-sided null hypothesis H0 : β = β0 with some predetermined signif-
icance level α. Let b0 = [1 − β0 ]′ , a0 = [β0 1]′ . Define statistics
 1/2
b n = (Z′ Z1 )−1/2 Z′ Y1 b0 / b′ Ωb
S b 0
1 1 0
 1/2
b n = (Z′ Z1 )−1/2 Z′ Y1 Ω
T b −1 a0 / a′ Ω b −1 a0
1 1 0
!
QbS Q b ST
b b ′ b b b ′ b b
QS = Sn Sn , QT = Tn Tn , QST = Sn Tn , Q = b ′ b b
b ST Q
Q bT
 2 
b bu1
σ 0
where Ω = bu2 1 and σ
. σ bε22 are defined in section 2.
0 σ bε22 n1 /n2 .
Further define test statistics
b S , T2 (β0 ) = Q
T1 (β0 ) = Q b 2 /QbT
ST
"  #
1 b 2  1/2
T3 (β0 ) = QS − QbT + bS + Q
Q bT − 4 QbS Q
bT − Q
b ST
2
2
J. Choi and S. Shen 585

Under the weak IV asymptotic in (1) and when the null condition β = β0 holds, one can
show that in the limit, T1 (β0 ) follows a χ2 (k) distribution and T2 (β0 ) follows a χ2 (1)
distribution. When k = 1, both T2 (β0 ) and T3 (β0 ) reduce to T1 (β0 ). When k ≥ 2, the
limiting probability of T3 (β0 ) exceeding m is
Z 1  
qT + m (k−3)/2
p(m; qT ) = 1 − 2K P χ2k < 1 − s22 ds2
0 1 + qT s22 /m

under the null, where K = Γ(k/2)/[π 1/2 Γ{(k − 1)/2}] and χ2k is a random variable
following a χ2 distribution with k degrees of freedom (Andrews, Moreira, and Stock
2007).
Let q1−α (k) be the (1 − α) quantile of the χ2 (k) distribution. Define the decision
rules of the three statistics as “reject the null if T1 (β0 ) > q1−α (k)”, “reject the null if
T2 (β0 ) > q1−α (1)”, and “reject the null if T3 (β0 ) > q1−α (1) when k = 1, and reject the
b T ) < α when k ≥ 2”, respectively. All three tests have asymptotic
null if p(T3 (β0 ); Q
size control under the weak IV asymptotic. When the null is violated, all three tests
have nontrivial power dependent on the value of C when the first stage π satisfies (1).
When the instruments are strong, all three tests have power approaching 1.
We call the test based on T1 (β0 ) the two-stage Anderson–Rubin (TSAR) test, the
one based on T2 (β0 ) the two-stage Kleibergen (TSK) test, and the one based on T3 (β0 )
the two-stage conditional likelihood-ratio (TSCLR) test. Note that when k = 1, all three
tests give identical results. When k ≥ 2, TSCLR generally has better power performances
than the other two methods, but there are also some DGPs where TSAR can outperform.
See Choi, Gu, and Shen (2018) for details.
Given the proposed tests, the (1 − α) × 100% confidence sets for β can be obtained
by inverting the corresponding tests. Define

CI 1 (α) = {β0 : T1 (β0 ) ≤ q1−α (k)}, CI 2 (α) = {β0 : T2 (β0 ) ≤ q1−α (1)}
n   o
CI 3 (α) = β0 : p T3 (β0 ); Q b T (β0 ) ≥ α

The confidence sets have correct coverage in the limit because they are inverted from
asymptotically valid tests under the weak IV asymptotics. When the instruments
are weak, the confidence sets could be unbounded, which is an essential property for
confidence sets to have correct coverage with arbitrarily weak instruments (Dufour
1997). The benchmark confidence sets are computed analytically following the fast-
computation method proposed by Mikusheva and Poi (2006) for the classic (one-sample)
Anderson–Rubin, K, and conditional likelihood-ratio confidence sets.
Like the classic K test, the TSK test also has an irregular nonmonotonic power curve
when k ≥ 2, resulting in power loss with some DGPs. For confidence sets, TSK can take
the form of a union of two finite intervals, that is, [x1 , x2 ] ∪ [x3 , x4 ], while TSAR and
TSCLR confidence sets, conditional on boundedness, take only the usual form of a finite
interval, or [x1 , x2 ]. Therefore, as with the classic one-sample case (see, for example,
Mikusheva and Poi [2006]), the TSK method is generally not recommended in practice.
586 Two-sample weak IV

Table 2 is taken from panels A and B of table 1 in Choi, Gu, and Shen (2018).
It uses the same DGP as the one discussed in section 2. Compared with the TS2SLS
results reported in table 1, the proposed TSAR, TSCLR, and TSK confidence sets have
targeted coverage rates regardless of instrument strength. Panel B of table 2 provides a
rough idea about how often the proposed weak-instrument robust confidence sets could
be unbounded given various instrument strengths. The panel also shows good power
performance of TSCLR and irregular power performance of TSK under some DGPs.

Table 2. Properties of benchmark weak-instrument robust confidence sets

TSAR TSCLR TSK


λ/k 1 4 16 1 4 16 1 4 16
Panel A: coverage of 95% confidence sets
(a): β = −2
k=1 0.947 0.955 0.947 0.947 0.955 0.947 0.947 0.955 0.947
k=5 0.951 0.950 0.952 0.958 0.950 0.954 0.957 0.949 0.954
k = 10 0.948 0.944 0.943 0.946 0.944 0.950 0.947 0.945 0.950
(b): β = 0
k=1 0.947 0.946 0.948 0.947 0.946 0.948 0.947 0.946 0.948
k=5 0.947 0.955 0.952 0.950 0.949 0.946 0.953 0.950 0.946
k = 10 0.948 0.945 0.949 0.954 0.948 0.949 0.957 0.948 0.948
(c): β = 2
k=1 0.946 0.951 0.950 0.946 0.951 0.950 0.946 0.951 0.950
k=5 0.951 0.948 0.950 0.959 0.951 0.954 0.960 0.950 0.953
k = 10 0.952 0.945 0.944 0.949 0.949 0.946 0.949 0.949 0.946
Panel B: number of bounded 95% confidence sets among 5,000 simulations
(a): β = −2
k=1 854 2,648 4,901 854 2,648 4,901 854 2,648 4,901
k=5 1,730 4,635 4,872 2,670 4,963 5,000 2,649 4,964 5,000
k = 10 2,525 4,818 4,811 4,075 5,000 5,000 4,032 5,000 5,000
(b): β = 0
k=1 854 2,648 4,901 854 2,648 4,901 854 2,648 4,901
k=5 1,804 4,682 4,874 1,732 4,712 5,000 843 2,116 3,419
k = 10 2,633 4,849 4,838 2,500 4,983 5,000 857 2,025 3,275
(c): β = 2
k=1 854 2,648 4,901 854 2,648 4,901 854 2,648 4,901
k=5 1,734 4,639 4,879 2,667 4,960 5,000 2,629 4,962 5,000
k = 10 2,546 4,816 4,812 4,066 4,999 5,000 4,014 4,999 5,000
note: Sample sizes are n1 = 5000 and n2 = 1000. Results are based on 5,000 simulation
repetitions.
J. Choi and S. Shen 587

3.2 Fully robust tests and confidence sets


This section relaxes the assumptions of homoskedasticity and equal moments of excluded
instruments and exogenous regressors. Let Σz,u1 and Σz,ε2 be probability limits of
√ √
V (Z′1 u1 / n1 ) and V (Z′2 ε2 / n2 ), respectively, and let Σl,ZZ be the probability limit

of Zl Zl /nl for l = 1, 2. Replace the first equation in the two-sample IV regression model
with its reduced form y1 = Z1 ζ + X1 γ + u1 . Let δ = [ζ π]′ . We know that

r(δ, β) = ζ − πβ = 0

Let ζb = (Z′1 Z1 )−1 Z′1 y1 , π b = [ζ


b = (Z′2 Z2 )−1 Z′2 w2 and δ b π
b ]′ . It is easy to see that,
for any β0 ,
√ n b  o
n1 r δ, β0 − r (δ, β0 ) ⇒ N (0, Σβ0 )

where Σβ0 = Σ−1 −1 2 −1 −1


1,ZZ Σz,u1 Σ1,ZZ + τ β0 Σ2,ZZ Σz,ε2 Σ2,ZZ is a k × k variance–covariance
 ′
b ζ,β = {n2 /(n1 − k − p)}(Z′ Z1 )−1 Pn1 u 2 ′ −1
matrix. Let Σ 1 1
 i=1 b1i Z1i Z1i (Z1 Z1 ) and let
b 2
0
′ −1
P n2 2 ′ ′ −1
Σπ,β0 = {n2 /(n2 − k − p)}(Z2 Z2 ) b
ε
i=1 2i Z 2i Z 2i (Z 2 Z 2 ) , where b
u 1i is the ith en-
try of M[Z1 :X1 ] y1 and εb2i is the ith entry of M[Z2 :X2 ] w2 . Then Σβ0 could be consistently
estimated by Σ bβ = Σ b ζ,β + (n1 /n2 )β 2 Σb
0 0 0 π,β0 .

Following Magnusson (2010), the robust TSAR, TSK, and TSCLR test statistics for
H0 : β = β0 can be written as
 ′ −1  
T1,robust (β0 ) = n1 ζb − π b β0 Σb b b β0
β0 ζ − π
  ′   
T2,robust (β0 ) = n1 Σ b −1/2 ζ b−πb β 0 P b
Σ
−1/2
b
ζ − b
π β 0
β0 Σb −1/2 b
D β0
β0
β0

1h n
2
T3,robust (β0 ) = T1,robust − qbβ0 + (T1,robust + qbβ0 )
2
o1/2 i
− 4 (T1,robust qbβ0 − T2,robust qbβ0 )

where −D bβ = π b π,β Σ
b + (n1 /n2 )β0 Σ b −1 (ζ
b−π b ′ {(n1 /n2 )Σ
b β0 ) and qbβ0 = n1 D b π,β −
0 0 β0 β0 0
−1
b π,β Σ
(n1 /n2 )2 β 2 Σ b Σ b π,β }−1 D
b β . When the robust variance–covariance matrix Σ bβ
0 0 β0 0 0 0

is replaced with Σβ0 = σ bu2 1 {(Z′1 Z1 )/n1 }−1 + (n1 /n2 )β02 {(Z′1 Z1 )/n1 }−1 σ
bǫ22 , the three
robust test statistics reduce to the benchmark counterparts.
Under the null hypothesis, T1,robust (β0 ) and T2,robust (β0 ) have limiting distributions
χ2 (k) and χ2 (1), respectively, and T3,robust (β0 ) ⇒ (1/2)(χ2 (1)+χ2 (k−1)−qβ0 +[{χ2 (1)+
χ2 (k − 1) + qβ0 }2 − 4χ2 (k − 1)qβ0 ]1/2 ), where χ2 (1) and χ2 (k − 1) are independent chi-
squared distributed random variables with 1 and k − 1 degrees of freedom, respectively,
given that qbβ0 = qβ0 . Therefore, we reject the null if T1,robust (β0 ) is larger than q1−α (k),
if T2,robust (β0 ) is larger than q1−α (1), or if p(T3,robust (β0 ); qbβ0 ) is smaller than α, where
p(.; .) is defined in section 3.1.
588 Two-sample weak IV

As with the benchmark case, one can construct robust TSAR, TSK, and TSCLR con-
fidence sets of β by inverting the robust TSAR, TSK, and TSCLR tests. In the pro-
posed command, these fully robust confidence sets are computed using a grid search.
Specifically, we wrote our grid search codes based on the ivtest command developed
by Finlay and Magnusson (2009). We omitted simulation results for the robust TSAR,
TSK, and TSCLR tests and confidence sets. Interested readers can refer to the simulation
section in Choi, Gu, and Shen (2018) for details. Like the benchmark case, the robust
TSAR, TSK, and TSCLR methods have good size and coverage properties regardless of
the strength of instruments.

4 Implementation
By default, the weaktsiv command generates two output tables. The first table reports
TS2SLS estimates together with Inoue and Solon (2010) standard errors. The second ta-
ble calculates the benchmark TSAR, TSK, and TSCLR tests and confidence sets discussed
in section 3.1. If the robust option is used, the weaktsiv command provides TS2SLS
estimates together with Pacini and Windmeijer (2016) standard errors, as well as the
robust TSAR, TSK, and TSCLR tests and confidence sets discussed in section 3.2.
The two-sample IV regression model requires the use of two data samples. weaktsiv
distinguishes the two samples based on missing values of outcome and endogenous vari-
ables. If the dataset has nonmissing values in both outcome and endogenous variables,
weaktsiv drops these observations.

4.1 Syntax
    
weaktsiv depvar varlist exog (varlist endog = varlist iv) if in , nocons

robust level(#) test(#) points(#) grid(#(#)#)

depvar is the outcome variable.


varlist exog is the list of exogenous variables.
varlist endog is the endogenous regressor of the model.
varlist iv is the list of exogenous variables used together with varlist exog as instruments
for varlist endog.
J. Choi and S. Shen 589

4.2 Options
nocons suppresses the constant term in the regression model.
robust provides versions of two-sample weak IV robust tests that are also robust to
heteroskedasticity and unequal moments of excluded instruments and exogenous
regressors across the two data samples. robust also reports Pacini and Windmeijer’s
(2016) robust standard error following the TS2SLS estimation.
level(#) sets the confidence level. The default is level(95).
test(#) sets the hypothesized value of the endogenous variable’s coefficient. The
default is test(0).
points(#) specifies the number of points used to create the grid for confidence region
calculation. points() may be used together only with the robust option and cannot
be used together with the grid() option. The default is points(100).
grid(#(#)#) specifies the grid used for confidence region calculation. grid() may be
used together only with the robust option because the benchmark confidence regions
are calculated analytically. The default uses the TS2SLS estimator plus or minus two
times the Pacini and Windmeijer (2016) standard error and 100 grid points.

4.3 Stored results


weaktsiv stores the following in e():
Scalars
e(p TSAR) TSAR test p-value
e(p TSK) TSK test p-value
e(p TSCLR) TSCLR test p-value
e(TSAR xi) endpoints of benchmark TSAR confidence sets
e(TSK xi) endpoints of benchmark TSK confidence sets
e(TSCLR xi) endpoints of benchmark TSCLR confidence sets
e(level) confidence level for weak IV robust inference
e(H0 b) value of β under null for weak IV robust inference
e(n1) # of observations in sample 1 (the outcome sample)
e(n2) # of observations in sample 2 (the endogenous variable sample)
e(chi2) TS2SLS Wald statistic
e(F first) TS2SLS first-stage F
e(numinst) number of instruments
e(df r first) TS2SLS first-stage residual degrees of freedom
e(df m) TS2SLS model degrees of freedom
e(df r) TS2SLS residual degrees of freedom
e(r2) R2
e(r2 a) adjusted R2
e(mss) TS2SLS model sum of squares
e(rss) TS2SLS residual sum of squares
e(rmse) TS2SLS root mean squared errors
e(points) # of grid points for robust confidence sets
590 Two-sample weak IV

Macros
e(cmd) weaktsiv
e(depvar) name of dependent variable
e(robust) whether the robust option is specified
e(TSAR type) type of benchmark TSAR confidence set
e(TSK type) type of benchmark TSK confidence set
e(TSCLR type) type of benchmark TSCLR confidence set
e(TSAR cset) robust TSAR confidence set
e(TSK cset) robust TSK confidence set
e(TSCLR cset) robust TSCLR confidence set
e(grid) grid range for robust confidence set
e(cons) whether constants are used
e(instd) instrumented variable
e(insts) instruments
e(exog) exogenous variables
Matrices
e(b) coefficient vector
e(V) variance–covariance matrix of the estimators
Functions
e(sample) marks estimation sample

For the benchmark methods, the stored type (that is, e(TSAR type), e(TSK type),
and e(TSCLR type)) and endpoints (that is, e(TSAR xi), e(TSK xi), and e(TSCLR xi))
can be used together to retrieve the exact confidence sets using the relationship in
table 3.

Table 3. Benchmark TSCLR, TSAR, TSK confidence sets, analytical solution

Test Result type Interval


TSCLR 1 Empty set
2 [x1, x2]
3 (−∞, ∞)
4 (−∞, x1] ∪ [x2, ∞)
TSAR 1 Empty set
2 [x1, x2]
3 (−∞, ∞)
4 (−∞, x1] ∪ [x2, ∞)
TSK 1 Not used (not possible)
2 [x1, x2]
3 (−∞, +∞)
4 (−∞, x1] ∪ [x2, ∞)
5 (−∞, x1] ∪ [x2, x3] ∪ [x4, ∞)
6 [x1, x2] ∪ [x3, x4]
J. Choi and S. Shen 591

5 Example
5.1 The case with just-identification
We use the dataset of Currie and Yelowitz (2000) to illustrate implementing the com-
mand weaktsiv in the case of just-identification. The example estimates the effects
of public housing on monthly rental payments in equations (2) and (3) of Currie and
Yelowitz (2000). The outcome variable is household monthly rental payments (ry1).
The endogenous regressor is a dummy variable indicating whether a household partic-
ipates in the public housing project (ry2). The excluded instrument is the sex com-
position of children, a dummy variable equaling one if the family has a boy and a girl
(z). The exogenous regressors include information on the household head’s age and
its square, marital status, sex, race, education level, metropolitan statistical area-level
controls for public housing supply, and children’s sex.
The default weaktsiv command gives a table reporting the TS2SLS estimation re-
sults together with Inoue and Solon (2010) standard errors and another table reporting
benchmark TSCLR results. Only TSCLR is reported here because TSAR, TSK, and TSCLR
are equivalent when the model is just-identified.
For the effects of public housing on monthly rental payments, the CI based on
Inoue and Solon (2010) standard errors is [0.151, 0.592]. The weak-instrument robust CI
is [0.214, 0.784], which is wider than the nonrobust one. The TSCLR CI is also centered
farther away from zero than the TS2SLS CI likely because TS2SLS suffers from an atten-
uation bias and is biased toward zero. These CI results are also reported in column 1 of
table 3 in Choi, Gu, and Shen (2018). The TSCLR CI reported here is slightly different
from the one reported in Choi, Gu, and Shen (2018) because of different rounding meth-
ods in the two articles. R codes for the empirical applications in Choi, Gu, and Shen
(2018) kept three significant digits after the decimal point for benchmark weak-IV robust
confidence sets and two significant digits the fully robust confidence sets.
592 Two-sample weak IV

. use sample1.dta
. weaktsiv ry1 h* p* b* (ry2=z)
Two-sample Instrumental variables (TS2SLS) regression
First-stage F Results Number of obs = 116901
Wald chi2(17) = 5611.78
F( 1, 10364) = 15.03 Prob > chi2 = 0.0000
Prob > F = 0.0001 R-squared = 0.1489
Adj R-squared = 0.1488
Root MSE = 0.2205

ry1 Coef. Std. Err. t P>|t| [95% Conf. Interval]

ry2 .3716513 .1123615 3.31 0.001 .1514244 .5918781


hdage .0192549 .0015888 12.12 0.000 .016141 .0223689
hdage2 -.0198632 .0020119 -9.87 0.000 -.0238065 -.0159198
hdmarr .0198959 .0062194 3.20 0.001 .007706 .0320859
hdfemale -.0976462 .0107003 -9.13 0.000 -.1186186 -.0766738
hdblack -.1211384 .0133036 -9.11 0.000 -.1472133 -.0950634
hdother -.0163956 .00506 -3.24 0.001 -.0263131 -.0064781
hdhisp .0005148 .0040625 0.13 0.899 -.0074478 .0084773
hded0911 .0336821 .0052502 6.42 0.000 .0233919 .0439723
hded1212 .0768111 .0054963 13.97 0.000 .0660384 .0875838
hded1315 .1345398 .0068719 19.58 0.000 .1210711 .1480085
hded16p .20465 .0078281 26.14 0.000 .1893071 .2199928
pctlihtc -.7054565 .1697396 -4.16 0.000 -1.038143 -.3727696
pctprj -.8651579 .1218703 -7.10 0.000 -1.104022 -.6262939
pctrehab -1.026055 .160297 -6.40 0.000 -1.340235 -.7118757
pctvch -2.920268 .5245491 -5.57 0.000 -3.948376 -1.89216
boys -.004395 .0019092 -2.30 0.021 -.008137 -.0006529
_cons .1192835 .0300903 3.96 0.000 .060307 .17826

Instrumented: ry2
Instruments: z
Confidence set and p-value for ry2 are based on normal approximation,
thus not robust to weak instruments.

Weak IV Robust 95% confidence set and p-value


for H0: _b[ry2] = 0

Test 95% Confidence Set p-value

Benchmark TSCLR [ .2137159, .7837229] 0.0000

Note: In the just identifed case, TSCLR = TSAR = TSK.

We emphasize that both CIs reported by the default command require the assump-
tions of homoskedasticity and equal moments. Next, we illustrate the use of the robust
option. With this option, the weaktsiv command reports inference results that are
robust to both heteroskedasticity and unequal moments of excluded instruments and
exogenous regressors. The TS2SLS output table now reports Pacini and Windmeijer
(2016) standard errors. The weak IV robust output table reports results from the fully
robust version of TSAR, TSK, and TSCLR. Again, in this example, only TSCLR is reported
because of just-identification. The robust TSCLR CI is also [0.214, 0.784].
J. Choi and S. Shen 593

. weaktsiv ry1 h* p* b* (ry2=z), robust grid(0(0.001)1)


Two-sample Instrumental variables (TS2SLS) regression
Number of obs = 116901
Wald chi2(17) = 4838.19
Prob > chi2 = 0.0000
R-squared = 0.1489
Root MSE = 0.2205

ry1 Coef. Std. Err. t P>|t| [95% Conf. Interval]

ry2 .3716513 .1111589 3.34 0.001 .1537816 .5895209


hdage .0192549 .0016301 11.81 0.000 .0160599 .02245
hdage2 -.0198632 .0020866 -9.52 0.000 -.0239529 -.0157735
hdmarr .0198959 .0053553 3.72 0.000 .0093997 .0303921
hdfemale -.0976462 .0103521 -9.43 0.000 -.1179361 -.0773562
hdblack -.1211384 .0132088 -9.17 0.000 -.1470274 -.0952493
hdother -.0163956 .0056157 -2.92 0.004 -.0274023 -.0053889
hdhisp .0005148 .0033995 0.15 0.880 -.0061483 .0071778
hded0911 .0336821 .0050553 6.66 0.000 .0237737 .0435905
hded1212 .0768111 .0049421 15.54 0.000 .0671248 .0864975
hded1315 .1345398 .0064849 20.75 0.000 .1218295 .1472501
hded16p .20465 .0071545 28.60 0.000 .1906273 .2186727
pctlihtc -.7054565 .1903181 -3.71 0.000 -1.078477 -.332436
pctprj -.8651579 .1222525 -7.08 0.000 -1.104771 -.625545
pctrehab -1.026055 .1683943 -6.09 0.000 -1.356105 -.696005
pctvch -2.920268 .5080081 -5.75 0.000 -3.915956 -1.92458
boys -.004395 .0018605 -2.36 0.018 -.0080415 -.0007485
_cons .1192835 .0304138 3.92 0.000 .0596729 .178894

Instrumented: ry2
Instruments: z
Confidence set and p-value for ry2 are based on normal approximation,
thus not robust to weak instruments.

Weak IV Robust 95% confidence set and p-value


for H0: _b[ry2] = 0

Test 95% Confidence Set p-value

Robust TSCLR [ .214, .784] 0.0000

Note: In the just identifed case, TSCLR = TSAR = TSK.


Confidence sets estimated for 1001 points in [0,1].

5.2 The case with overidentification


Now we illustrate the weaktsiv command in the case of overidentification. We use
the dataset of Olivetti and Paserman (2015), who examine historical intergenerational
income elasticity in the United States. We consider the specification in column 1, row 5,
in table 3 of Olivetti and Paserman (2015) for father–son-in-law elasticity in 1950–1970.
The outcome variable of interest is a son-in-law’s log earnings (ry1). The endogenous
regressor is a father’s log earnings (ry2). The excluded instruments are dummy variables
for a daughters’ first name (z1–z726). There are no exogenous regressors in the model
except for the intercepts.
594 Two-sample weak IV

The following outputs are from the default setting of the weaktsiv command, which
reports TS2SLS estimates with Inoue and Solon (2010) standard errors as well as bench-
mark TSAR, TSK, and TSCLR tests and confidence sets. The results are also reported in
column 1, row 5, in table 2 of Choi, Gu, and Shen (2018). The Inoue and Solon (2010)
CI is [0.307, 0.401], while the benchmark TSCLR CI is [0.571, 0.731]. Again, the TSCLR CI
lies above the TS2SLS CI likely because of the large attenuation bias of TS2SLS: TS2SLS
has only a first-stage F statistic equal to 1.98.

. use sample2.dta
. weaktsiv ry1 (ry2=z*), level(90)
note: z726 omitted because of collinearity
Two-sample Instrumental variables (TS2SLS) regression
First-stage F Results Number of obs = 16650
Wald chi2(1) = 153.60
F(726, 18771) = 1.98 Prob > chi2 = 0.0000
Prob > F = 0.0000 R-squared = 0.0098
Adj R-squared = 0.0097
Root MSE = 0.4317

ry1 Coef. Std. Err. t P>|t| [90% Conf. Interval]

ry2 .354363 .0285928 12.39 0.000 .3073294 .4013965


_cons 1.92788 .0830654 23.21 0.000 1.791242 2.064518

Instrumented: ry2
Instruments: z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18
(output omitted )
z723 z724 z725 z726
Confidence set and p-value for ry2 are based on normal approximation,
thus not robust to weak instruments.

Weak IV Robust 90% confidence sets and p-values


for H0: _b[ry2] = 0

Test 90% Confidence Set p-value

Benchmark TSCLR [ .5706445, .7306929] 0.0000


Benchmark TSAR empty 0.0000
Benchmark TSK [-2.803132, -2.362719] U [ .5633191, .7388234] 0.0000

As discussed in Choi, Gu, and Shen (2018), the empirical example of Olivetti and
Paserman (2015) is not suitable for heteroskedasticity-robust inference because their
regression specifications result in perfect fit for a number of observations in either the
first-stage or the reduced-form regressions. Therefore, heteroskedasticity-robust infer-
ence cannot be carried out for either TS2SLS or the proposed weak-instrument robust
methods. To illustrate the use of our robust option in models with overidentifica-
tion, we turn back to the Currie and Yelowitz (2000) example discussed in section 5.1.
We randomly generate a normally distributed instrument and use it as the second in-
strument (z2). This overidentified model generates results close to those reported in
J. Choi and S. Shen 595

section 5.1 for TS2SLS as well as robust TSCLR and TSK. Robust TSAR CI is a little wider
in length because TSAR is generally inefficient when the number of instruments exceeds
the number of endogenous regressors.

. use sample1.dta
. set seed 12345
. generate z2 = rnormal()
. weaktsiv ry1 h* p* b* (ry2=z z2), robust grid(0(0.001)1)
Two-sample Instrumental variables (TS2SLS) regression
Number of obs = 116901
Wald chi2(17) = 5064.72
Prob > chi2 = 0.0000
R-squared = 0.1489
Root MSE = 0.2206

ry1 Coef. Std. Err. t P>|t| [95% Conf. Interval]

ry2 .3596925 .1059215 3.40 0.001 .1520881 .5672969


hdage .019132 .0015721 12.17 0.000 .0160506 .0222134
hdage2 -.0197176 .0020157 -9.78 0.000 -.0236685 -.0157668
hdmarr .0196077 .0052261 3.75 0.000 .0093647 .0298508
hdfemale -.09669 .0099068 -9.76 0.000 -.1161072 -.0772728
hdblack -.119754 .0125937 -9.51 0.000 -.1444374 -.0950707
hdother -.0160799 .0054359 -2.96 0.003 -.0267342 -.0054257
hdhisp .0003739 .0033182 0.11 0.910 -.0061296 .0068774
hded0911 .0338316 .0049277 6.87 0.000 .0241733 .0434898
hded1212 .0765785 .0047991 15.96 0.000 .0671723 .0859847
hded1315 .1340538 .0062587 21.42 0.000 .1217868 .1463207
hded16p .2041276 .0069173 29.51 0.000 .1905697 .2176854
pctlihtc -.6924238 .1834473 -3.77 0.000 -1.051978 -.3328699
pctprj -.8568538 .1180531 -7.26 0.000 -1.088236 -.6254715
pctrehab -1.016239 .163189 -6.23 0.000 -1.336087 -.696391
pctvch -2.874294 .4874553 -5.90 0.000 -3.829699 -1.91889
boys -.0043023 .0018107 -2.38 0.018 -.0078513 -.0007533
_cons .1215828 .029348 4.14 0.000 .0640613 .1791043

Instrumented: ry2
Instruments: z z2
Confidence set and p-value for ry2 are based on normal approximation,
thus not robust to weak instruments.

Weak IV Robust 95% confidence set and p-value


for H0: _b[ry2] = 0

Test 95% Confidence Set p-value

Robust TSCLR [ .215, .738] 0.0000


Robust TSAR [ .187, .966] 0.0000
Robust TSK [ .216, .731] 0.0000

Confidence sets estimated for 1001 points in [0,1].


596 Two-sample weak IV

6 Programs and supplemental materials


To install a snapshot of the corresponding software files as they existed at the time of
publication of this article, type
. net sj 19-3
. net install st0568 (to install program files, if available)
. net get st0568 (to install ancillary files, if available)

7 References
Andrews, D. W. K., M. J. Moreira, and J. H. Stock. 2006. Optimal two-sided invariant
similar tests for instrumental variables regression. Econometrica 74: 715–752.
. 2007. Performance of conditional Wald tests in IV regression with weak instru-
ments. Journal of Econometrics 139: 116–132.
. 2008. Efficient two-sided nonsimilar invariant tests in IV regression with weak
instruments. Journal of Econometrics 146: 241–254.
Angrist, J. D., and A. B. Krueger. 1992. The effect of age at school entry on educational
attainment: An application of instrumental variables with moments from two samples.
Journal of the American Statistical Association 87: 328–336.
. 1995. Split-sample instrumental variables estimates of the return to schooling.
Journal of Business & Economic Statistics 13: 225–235.
Björklund, A., and M. Jäntti. 1997. Intergenerational income mobility in Sweden com-
pared to the United States. American Economic Review 87: 1009–1018.
Bound, J., D. A. Jaeger, and R. M. Baker. 1995. Problems with instrumental vari-
ables estimation when the correlation between the instruments and the endogeneous
explanatory variable is weak. Journal of the American Statistical Association 90:
443–450.
Brunner, E. J., S.-W. Cho, and R. Reback. 2012. Mobility, housing markets, and schools:
Estimating the effects of inter-district choice programs. Journal of Public Economics
96: 604–614.
Choi, J., J. Gu, and S. Shen. 2018. Weak-instrument robust inference for two-sample
instrumental variables regression. Journal of Applied Economics 33: 109–125.
Currie, J., and A. Yelowitz. 2000. Are public housing projects good for kids? Journal
of Public Economics 75: 99–124.
Dufour, J.-M. 1997. Some impossibility theorems in econometrics with applications to
structural and dynamic models. Econometrica 65: 1365–1387.
Dufour, J.-M., and J. Jasiak. 2001. Finite sample limited information inference methods
for structural equations and models with generated regressors. International Economic
Review 42: 815–844.
J. Choi and S. Shen 597

Feldman, N. E. 2010. Mental accounting effects of income tax shifting. Review of


Economics and Statistics 92: 70–86.

Finlay, K., and L. M. Magnusson. 2009. Implementing weak-instrument robust tests for
a general class of instrumental-variables models. Stata Journal 9: 398–421.

Inoue, A., and G. Solon. 2010. Two-sample instrumental variables estimators. Review
of Economics and Statistics 92: 557–561.

Kleibergen, F. 2002. Pivotal statistics for testing structural parameters in instrumental


variables regression. Econometrica 70: 1781–1803.

Magnusson, L. M. 2010. Inference in limited dependent variable models robust to weak


identification. Econometrics Journal 13: S56–S79.

Miguel, E. 2005. Poverty and witch killing. Review of Economic Studies 72: 1153–1172.

Mikusheva, A., and B. P. Poi. 2006. Tests and confidence sets with correct size when
instruments are potentially weak. Stata Journal 6: 335–347.

Moreira, M. J. 2003. A conditional likelihood ratio test for structural models. Econo-
metrica 71: 1027–1048.

. 2009. Tests with correct size when instruments can be arbitrarily weak. Journal
of Econometrics 152: 131–140.
Olivetti, C., and M. D. Paserman. 2015. In the name of the son (and the daughter): In-
tergenerational mobility in the United States, 1850–1940. American Economic Review
105: 2695–2724.

Pacini, D., and F. Windmeijer. 2016. Robust inference for the two-sample 2SLS estima-
tor. Economics Letters 146: 50–54.

Siminski, P. 2013. Employment effects of army service and veterans’ compensation: Ev-
idence from the Australian Vietnam-era conscription lotteries. Review of Economics
and Statistics 95: 87–97.

Staiger, D., and J. H. Stock. 1997. Instrumental variables regression with weak instru-
ments. Econometrica 65: 557–586.

About the authors


Jaerim Choi is an assistant professor in the Department of Economics at the University of
Hawaii at Manoa.
Shu Shen is an associate professor in the Department of Economics at the University of Cali-
fornia, Davis.

You might also like