如果被怀疑内生的解释变量指的是binary endogenous regressors。
那么现成的指令为ssm 【您可以findit ssm】
您可以参考文献
The Stata Journal (2006) 6, Number 3, pp. 285–308
作者为Alfonso Miranda与Sophia Rabe-Hesketh
* Regress an unbounded, continuous variable on an instrumented, binary one. 2SLS is consistent but less
efficient.
. cmp (other_inc = fem_work) (fem_work = kids), ind($cmp_cont $cmp_probit) qui robust
. ivreg other_inc (fem_work = kids), robust
* Now regress it on a left-censored one, female income, which is only modeled for observations in which the
woman works.
. gen byte ind2 = cond(fem_work, cond(fem_inc, $cmp_cont, $cmp_left), $cmp_out)
. cmp (other_inc=fem_inc kids) (fem_inc=fem_edu), ind($cmp_cont ind2)