引言 本文中主题是内生性,它可能严重偏向回归估计。我将专门模拟由遗漏变量引起的内生性。在本系列的后续文章中,我将模拟其他规范问题,如异方差性,多重共线性和对撞机偏差。
数据生成过程
考虑一些结果变量的数据生成过程(DGP)![ÿ](https://s0.wp.com/latex.php?latex=Y+&bg=ffffff&fg=000000&s=0)
:
![Y = a + \ beta x + cz + \ epsilon_1](https://s0.wp.com/latex.php?latex=Y+%3D+a%2B%5Cbeta+x%2Bc+z+%2B+%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
![\ epsilon_1 \ sim N(0,\ sigma ^ {2})](https://s0.wp.com/latex.php?latex=%5Cepsilon_1+%5Csim+N%280%2C%5Csigma%5E%7B2%7D%29+&bg=ffffff&fg=000000&s=0)
对于该模拟,我设置参数值![一个](https://s0.wp.com/latex.php?latex=a+&bg=ffffff&fg=000000&s=0)
,![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
以及![C](https://s0.wp.com/latex.php?latex=c+&bg=ffffff&fg=000000&s=0)
与模拟正相关的独立变量,![X](https://s0.wp.com/latex.php?latex=x+&bg=ffffff&fg=000000&s=0)
和![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
(N = 500)。
1 2 3 4 五 6 7 8 9 | # simulation parameters set.seed (144); a=50; b=.5; c=.01; x= rnorm (n=ss,mean=1000,sd=50); z=d+h*x+ rnorm (ss,0,10) |
模拟
模拟将估计下面的两个模型。第一个模型是正确的,它包含实际DGP中的所有术语。但是,第二个模型省略了DGP中存在的变量。相反,变量被误入了误差项 ![\ epsilon_1](https://s0.wp.com/latex.php?latex=%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
。
![(1)\ thinspace Y = a + \ beta x + cz + \ epsilon_1](https://s0.wp.com/latex.php?latex=%281%29%5Cthinspace+Y+%3D+a%2B%5Cbeta+x%2Bc+z+%2B+%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
![(2)\ thinspace Y = a + \ beta x + \ epsilon_1](https://s0.wp.com/latex.php?latex=%282%29+%5Cthinspace+Y+%3D+a%2B%5Cbeta+x+%2B+%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
第二个模型将产生一个有偏差的估计![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
。差异也会有偏差。这是因为它![X](https://s0.wp.com/latex.php?latex=x+&bg=ffffff&fg=000000&s=0)
是内生的,这是一种说它与错误术语相关的奇特方式![\ epsilon_1](https://s0.wp.com/latex.php?latex=%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
。由于![心病(X,Z)> 0](https://s0.wp.com/latex.php?latex=cor%28x%2Cz%29%3E0+&bg=ffffff&fg=000000&s=0)
和![\ epsilon_1 = \ epsilon + cz](https://s0.wp.com/latex.php?latex=%5Cepsilon_1%3D%5Cepsilon+%2B+cz+&bg=ffffff&fg=000000&s=0)
,然后![心病(X,\ epsilon_1)> 0](https://s0.wp.com/latex.php?latex=cor%28x%2C%5Cepsilon_1%29%3E0+&bg=ffffff&fg=000000&s=0)
。为了说明这一点,我在下面进行了5000次迭代的模拟。对于每次迭代,我![ÿ](https://s0.wp.com/latex.php?latex=Y+&bg=ffffff&fg=000000&s=0)
使用DGP 构造结果变量。然后我运行回归估计![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
,首先是模型1,然后是模型2。
1 2 3 4 五 6 7 8 9 10 11 12 | sim= function (endog){ e= rnorm (n=ss,mean=0,sd=10) # Select data generation process if (endog== TRUE ){ fit lm (y~x) } else { fit= lm (y~x+z)} return (fit$coefficients) } sim_results_endog= t ( replicate (trials, sim (endog= TRUE ))) |
仿真结果该仿真产生两种不同的采样分布![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
。请注意,我已将true值设置为![\的β= 0.5](https://s0.wp.com/latex.php?latex=%5Cbeta%3D.5+&bg=ffffff&fg=000000&s=0)
。如果![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
不省略,则模拟产生绿色采样分布,以真实值为中心。所有模拟的平均值为0.4998。当![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
被省略,仿真得到的红色采样分布,围绕0.5895居中。它偏离.5895的真实值。此外,偏差采样分布的方差远小于周围的真实方差![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
。这会影响对真实参数执行任何有意义推断的能力。
![](https://img-blog.csdnimg.cn/20190422170600867.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzE5NjAwMjkx,size_16,color_FFFFFF,t_70)
![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
可以通过分析得出。考虑在模型1中(如上所述),![X](https://s0.wp.com/latex.php?latex=x+&bg=ffffff&fg=000000&s=0)
并 ![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
通过以下方式相关:
![(3)\ thinspace z = d + hx + \ epsilon_2](https://s0.wp.com/latex.php?latex=%283%29%5Cthinspace+z+%3D+d%2Bhx%2B%5Cepsilon_2+&bg=ffffff&fg=000000&s=0)
![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
用等式3 代入等式1并重新排序:
![Y = a + \ beta x + c(d + hx + \ epsilon_2)+ \ epsilon_1](https://s0.wp.com/latex.php?latex=Y+%3D+a%2B%5Cbeta+x%2Bc+%28d%2Bhx%2B%5Cepsilon_2%29+%2B+%5Cepsilon_1+&bg=ffffff&fg=000000&s=0)
![(4)\ thinspace Y =(a + cd)+(\ beta + ch)x +(\ epsilon_1 + c \ epsilon_2)](https://s0.wp.com/latex.php?latex=%284%29%5Cthinspace+Y+%3D+%28a%2Bcd%29%2B%28%5Cbeta%2Bch%29+x+%2B+%28%5Cepsilon_1%2Bc%5Cepsilon_2%29+&bg=ffffff&fg=000000&s=0)
省略变量时![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
,实际上是估计的等式4。可以看出,![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
数量有偏差![CH](https://s0.wp.com/latex.php?latex=ch+&bg=ffffff&fg=000000&s=0)
。在这种情况下,由于![X](https://s0.wp.com/latex.php?latex=x+&bg=ffffff&fg=000000&s=0)
并且![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
通过构造正相关并且它们的斜率系数是正的,所以偏差将是正的。根据模拟的参数,应该是“真实的”偏差 ![CH = 0.09](https://s0.wp.com/latex.php?latex=ch%3D.09&bg=ffffff&fg=000000&s=0)
。这是偏差的分布,它以.0895为中心,非常接近真实的偏差值。
![](https://img-blog.csdnimg.cn/20190422170614971.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzE5NjAwMjkx,size_16,color_FFFFFF,t_70)
上述推导还可以让我们确定从知道的相关偏差的方向![X](https://s0.wp.com/latex.php?latex=x+&bg=ffffff&fg=000000&s=0)
和![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
以及的符号![C](https://s0.wp.com/latex.php?latex=c+&bg=ffffff&fg=000000&s=0)
(的真局部效果![ž](https://s0.wp.com/latex.php?latex=z+&bg=ffffff&fg=000000&s=0)
上![ÿ](https://s0.wp.com/latex.php?latex=y+&bg=ffffff&fg=000000&s=0)
)。如果两者都是相同的符号,那么估计值![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
会有偏见。如果符号不同,则估计值![\公测](https://s0.wp.com/latex.php?latex=%5Cbeta+&bg=ffffff&fg=000000&s=0)
将向下偏移。结论上面的案例很一般,但有特殊的应用。例如,如果我们认为个人的收入是教育年限和工作年经验的函数,那么省略一个变量将偏向另一个变量的斜率估计。
还有问题吗?联系我们!
-中国专业的第三方数据服务提供商,提供定制化的一站式数据挖掘和统计分析咨询服务
统计分析和数据挖掘咨询服务:(咨询服务请联系)
QQ:3025393450
![](https://img-blog.csdnimg.cn/2019031315051532.png)
【服务场景】
科研项目; 公司项目外包;线上线下一对一培训;数据采集;学术研究;报告撰写;市场调查。
【大数据部落】提供定制化的一站式数据挖掘和统计分析咨询服务