mbygzh 发表于 2016-8-12 20:09 
谢谢您的解答!但是不知道为什么我用xtivreg y x1 (x2=z),fe 这个命令 结果中没有z的系数
建议你先弄明白工具变量法的含义,这个xtivreg默认的是2sls方法,见stata帮助文件xt:
xtivreg offers five different estimators for fitting panel-data models in which some of the right-
hand-side covariates are endogenous. These estimators are two-stage least-squares generalizations of
simple panel-data estimators for exogenous variables. xtivreg with the be option uses the two-
stage least-squares between estimator. xtivreg with the fe option uses the two-stage least-squares
within estimator. xtivreg with the re option uses a two-stage least-squares random-effects estimator.
There are two implementations: G2SLS from Balestra and Varadharajan-Krishnakumar (1987) and
EC2SLS from Baltagi. The Balestra and Varadharajan-Krishnakumar G2SLS is the default because it is
computationally less expensive. Baltagi’s EC2SLS can be obtained by specifying the ec2sls option.
xtivreg with the fd option requests the two-stage least-squares first-differenced estimator.
二阶段最小二乘法,第一阶段是用内生解释变量(你这里的X2)对工具变量回归(z),得到x2的拟合值,然后在第二阶段,用这个拟合值作为解释变量对模型进行回归的。一般默认的2sls只显示第二阶段的结果,不会显示z. 你如果想看z的系数,可以在后面加入 r first,即xtivreg y x1 (x2=z), fe r first. 但是其中z的系数反映的是x2=α+βz+ϵ的回归结果,这个系数与y无关