-
2021-06-22 09:40:26
文章目录
1 面板数据
狭义上,数据就是变量的观测值。例如浙江省每年的GDP增加值,北京市每年的人口流入总量等等。像这种对同一个体在不同时期观测的数据称为时间序列数据;另一种常见的数据为截面数据,例如某班级所有同学在同一时刻的身高,同一时期的数学成绩。上述两种数据本质上是一维的,因为它们仅从时间维度与个体为维度对研究对象进行观测。如果将这两个维度进行综合考虑,则形成面板数据。例如,全国各个省级区域在2000—2019年人均收入水平。
个体 时间 体重 张三 2018 67kg 张三 2019 68kg 李四 2018 71kg 李四 2019 75kg 用变量表示为 { y } i t , i = 1 , 2 , … , N ; t = 1 , 2 , … , T i \{y\}_{i t}, i=1,2, \ldots, N ; t=1,2, \ldots, T_{i} {y}it,i=1,2,…,N;t=1,2,…,Ti。当 T i = T , i = 1 , 2 , ⋯ N T_i = T,i=1,2,\cdots N Ti=T,i=1,2,⋯N时,数据 { y } i t \{y\}_{i t} {y}it称作平衡面板;反之为非平衡面板。对于微观数据,一般个体 N N N较大,而时间 T T T较短,称这种数据为短面板数据;反之为长面板数据。在宏观领域中,样本截面个体 N N N与观测时间 T T T较为接近,或 T T T较长。
2 面板数据评价
相对一维数据(截面数据与时间序列),面板数据具有以下优势:
- 面板数据能较好量化不同个体的异质性特征(截面数据难以对较多个体进行综合考虑,容易忽略个体之间异质性差异)
例:在散点图中,一些个体呈现正向趋势变化;一些个体呈现负向趋势变化,那么综合来看,这种趋势应该如何变化?如果使用截面数据难以综合测量。
- 面板数据的容量较大,变量蕴含的信息更加丰富,使估计结果的方差更低。以一元回归模型为例
V a r ( β ^ ) = σ ^ 2 ∑ ( X i − X ˉ ) = σ ^ 2 ( n − 1 ) V a r ( X i ) (1) Var(\hat\beta)=\frac{\hat\sigma^2}{\sum(X_i-\bar X)}= \frac{\hat\sigma^2}{(n-1)Var(X_i)}\tag{1} Var(β^)=∑(Xi−Xˉ)σ^2=(n−1)Var(Xi)σ^2(1)
式中,回归系数的方差受到三部分影响:扰动项、样本容量与自变量的波动。样本容量的增加不仅将低回归系数的方差,还能扩充子自变量的信息量从而提高自变量的波动,间接降低了回归系数的方差。
- 一定程度上缓解了内生性问题(见后文)
当然面板数据并不完美无瑕的,也存在一些问题。例如,样本数据通常满足 i i d iid iid,从而导致模型可能存在自相关问题;数据收集成本业比较高,收集数据的时间成本较大。
3 固定效应模型
一般的面板数据模型可设为
y i t = x i t β i t + z i δ + λ t + c i + u i t (2) y_{i t}= x_{i t}\boldsymbol\beta_{i t}+z_i\boldsymbol\delta+\lambda_t+c_i+u_{i t}\tag{2} yit=xitβit+ziδ+λt+ci+uit(2)
其中 β i t \boldsymbol\beta_{it} βit为不同时间点与不同截面个体的回归参数, z i z_i zi表示不随时间变化的变量,例如性别、种族等。 λ t \lambda_t λt表示不随截面个体变化而随时间变化的时间效应,例如技术效应, c i c_i ci表示不随时间变化而随截面个体变化的个体效应。如果数据是省级的,则为地区效应;数据是国家级的,则为国家效应。 u i t u_{it} uit表示随机扰动项。时间效应与个体效应与随机扰动项构成了复合扰动项 ε i t \varepsilon_{it} εit。考虑模型(2)需要估计过多参数 ( β i t ) (\beta_{it}) (βit),这将会损失大量的样本从而造成估计结果的不一致,因此需要对模型(2)进行简化。
3.1 单因素固定效应模型与估计
单因素固定效应模型只考虑个体效应,且假定不同截面个体的回归斜率(参数)是相同的,而模型的截距项存在异质性,即
y i t = x i t β + z i δ + c i + u i t (3) y_{i t}= x_{i t}\boldsymbol\beta+z_i\boldsymbol\delta+c_i+u_{i t}\tag{3} yit=xitβ+ziδ+ci+uit(3)
其中 C o v ( x i t , c i ) ≠ 0 Cov(x_{it},c_i)\ne0 Cov(xit,ci)=0,即解释变量与个体效应存在相关性。由于复合扰动项 ε i t = c i + u i t \varepsilon_{it}=c_i+u_{it} εit=ci+uit,故 C o v ( x i t , ε i t ) ≠ 0 Cov(x_{it},\varepsilon_{it})\ne0 Cov(xit,εit)=0。为了使估计量具有优良性质,还需要假定
{ E ( c i ) = 0 V a r ( c i ) = σ c 2 E ( u i t ) = 0 V a r ( u i t ) = σ u 2 E ( c i u i t ) = 0 E ( u i t , u i s ) = 0 ( t ≠ s ) \left\{\begin{array}{l} E(c_i)=0\\ Var(c_i)=\sigma_c^2\\ E(u_{it})=0\\ Var(u_{it})=\sigma_u^2\\ E(c_iu_{it})=0\\ E(u_{it},u_{is}) =0(t\ne s) \end{array}\right. ⎩⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎧E(ci)=0Var(ci)=σc2E(uit)=0Var(uit)=σu2E(ciuit)=0E(uit,uis)=0(t=s)
复合扰动项的方差为
V a r ( ε i t ) = σ c 2 + σ u 2 (4) Var(\varepsilon_{it}) =\sigma_c^2+\sigma_u^2\tag{4} Var(εit)=σc2+σu2(4)
复合扰动项的协方差为
Cov ( ε i t , ε i s ) = E ( ε i t ε i s ) = E [ ( c i + ε i t ) ( c i + ε i s ) ] = E ( c i 2 ) = σ c 2 (5) \begin{aligned} \operatorname{Cov}\left(\varepsilon_{i t}, \varepsilon_{i s}\right) &=\mathrm{E}\left(\varepsilon_{i t} \varepsilon_{i s}\right)=E\left[\left(c_{i}+\varepsilon_{i t}\right)\left(c_{i}+\varepsilon_{i s}\right)\right] \\ &=\mathrm{E}\left(c_{i}^{2}\right)=\sigma_{c}^{2} \end{aligned}\tag{5} Cov(εit,εis)=E(εitεis)=E[(ci+εit)(ci+εis)]=E(ci2)=σc2(5)
由(5)/(4)得到同一个体复合扰动项的相关系数
ρ = corr ( ε i t , ε i s ) = σ c 2 σ c 2 + σ u 2 \rho = \operatorname{corr}\left(\varepsilon_{i t}, \varepsilon_{i s}\right)=\frac{\sigma_{c}^{2}}{\sigma_{c}^{2}+\sigma_{u}^{2}} ρ=corr(εit,εis)=σc2+σu2σc2
故截面个体 i i i的扰动项 ε i t \varepsilon_{it} εit的
Σ i = ( E ( ε i 1 ε i 1 ) E ( ε i 1 ε i 2 ) ⋯ E ( ε i 1 ε i T ) E ( ε i 2 ε i 1 ) E ( ε i 2 ε i 2 ) ⋯ E ( ε i 2 ε i T ) ⋮ ⋮ ⋮ E ( ε i T ε i T ) E ( ε i T ε i T ) ⋯ E ( ε i T ε i T ) ) T × T = ( σ c 2 + σ u 2 σ c 2 ⋯ σ c 2 σ c 2 σ c 2 + σ u 2 ⋯ σ c 2 ⋮ ⋮ ⋮ σ c 2 σ c 2 ⋯ σ c 2 + σ u 2 ) T × T = ( σ c 2 + σ u 2 ) ( 1 ρ ⋯ ρ ρ 1 ⋯ ρ ⋮ ⋮ ⋮ ρ ρ ⋯ 1 ) T × T = σ v 2 ( 1 ρ ⋯ ρ ρ 1 ⋯ ρ ⋮ ⋮ ⋮ ρ ρ ⋯ 1 ) T × T \begin{aligned} \Sigma_i = & \left(\begin{array}{cccc} E(\varepsilon_{i1}\varepsilon_{i1})&E(\varepsilon_{i1}\varepsilon_{i2})&\cdots &E(\varepsilon_{i1}\varepsilon_{iT})\\ E(\varepsilon_{i2}\varepsilon_{i1})&E(\varepsilon_{i2}\varepsilon_{i2})&\cdots &E(\varepsilon_{i2}\varepsilon_{iT})\\ \vdots&\vdots& &\vdots& \\ E(\varepsilon_{iT}\varepsilon_{iT})&E(\varepsilon_{iT}\varepsilon_{iT})&\cdots &E(\varepsilon_{iT}\varepsilon_{iT}) \end{array}\right)_{T\times T} \\ \\ =&\left(\begin{array}{cccc} \sigma_c^2+\sigma_u^2 & \sigma_c^2 & \cdots & \sigma_c^2\\ \sigma_c^2 & \sigma_c^2+\sigma_u^2 &\cdots&\sigma_c^2\\ \vdots&\vdots& &\vdots& \\ \sigma_c^2 & \sigma_c^2 &\cdots&\sigma_c^2+\sigma_u^2 \\ \end{array}\right)_{T\times T}\\ \\ =& (\sigma_c^2+\sigma_u^2) \left(\begin{array}{cccc} 1 & \rho & \cdots & \rho\\ \rho & 1 &\cdots&\rho\\ \vdots&\vdots& &\vdots& \\ \rho & \rho&\cdots&1 \\ \end{array}\right)_{T\times T}\\ \\ =& \sigma_v^2 \left(\begin{array}{cccc} 1 & \rho & \cdots & \rho\\ \rho & 1 &\cdots&\rho\\ \vdots&\vdots& &\vdots& \\ \rho & \rho&\cdots&1 \\ \end{array}\right)_{T\times T}\\ \end{aligned} Σi====⎝⎜⎜⎜⎛E(εi1εi1)E(εi2εi1)⋮E(εiTεiT)E(εi1εi2)E(εi2εi2)⋮E(εiTεiT)⋯⋯⋯E(εi1εiT)E(εi2εiT)⋮E(εiTεiT)⎠⎟⎟⎟⎞T×T⎝⎜⎜⎜⎛σc2+σu2σc2⋮σc2σc2σc2+σu2⋮σc2⋯⋯⋯σc2σc2⋮σc2+σu2⎠⎟⎟⎟⎞T×T(σc2+σu2)⎝⎜⎜⎜⎛1ρ⋮ρρ1⋮ρ⋯⋯⋯ρρ⋮1⎠⎟⎟⎟⎞T×Tσv2⎝⎜⎜⎜⎛1ρ⋮ρρ1⋮ρ⋯⋯⋯ρρ⋮1⎠⎟⎟⎟⎞T×T
全体截面个体构成扰动项组成的分块协方差矩阵为
Ω = [ ∑ 1 0 ⋯ 0 0 ∑ 2 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ ∑ n ] n T × n T \Omega=\left[\begin{array}{cccc} \sum_1 & 0 & \cdots & 0 \\ 0 & \sum_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \sum_n \end{array}\right]_{nT\times nT} Ω=⎣⎢⎢⎢⎡∑10⋮00∑2⋮0⋯⋯⋱⋯00⋮∑n⎦⎥⎥⎥⎤nT×nT
3.1.1 差分估计
单因素固定效应模型一定存在内生性问题。产生内生性的根源在于解释变量与个体效应存在相关性,从而导致复合扰动项与解释变量存在相关性(无论扰动项是否与解释变量存在相关性)。由于这种内生性问题是由个体效应导致的内生性问题,个体效应又不随时间变化而变化,故考虑对模型(3)滞后一期
y i , t − 1 = x i , t − 1 β + z i δ + c i + u i , t − 1 (6) y_{i ,t-1}= x_{i, t-1}\boldsymbol\beta+z_i\boldsymbol\delta+c_i+u_{i,t-1} \tag{6} yi,t−1=xi,t−1β+ziδ+ci+ui,t−1(6)
差分,得到
Δ y i t = Δ x i t β + Δ ε i t (7) \Delta y_{it} = \Delta x_{it}\boldsymbol\beta+\Delta\varepsilon_{it}\tag{7} Δyit=Δxitβ+Δεit(7)
如果 C o v ( Δ x i t , Δ ε i t ) = E ( x i t − x i , t − 1 ) ′ ( ε i t − ε i , t − 1 ) = 0 Cov(\Delta x_{it},\Delta\varepsilon_{it}) = E(x_{it}-x_{i,t-1})^\prime(\varepsilon_{it}-\varepsilon_{i,t-1})=0 Cov(Δxit,Δεit)=E(xit−xi,t−1)′(εit−εi,t−1)=0,则可用OLS法对模型(5)进行估计。称该估计方法为差分估计(FD),其估计量称为差分估计量。考虑 E ( x i t − x i , t − 1 ) ′ ( ε i t − ε i , t − 1 ) = 0 E(x_{it}-x_{i,t-1})^\prime(\varepsilon_{it}-\varepsilon_{i,t-1})=0 E(xit−xi,t−1)′(εit−εi,t−1)=0,着意味着解释变量不仅要与同期的复合扰动项不相关,还需要与上期的扰动项不相关,即解释变量与扰动项必须满足强外生关系,否则对模型 ( 3 ) (3) (3)进行OLS估计将存在内生性偏误。
3.1.2 组内离差估计量
另一种估计策略是对每个截面个体(组内)进行内部离差化,即用模型(3)对时间求均值,
y ˉ i = x ˉ i β + z i δ + c i + u ˉ i (8) \bar y_{i }= \bar x_{i}\boldsymbol\beta+z_i\boldsymbol\delta+c_i+\bar u_{i} \tag{8} yˉi=xˉiβ+ziδ+ci+uˉi(8)
用(3)-(8)得
y i t − y ˉ i = ( x i t − x ˉ i ) β + ( u i t − u ˉ i ) (9) y_{i t}-\bar{y}_{i}=\left(x_{i t}-\bar{x}_{i}\right) \boldsymbol \beta+(u_{i t}-\bar{u}_{i})\tag{9} yit−yˉi=(xit−xˉi)β+(uit−uˉi)(9)
如果 E ( x i t − x ˉ i ) ′ ( ε i t − ε ˉ i ) = 0 E(x_{it}-\bar x_{i})^\prime(\varepsilon_{it}-\bar \varepsilon_{i})=0 E(xit−xˉi)′(εit−εˉi)=0,即解释变量的组内离差与扰动项的组内离差不存在相关性时,模型(9)的参数可利用OLS估计。这种估计方法称作组内离差估计或固定效应估计;其对应的估计量称作组内离差估计量或固定效应估计量。与差分估计相同,模型(9)的解释变量变量组内离差必须满足严格外生性,因为复合扰动项的组内均值 u ˉ i \bar u_i uˉi包含有各个时期的信息。
3.1.3 最小二乘虚拟变量法(LSDV)
在差分估计与组内离差估计中,不随时间变化的个体效应 c i c_i ci与不随时间变化的定性变量 z i z_i zi均被消除,无法估计二者潜在的影响。为了得到不同截面个体的个体效应,可以通过最小二乘虚拟变量法(LSDV)进行测量。模型为
y i t = x i t β + z i δ + ∑ j = 2 N α j 1 ( i = j ) + u i t (10) y_{i t}= x_{i t}\boldsymbol\beta+z_i\boldsymbol\delta+\sum_{j=2}^{N} \alpha_{j} 1(i=j)+u_{i t}\tag{10} yit=xitβ+ziδ+j=2∑Nαj1(i=j)+uit(10)
其中 l ( ⋅ ) l(·) l(⋅)为示性函数。如果要对对个体效应的显著性检验,只需检验个体虚拟变量系数的联合显著性。即 H 0 : α i = 0 H_0:\alpha_i =0 H0:αi=0,如果拒绝原假设,表明截面个体之间存在显著差异的个体效应,此时可利用组内离差估计量;反之接受原假设则所有截面个体具有同质性,利用OLS混合回归即可。这也比较固定效应估计与OLS估计的依据。
3.1.4 个体固定效应的拟合优度
与截面数据OLS回归一样,面板数据回定效应估计也有相应的可决系数或拟合优度。考虑到面板数据存在组内与组间,因此拟合优度呈现三种:
组间估计拟合优度
R 2 = corr ( y ˉ i , y ˉ ^ i ) 2 R^{2}=\operatorname{corr}\left(\bar{y}_{i}, \hat{\bar{y}}_{i}\right)^{2} R2=corr(yˉi,yˉ^i)2
组内估计拟合优度
R 2 = corr ( y i t − y ˉ i , y ^ i t − y ˉ ^ i ) 2 R^{2}=\operatorname{corr}\left(y_{i t}-\bar{y}_{i}, \hat{y}_{i t}-\hat{\bar{y}}_{i}\right)^{2} R2=corr(yit−yˉi,y^it−yˉ^i)2
全样本拟合优度
R 2 = corr ( y i t , y ^ i t ) 2 R^{2}=\operatorname{corr}\left(y_{i t}, \hat{y}_{i t}\right)^{2} R2=corr(yit,y^it)2
3.2 双因素固定效应模型与估计
双因素固定效应是在单因素固定效应模型的基础上加入不随个体变化的时间效应,即
y i t = x i t β + z i δ + c i + λ t + u i t (11) y_{i t}= x_{i t}\boldsymbol\beta+z_i\boldsymbol\delta+c_i+\lambda_t+u_{i t}\tag{11} yit=xitβ+ziδ+ci+λt+uit(11)
估计方法与单因素固定效应类似,通过组内离差变换得到下式
y i t − y ˉ i = ( x i t − x ˉ i ) β + ( λ t − λ ˉ t ) + ( u i t − u ˉ i ) (12) y_{i t}-\bar{y}_{i}=\left(x_{i t}-\bar{x}_{i}\right) \boldsymbol \beta+(\lambda_t-\bar \lambda_t)+(u_{i t}-\bar{u}_{i})\tag{12} yit−yˉi=(xit−xˉi)β+(λt−λˉt)+(uit−uˉi)(12)
为了估算出时间效应,可以利用虚拟变量法对模型(12)进行设当变形
y i t − y ˉ i = ( x i t − x ˉ i ) β + ∑ t = 2 T α t 1 ( i = t ) + ( u i t − u ˉ i ) (13) y_{i t}-\bar{y}_{i}=\left(x_{i t}-\bar{x}_{i}\right) \boldsymbol \beta+\sum_{t=2}^{T} \alpha_{t} 1(i=t)+(u_{i t}-\bar{u}_{i})\tag{13} yit−yˉi=(xit−xˉi)β+t=2∑Tαt1(i=t)+(uit−uˉi)(13)
事实上模型(13)与模型(14)
y i t = x i t β + z i δ + ∑ t = 2 T α t 1 ( i = t ) + ∑ j = 2 N α j 1 ( i = j ) + u i t (14) y_{i t}= x_{i t}\boldsymbol\beta+z_i\boldsymbol\delta+\sum_{t=2}^{T} \alpha_{t} 1(i=t)+\sum_{j=2}^{N} \alpha_{j} 1(i=j)+u_{i t}\tag{14} yit=xitβ+ziδ+t=2∑Tαt1(i=t)+j=2∑Nαj1(i=j)+uit(14)
是等价的。模型(14)在原始模型的基础上,加入时间效应的虚拟变量与个体效应的虚拟变量,因此称作双重最小二乘虚拟变量法。关于时间效应与个体效应的显著性检验与单因素的个体效应检验类似。需要注意的是,一般情况下,静态面板数据应该以双因素固定效应模型为逻辑出发点,分别对时间效应与个体效应进行联合显著性检验,如果时间效应不显著,则考虑单因素固定效应模型;反之为双因素固定效应模型。
3.3 交互固定效应模型介绍
除了双因素固定效应模型外,还存在时间效应与固定效应的交互情形。双因素固定效应模型并没考虑到时间效应与个体效应之间的内在关联。白聚山教授将该类模型推向了前沿。具体理论与做法参见Bai, Jushan. Panel data models with interactive fixed effects. (2009) Econometrica。或者https://www.douban.com/group/topic/138237787/。限于篇幅,这里不加详谈。
4 随机效应模型
对于固定效应模型
y i t = x i t β + z i δ + c i + u i t (15) y_{i t}= x_{i t}\boldsymbol\beta+z_i\boldsymbol\delta+c_i+u_{i t}\tag{15} yit=xitβ+ziδ+ci+uit(15)
一个必要条件是 C o v ( x i t , c i ) ≠ 0 Cov(x_{it},c_i)\ne0 Cov(xit,ci)=0。如果假定 C o v ( x i t , c i ) = 0 Cov(x_{it},c_i) = 0 Cov(xit,ci)=0,则称模型(15)为随机效应模型。如果解释变量 x i t x_{it} xit不仅与个体效应不相关,也与扰动项 u i t u_{it} uit不相关,则随机效应模型(15)可利用OLS得到一致估计量。如果模型存在自相关问题,可选取聚类稳健标准误加以解决。如果即存在自相关又存在异方差,可利用异方差自相关稳健的标准误解决。尽管使用OLS+异方差自相关稳健的标准误能得到一致估计量,但不是最有效估计。此时利用广义最小二乘法(GLS)可得到有效估计,具体操作如下:对模型(15)进行广义离差变换得
y i t − θ y ˉ i = ( x i t − θ x ˉ i ) β + ( 1 − θ ) z i δ + ( 1 − θ ) c i + ( u i t − θ u ˉ i ) (16) y_{i t}-\theta \bar{y}_{i}= \left(x_{i t}-\theta \bar{x}_{i}\right) \beta+(1-\theta)z_i\boldsymbol\delta+ (1-\theta)c_i+ \left(u_{i t}-\theta \bar{u}_{i}\right)\tag{16}\\ yit−θyˉi=(xit−θxˉi)β+(1−θ)ziδ+(1−θ)ci+(uit−θuˉi)(16)
其中 θ = 1 − [ σ u 2 / ( σ u 2 + T σ c 2 ) ] 1 / 2 ∈ ( 0 , 1 ) \theta=1-\left[\sigma_{u}^{2} /\left(\sigma_{u}^{2}+T \sigma_{c}^{2}\right)\right]^{1 / 2}\in(0,1) θ=1−[σu2/(σu2+Tσc2)]1/2∈(0,1)。此时扰动项复合扰动项 ( 1 − θ ) c i + ( u i t − θ u ˉ i ) (1-\theta)c_i+ \left(u_{i t}-\theta \bar{u}_{i}\right) (1−θ)ci+(uit−θuˉi)不再有自相关问题。证明略。通过可行广义最小二乘法估计随机效应模型的估计量称作随机效应估计量(RE)。注:
- 当 θ = 0 \theta = 0 θ=0时, σ c 2 = 0 \sigma_{c}^{2}=0 σc2=0 ,即个体效应的波动为0,不同截面个体不存在异质性,采用OLS回归即可
- 当 θ = 1 \theta = 1 θ=1时, σ u 2 = 0 \sigma_{u}^{2} =0 σu2=0,即个体效应的波动非常大,从而体现出不同截面个体的具有显著的异质性。此时采取固定效应回归即可。
从上面两种情况可以得到关于个体异质性的检验方法,即检验 H 0 : σ c 2 = 0 H_0:\sigma^2_c=0 H0:σc2=0。若拒绝原假设,表明模型不存在截面个体的异质性,此时利用OLS估计即可,反之模型存在异质性,选择随机效应模型。
5 模型的选择
前文介绍主要介绍了FD估计法,FE估计法,LSDV估计法与RE估计法。不同条件下不同方法适用于不同的模型估计。因此需要构建相应的判别标准对这些方法进行比较分析。在LSDV估计法中,通过构建虚拟变量法可对虚拟变量的系数进行联合性显著检验,从而推断出不同截面个体是否存在系统性的异质性。
5.1 差分估计量与组内估计量的比较
固定效应模型中,差分估计量与组内估计量都能消除个体效应与不随时间变化的定性变量。但事实上,只有当观测期 T = 2 T=2 T=2时,差分估计与组内离差估计等价; T > 2 T>2 T>2时,组内离差估计与差分估计相比更有效。
组内离差:
y i 2 − y i 2 + y i 1 2 = ( x i 2 − x i 2 + x i 1 2 ) β + u i 2 − u i 2 + u i 1 2 y_{i 2}-\frac{y_{i 2}+y_{i 1}}{2}=\left(x_{i 2}-\frac{x_{i 2}+x_{i 1}}{2}\right) \beta+u_{i 2}-\frac{u_{i 2}+u_{i 1}}{2} yi2−2yi2+yi1=(xi2−2xi2+xi1)β+ui2−2ui2+ui1
差分
y i 2 − y i 1 2 = x i 2 − x i 1 2 β + u i 2 − u i 1 2 \frac{y_{i 2}-y_{i 1}}{2}=\frac{x_{i 2}-x_{i 1}}{2}\beta+\frac{u_{i 2}-u_{i 1}}{2} 2yi2−yi1=2xi2−xi1β+2ui2−ui1
但是如果扰动项如果是非平稳过程,那么差分估计反而更适合。在动态面板中,差分估计的适用性更大。
5.2 随机效应模型与固定效应模型比较
当存在截面个体异质性条件下,需要在固定效应模型与随机效应模型进行选择。其原假设为 H 0 : H_0: H0:个体效应不与任何解释变量相关(包括定性变量),即原假设认为随机效应模型更为正确。如果原假设成立,通过程模,随机效应估计量 R E RE RE与固定效应估计量 F E FE FE收敛到真实参数向量 β \boldsymbol \beta β,且随机效应模型更有效。反之 F E FE FE估计量与 R E RE RE估计量存在系统性差异,应该选择 F E FE FE模型。hausmn(1978)通过构建wald估计量
H = ( β ^ f e − β ^ r e ) ′ [ Var ( β ^ f e ) − Var ( β ^ r e ) ] − 1 ( β ^ f e − β ^ r e ) → χ 2 ( d f ) H=\left(\boldsymbol {\hat{\beta}}_{f e}-\boldsymbol{\hat{\beta}}_{r e}\right)^{\prime}\left[\operatorname{Var}\left(\boldsymbol{\hat{\beta}}_{f e}\right)-\operatorname{Var}\left(\boldsymbol{\hat{\beta}}_{r e}\right)\right]^{-1}\left(\boldsymbol{\hat{\beta}}_{f e}-\boldsymbol{\hat{\beta}}_{r e}\right) \rightarrow \chi^{2}(d f) H=(β^fe−β^re)′[Var(β^fe)−Var(β^re)]−1(β^fe−β^re)→χ2(df)
其中 d f df df为解释变量个数。事实上,传统的hausmn检验没有考虑扰动项可能存在的异方差;一种方法是通过自助法,利用计算机模拟再抽样的方法计算固定效应估计量向量与随机效应模型估计量向量之差的方差,即 V a r ( β ^ f e − β ^ r e ) {Var}\left(\boldsymbol{\hat{\beta}}_{f e}-\boldsymbol{\hat{\beta}}_{re}\right) Var(β^fe−β^re)。另一种方法是构造如下辅助回归(Wooldridge,2010)
y i t − θ ^ y ˉ i = ( x i t − θ ^ x ‾ i ) ′ β + ( 1 − θ ^ ) z i ′ δ + ( x i t − x ‾ i ) ′ γ + [ ( 1 − θ ^ ) u i + ( ε i t − θ ^ ε ˉ i ) ] (17) y_{i t}-\hat{\theta} \bar{y}_{i}=\left({x}_{i t}-\hat{\theta} \overline{{x}}_{i}\right)^{\prime} \boldsymbol{\beta}+(1-\hat{{\theta}}) {z}_{i}^{\prime} \boldsymbol{\delta}+\left({x}_{i t}-\overline{{x}}_{i}\right)^{\prime} \boldsymbol{\gamma}+\left[(1-\hat{\theta}) u_{i}+\left({\varepsilon}_{i t}-\hat{\theta} \bar{\varepsilon}_{i}\right)\right]\tag{17} yit−θ^yˉi=(xit−θ^xi)′β+(1−θ^)zi′δ+(xit−xi)′γ+[(1−θ^)ui+(εit−θ^εˉi)](17)
(17)式是在(16)式基础上添加了关于解释变量的组内的离差项。当选择随机效应模型时,即扰动项(含有个体效应) [ ( 1 − θ ^ ) u i + ( ε i t − θ ^ ε ˉ i ) ] \left[(1-\hat{\theta}) u_{i}+\left({\varepsilon}_{i t}-\hat{\theta} \bar{\varepsilon}_{i}\right)\right] [(1−θ^)ui+(εit−θ^εˉi)]与解释变量 ( x i t − x ‾ i ) \left({x}_{i t}-\overline{{x}}_{i}\right) (xit−xi)无关,随着样本增大,理应有 γ → 0 \boldsymbol \gamma\to 0 γ→0,从而(17)式退化为(16)式。反之若扰动项 [ ( 1 − θ ^ ) u i + ( ε i t − θ ^ ε ˉ i ) ] \left[(1-\hat{\theta}) u_{i}+\left({\varepsilon}_{i t}-\hat{\theta} \bar{\varepsilon}_{i}\right)\right] [(1−θ^)ui+(εit−θ^εˉi)]与解释变量 ( x i t − x ‾ i ) \left({x}_{i t}-\overline{{x}}_{i}\right) (xit−xi)相关,随着样本增大,理应有 γ ≠ 0 \boldsymbol \gamma\ne 0 γ=0,从而选择固定效应。综上,可以根据模型(17)使用聚类稳健标准误后构建如下原假设:
H 0 : γ = 0 H_0:\boldsymbol \gamma =0 H0:γ=0
若拒绝原假设,则选择固定效应模型,反之选择随机效应模型。这种方法同样适合异方差情形。参考文献
[1] 陈强.,2014,高级计量经济学及stata应用
[2] https://www.douban.com/group/topic/138237787/
[3] Wooldridge,J.,2010.Econometric Analysis of Cross Section and panel Data ,2nd edition.Cambridge,MA:MIT Press
-END- 更多内容,关注公众号“那由他的学习笔记”
更多相关内容 -
论文研究-能源消费对中国雾霾污染的空间溢出效应——基于静态与动态空间面板数据模型的实证研究.pdf
2019-09-20 20:32:38论文研究-能源消费对中国雾霾污染的空间溢出效应——基于静态与动态空间面板数据模型的实证研究.pdf, 基于2004——2013年中国30个省、市及自治区的空间面板数据,运用... -
B7_静态与动态面板数据.rar
2021-03-11 09:54:28静态动态面板数据教学 -
浙江大学【面板数据分析与STATA应用】——第四讲动态面板数据类型
2020-07-29 12:24:26国际顶级期刊的编辑非常重视内生性问题,一定要处理好内生性问题,03讲了工具变量,本讲中通过动态面板数据能够较好处理内生性问题。...动态面板数据模型的设定是在原有的静态面板数据模型的基础上引入被解释变.国际顶级期刊的编辑非常重视内生性问题,一定要处理好内生性问题,03讲了工具变量,本讲中通过动态面板数据能够较好处理内生性问题。
动态面板数据
动态面板数据(Dynamic Panel Data,DPD):是指在面板模型中,解释变量包含了被假释变量的滞后值。在动态面板数据类型中被解释变量和上一期变量之间存在关系。即, y i , t y_{i,t} yi,t与 y i , t − 1 y_{i,t-1} yi,t−1之间是有关系的,上一期的值决定着下一期的值。
动态面板数据模型的设定是在原有的静态面板数据模型的基础上引入被解释变量的滞后期,而其他的都相同。
其中, u i t u_{it} uit为复合误差项, u i t u_{it} uit = μ i \mu_{i} μi + v i t v_{it} vit, v i t v_{it} vit为随机扰动项, μ i \mu_{i} μi为不可观测的个体效应。可以很容易的看出,模型中 y i , t − 1 y_{i,t-1} yi,t−1是一个内生变量,模型存在内生性问题,所以使用传统的最小二乘进行估计,估计结果是有偏且不一致的。对上述动态面板数据模型进行拟合估计:首先进行一阶差分将原始模型中的不可观测的个体效应 μ i \mu_{i} μi去除,得到差分后的模型为:
由于 Δ y i , t − 1 \Delta{y_{i,t-1}} Δyi,t−1与 ε i , t − 1 \varepsilon_{i,t-1} εi,t−1相关,所以 Δ y i , t − 1 \Delta{y_{i,t-1}} Δyi,t−1与 Δ ε i , t − 1 \Delta\varepsilon_{i,t-1} Δεi,t−1是相关的,所以一阶差分后的动态面板数据模型仍存在内生性问题。Anderson等人在1982年提出了一种为差分变量 y i , t − 1 {y_{i,t-1}} yi,t−1 - y i , t − 2 {y_{i,t-2}} yi,t−2寻找工具变量的方法。这个工具变量为 y i , t − 2 {y_{i,t-2}} yi,t−2。由于差分变量本身包含着 y i , t − 2 {y_{i,t-2}} yi,t−2,所以工具变量和内生变量存在高度的相关性,在误差项 ε i , t \varepsilon_{i,t} εi,t不存在自相关的前提下,工具变量 y i , t − 2 {y_{i,t-2}} yi,t−2与误差项的差分 ε i , t \varepsilon_{i,t} εi,t - ε i , t − 1 \varepsilon_{i,t-1} εi,t−1不相关,因此, y i , t − 2 {y_{i,t-2}} yi,t−2 满足工具变量的条件。需要注意的是, y i , t − 2 {y_{i,t-2}} yi,t−2并不是唯一的工具变量,被解释变量滞后三期、四期(即, y i , t − 3 {y_{i,t-3}} yi,t−3, y i , t − 4 {y_{i,t-4}} yi,t−4)都满足工具变量的条件。同时,他们认为这种相当于两阶段最小二乘估计的结果虽然是一致的,但却并不是有效的,因为他们没有充分利用样本里的所有信息,于是他们提出了使用更多工具变量的**广义矩估计方法(GMM)**来进行动态面板数据模型的估计,工具变量来自更多的滞后期。
广义矩估计GMM
动态面板数据模型的GMM估计方法又可以分为两种,即差分GMM(DIF-GMM)和系统GMM(SYS-GMM)估计方法。
需要注意的是,差分GMM和系统GMM方法主要适用于短动态面板数据。这是因为,虽然基于IV或GMM的估计方法是一致估计量(即当 n → ∞ n\to\infty n→∞时,没有偏差),但对于 n n n较小而 T T T较大的长面板则可能存在较严重的偏差。对于长动态面板数据模型的估计可以使用“偏差校正LSDV法”进行估计。
差分GMM的基本思路是:对基本模型进行一阶差分以去除固定效应的影响,然后,用一组滞后的解释变量作为差分方程中相应变量的工具变量。
Blundell和Bond两位作者认为,差分GMM的估计量较易受弱工具变量的影响而产生向下的大的有限样本偏差。为了克服这一问题,Blundell和Bond提出了系统广义矩估计即系统GMM估计方法。
系统GMM估计方法是基于差分GMM之上形成的,结合了差分方程和水平方程,此外,还增加了一组滞后的差分变量作为水平方程相应的工具变量,更具有系统性。
相对来说,系统GMM估计量具有更好的有限样本性质。
系统GMM估计方法的前提假定是:工具变量的一阶差分与固定效应项不相关。然而,到目前为止,并没有方法能够对这一个假定进行检验。
此外,使用系统GMM估计方法的条件是:
(1)大N小T,即短面板数据;
(2)线性函数关系,构造的计量模型要求是线性的;
(3)方程等号左边的变量作为动态变量;
(4)方程等号右边的变量并不是严格外生的;
(5)控制个体固定效应;
(6)默认不存在截面相关问题,并且建议采用双向固定效应。时间虚拟变量的引入可以使误差项的截面相关变得不相关,所以在模型设定中尽可能地引入时间虚拟变量以减少截面相关的可能。
在理论层面,GMM估计量(差分GMM、系统GMM)的一致性关键取决于各项假设条件是否满足,这需要进行两个假设检验。
(1)通过Hansen过度识别约束检验对所使用的工具变量的有效性进行检验,此检验的原假设是所使用的工具变量与误差项是不相关的。
(2)通过Arellano-Bond的自相关检验方法对差分方程的随机误差项的二阶序列相关进行检验,其原假设是一阶差分方程的随机误差项中不存在二阶序列相关。如果不拒绝原假设则意味着工具变量有效和模型设定正确。stata操作
数据集
使用英国140家企业1976~1984年的数据来研究就业数据abdata.dta,是非平衡面板,被解释变量为 n n n,是就业的对数,存在着两期滞后。重要的解释变量有当期和滞后一期的工资水平 w w w,当期、滞后一期和滞后两期的资本存量 k k k,以及当期、滞后一期和滞后两期的公司产出 y s ys ys,所有的变量都取对数形式。
- 描述性统计
des
结果:
obs: 1,031 Layard & Nickell, Unemployment in Britain, Economica 53, 1986 from Ox dist vars: 16 21 May 2013 21:52 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- storage display value variable name type format label variable label ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ind int %8.0g industry year int %8.0g emp float %9.0g employment wage float %9.0g real wage cap float %9.0g gross capital stock indoutpt float %9.0g industry output n float %9.0g log(employment) w float %9.0g log(real wage) k float %9.0g log(gross capital stock) ys float %9.0g log(industry output) yr1980 float %9.0g yr1981 float %9.0g yr1982 float %9.0g yr1983 float %9.0g yr1984 float %9.0g id float %9.0g firm ID ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sorted by: id year
sum
结果:
Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- ind | 1,031 5.123181 2.678095 1 9 year | 1,031 1979.651 2.21607 1976 1984 emp | 1,031 7.891677 15.93492 .104 108.562 wage | 1,031 23.9188 5.648418 8.0171 45.2318 cap | 1,031 2.507432 6.248712 .0119 47.1079 -------------+--------------------------------------------------------- indoutpt | 1,031 103.8012 9.938008 86.9 128.3653 n | 1,031 1.056002 1.341506 -2.263364 4.687321 w | 1,031 3.142988 .2630081 2.081577 3.8118 k | 1,031 -.4415775 1.514132 -4.431217 3.852441 ys | 1,031 4.638015 .0939611 4.464758 4.85488 -------------+--------------------------------------------------------- yr1980 | 1,031 .1357905 .3427322 0 1 yr1981 | 1,031 .1357905 .3427322 0 1 yr1982 | 1,031 .1357905 .3427322 0 1 yr1983 | 1,031 .0756547 .2645732 0 1 yr1984 | 1,031 .0339476 .1811823 0 1 -------------+--------------------------------------------------------- id | 1,031 73.20369 41.23333 1 140
- OLS估计
reg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys yr*
结果:
Source | SS df MS Number of obs = 751 -------------+---------------------------------- F(15, 735) = 8676.37 Model | 1343.3054 15 89.5536936 Prob > F = 0.0000 Residual | 7.58634832 735 .010321562 R-squared = 0.9944 -------------+---------------------------------- Adj R-squared = 0.9943 Total | 1350.89175 750 1.801189 Root MSE = .1016 ------------------------------------------------------------------------------ n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 1.043 0.034 31.01 0.000 0.977 1.109 L2. | -0.076 0.033 -2.30 0.022 -0.140 -0.011 | w | --. | -0.522 0.049 -10.71 0.000 -0.618 -0.426 L1. | 0.474 0.049 9.75 0.000 0.379 0.570 | k | --. | 0.342 0.025 13.42 0.000 0.292 0.392 L1. | -0.198 0.040 -4.96 0.000 -0.276 -0.119 L2. | -0.118 0.028 -4.16 0.000 -0.174 -0.062 | ys | --. | 0.429 0.123 3.50 0.001 0.188 0.669 L1. | -0.768 0.166 -4.63 0.000 -1.093 -0.442 L2. | 0.318 0.111 2.85 0.004 0.099 0.536 | yr1980 | 0.011 0.014 0.84 0.401 -0.015 0.038 yr1981 | -0.033 0.018 -1.85 0.065 -0.068 0.002 yr1982 | -0.026 0.018 -1.39 0.164 -0.062 0.010 yr1983 | -0.003 0.018 -0.14 0.885 -0.039 0.033 yr1984 | 0.006 0.021 0.26 0.794 -0.036 0.047 _cons | 0.284 0.350 0.81 0.418 -0.404 0.972 -----------------------------------------------------------------------------
xi:reg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year //LSDV估计
结果:
i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) note: _Iyear_1977 omitted because of collinearity note: _Iyear_1978 omitted because of collinearity Source | SS df MS Number of obs = 751 -------------+---------------------------------- F(16, 734) = 8136.58 Model | 1343.31797 16 83.9573732 Prob > F = 0.0000 Residual | 7.57378164 734 .010318504 R-squared = 0.9944 -------------+---------------------------------- Adj R-squared = 0.9943 Total | 1350.89175 750 1.801189 Root MSE = .10158 ------------------------------------------------------------------------------ n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 1.045 0.034 31.03 0.000 0.979 1.111 L2. | -0.077 0.033 -2.33 0.020 -0.141 -0.012 | w | --. | -0.524 0.049 -10.74 0.000 -0.619 -0.428 L1. | 0.477 0.049 9.79 0.000 0.381 0.572 | k | --. | 0.343 0.026 13.46 0.000 0.293 0.393 L1. | -0.202 0.040 -5.04 0.000 -0.281 -0.123 L2. | -0.116 0.028 -4.06 0.000 -0.172 -0.060 | ys | --. | 0.433 0.123 3.53 0.000 0.192 0.674 L1. | -0.768 0.166 -4.63 0.000 -1.093 -0.442 L2. | 0.312 0.111 2.80 0.005 0.094 0.531 | _Iyear_1977 | 0.000 (omitted) _Iyear_1978 | 0.000 (omitted) _Iyear_1979 | 0.016 0.014 1.10 0.270 -0.012 0.044 _Iyear_1980 | 0.022 0.017 1.32 0.187 -0.011 0.055 _Iyear_1981 | -0.022 0.020 -1.09 0.278 -0.062 0.018 _Iyear_1982 | -0.015 0.021 -0.73 0.468 -0.056 0.026 _Iyear_1983 | 0.007 0.020 0.36 0.717 -0.033 0.047 _Iyear_1984 | 0.015 0.023 0.67 0.504 -0.030 0.061 _cons | 0.275 0.351 0.78 0.433 -0.413 0.963 ------------------------------------------------------------------------------
- 双向固定效应估计
xtreg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys yr*,fe
结果:
Fixed-effects (within) regression Number of obs = 751 Group variable: id Number of groups = 140 R-sq: Obs per group: within = 0.7973 min = 5 between = 0.9808 avg = 5.4 overall = 0.9758 max = 7 F(15,596) = 156.25 corr(u_i, Xb) = 0.5474 Prob > F = 0.0000 ------------------------------------------------------------------------------ n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.732 0.039 18.68 0.000 0.655 0.809 L2. | -0.140 0.040 -3.49 0.001 -0.218 -0.061 | w | --. | -0.559 0.057 -9.82 0.000 -0.671 -0.448 L1. | 0.314 0.061 5.16 0.000 0.195 0.434 | k | --. | 0.388 0.031 12.56 0.000 0.327 0.448 L1. | -0.079 0.038 -2.07 0.039 -0.154 -0.004 L2. | -0.028 0.033 -0.86 0.389 -0.093 0.036 | ys | --. | 0.466 0.123 3.80 0.000 0.225 0.708 L1. | -0.630 0.158 -3.99 0.000 -0.940 -0.320 L2. | 0.061 0.134 0.46 0.648 -0.202 0.325 | yr1980 | 0.008 0.013 0.60 0.551 -0.018 0.034 yr1981 | -0.029 0.019 -1.53 0.127 -0.066 0.008 yr1982 | -0.038 0.020 -1.92 0.055 -0.077 0.001 yr1983 | -0.032 0.022 -1.46 0.146 -0.074 0.011 yr1984 | -0.015 0.024 -0.62 0.534 -0.063 0.033 _cons | 1.797 0.507 3.54 0.000 0.801 2.793 -------------+---------------------------------------------------------------- sigma_u | .22630054 sigma_e | .09388866 rho | .85314812 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(139, 596) = 1.90 Prob > F = 0.0000
xi:xtreg n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year,fe
结果:
i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) note: _Iyear_1977 omitted because of collinearity note: _Iyear_1984 omitted because of collinearity Fixed-effects (within) regression Number of obs = 751 Group variable: id Number of groups = 140 R-sq: Obs per group: within = 0.7973 min = 5 between = 0.9809 avg = 5.4 overall = 0.9758 max = 7 F(16,595) = 146.27 corr(u_i, Xb) = 0.5459 Prob > F = 0.0000 ------------------------------------------------------------------------------ n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.733 0.039 18.65 0.000 0.656 0.810 L2. | -0.139 0.040 -3.48 0.001 -0.218 -0.061 | w | --. | -0.560 0.057 -9.81 0.000 -0.672 -0.448 L1. | 0.315 0.061 5.17 0.000 0.195 0.435 | k | --. | 0.388 0.031 12.55 0.000 0.328 0.449 L1. | -0.081 0.038 -2.09 0.037 -0.156 -0.005 L2. | -0.028 0.033 -0.85 0.397 -0.092 0.037 | ys | --. | 0.469 0.123 3.81 0.000 0.227 0.710 L1. | -0.629 0.158 -3.98 0.000 -0.939 -0.318 L2. | 0.058 0.135 0.43 0.667 -0.206 0.322 | _Iyear_1977 | 0.000 (omitted) _Iyear_1978 | 0.012 0.026 0.46 0.649 -0.039 0.063 _Iyear_1979 | 0.017 0.025 0.67 0.503 -0.032 0.065 _Iyear_1980 | 0.023 0.025 0.93 0.355 -0.026 0.072 _Iyear_1981 | -0.013 0.026 -0.52 0.605 -0.065 0.038 _Iyear_1982 | -0.022 0.023 -0.98 0.328 -0.068 0.023 _Iyear_1983 | -0.016 0.021 -0.77 0.442 -0.057 0.025 _Iyear_1984 | 0.000 (omitted) _cons | 1.780 0.501 3.55 0.000 0.795 2.765 -------------+---------------------------------------------------------------- sigma_u | .22568151 sigma_e | .09395847 rho | .85227336 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(139, 595) = 1.89 Prob > F = 0.0000
- Anderson–Hsiao estimator
*-1.直接估计 ivreg D.n (D.L.n=L2.n) D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys yr1980 yr1981 yr1982 yr1983 yr1984)
Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 611 -------------+---------------------------------- F(15, 595) = 5.84 Model | -24.6768882 15 -1.64512588 Prob > F = 0.0000 Residual | 37.2768667 595 .062650196 R-squared = . -------------+---------------------------------- Adj R-squared = . Total | 12.5999785 610 .020655702 Root MSE = .2503 ------------------------------------------------------------------------------ D.n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | LD. | 2.308 2.000 1.15 0.249 -1.619 6.235 L2D. | -0.224 0.181 -1.23 0.217 -0.580 0.132 | w | D1. | -0.810 0.265 -3.05 0.002 -1.331 -0.289 LD. | 1.422 1.195 1.19 0.235 -0.925 3.770 | k | D1. | 0.253 0.147 1.73 0.085 -0.035 0.541 LD. | -0.552 0.624 -0.89 0.376 -1.777 0.672 L2D. | -0.213 0.243 -0.88 0.382 -0.690 0.265 | ys | D1. | 0.991 0.469 2.11 0.035 0.069 1.912 LD. | -1.938 1.457 -1.33 0.184 -4.800 0.924 L2D. | 0.487 0.517 0.94 0.346 -0.528 1.502 | yr1980 | D1. | -0.017 0.045 -0.39 0.700 -0.105 0.071 | yr1981 | D1. | -0.118 0.115 -1.02 0.307 -0.343 0.108 | yr1982 | D1. | -0.174 0.158 -1.10 0.270 -0.484 0.136 | yr1983 | D1. | -0.224 0.209 -1.07 0.285 -0.634 0.186 | yr1984 | D1. | -0.280 0.273 -1.03 0.305 -0.816 0.255 | _cons | 0.063 0.064 0.98 0.329 -0.063 0.189 ------------------------------------------------------------------------------ Instrumented: LD.n Instruments: L2D.n D.w LD.w D.k LD.k L2D.k D.ys LD.ys L2D.ys D.yr1980 D.yr1981 D.yr1982 D.yr1983 D.yr1984 L2.n -----------------------------------------------------------------------------
*-2.构建年份虚拟变量后估计 tab year,gen(year) ivreg D.n (D.L.n=L2.n) D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys year1 year2 year3 year4 year5 year6 year7 year8 year9)
结果:
. tab year,gen(year) year | Freq. Percent Cum. ------------+----------------------------------- 1976 | 80 7.76 7.76 1977 | 138 13.39 21.14 1978 | 140 13.58 34.72 1979 | 140 13.58 48.30 1980 | 140 13.58 61.88 1981 | 140 13.58 75.46 1982 | 140 13.58 89.04 1983 | 78 7.57 96.61 1984 | 35 3.39 100.00 ------------+----------------------------------- Total | 1,031 100.00 . ivreg D.n (D.L.n=L2.n) D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys year1 year2 year3 year4 year5 year6 year7 year8 year9) Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 611 -------------+---------------------------------- F(15, 595) = 5.84 Model | -24.6768882 15 -1.64512588 Prob > F = 0.0000 Residual | 37.2768667 595 .062650196 R-squared = . -------------+---------------------------------- Adj R-squared = . Total | 12.5999785 610 .020655702 Root MSE = .2503 ------------------------------------------------------------------------------ D.n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | LD. | 2.308 2.000 1.15 0.249 -1.619 6.235 L2D. | -0.224 0.181 -1.23 0.217 -0.580 0.132 | w | D1. | -0.810 0.265 -3.05 0.002 -1.331 -0.289 LD. | 1.422 1.195 1.19 0.235 -0.925 3.770 | k | D1. | 0.253 0.147 1.73 0.085 -0.035 0.541 LD. | -0.552 0.624 -0.89 0.376 -1.777 0.672 L2D. | -0.213 0.243 -0.88 0.382 -0.690 0.265 | ys | D1. | 0.991 0.469 2.11 0.035 0.069 1.912 LD. | -1.938 1.457 -1.33 0.184 -4.800 0.924 L2D. | 0.487 0.517 0.94 0.346 -0.528 1.502 | year1 | D1. | 0.000 (omitted) | year2 | D1. | 0.000 (omitted) | year3 | D1. | 0.000 (omitted) | year4 | D1. | 0.047 0.045 1.03 0.305 -0.043 0.136 | year5 | D1. | 0.076 0.063 1.20 0.230 -0.048 0.201 | year6 | D1. | 0.023 0.056 0.40 0.689 -0.088 0.134 | year7 | D1. | 0.013 0.056 0.23 0.818 -0.096 0.122 | year8 | D1. | 0.010 0.046 0.21 0.830 -0.081 0.101 | year9 | D1. | 0.000 (omitted) | _cons | 0.016 0.028 0.58 0.565 -0.038 0.070 ------------------------------------------------------------------------------ Instrumented: LD.n Instruments: L2D.n D.w LD.w D.k LD.k L2D.k D.ys LD.ys L2D.ys D.year1 D.year2 D.year3 D.year4 D.year5 D.year6 D.year7 D.year8 D.year9 L2.n -----------------------------------------------------------------------------
- DIF-GMM
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n,) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robust small i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm. Warning: Two-step estimated covariance matrix of moments is singular. Using a generalized inverse to calculate robust weighting matrix for Hansen test. Difference-in-Sargan/Hansen statistics may be negative. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 41 Obs per group: min = 4 F(18, 140) = 92.63 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.686 0.147 4.66 0.000 0.395 0.977 L2. | -0.085 0.057 -1.50 0.137 -0.198 0.027 | w | --. | -0.608 0.181 -3.35 0.001 -0.966 -0.249 L1. | 0.393 0.171 2.30 0.023 0.055 0.731 | k | --. | 0.357 0.060 5.94 0.000 0.238 0.476 L1. | -0.058 0.074 -0.78 0.437 -0.205 0.089 L2. | -0.020 0.033 -0.60 0.550 -0.086 0.046 | ys | --. | 0.609 0.176 3.47 0.001 0.261 0.956 L1. | -0.711 0.236 -3.02 0.003 -1.177 -0.245 L2. | 0.106 0.144 0.74 0.463 -0.178 0.390 | _Iyear_1977 | 0.000 (omitted) _Iyear_1978 | 0.008 0.032 0.24 0.810 -0.056 0.071 _Iyear_1979 | 0.017 0.030 0.58 0.561 -0.041 0.076 _Iyear_1980 | 0.030 0.028 1.06 0.293 -0.026 0.085 _Iyear_1981 | -0.004 0.030 -0.13 0.894 -0.064 0.056 _Iyear_1982 | -0.019 0.023 -0.83 0.407 -0.065 0.027 _Iyear_1983 | -0.014 0.019 -0.71 0.479 -0.052 0.024 _Iyear_1984 | 0.000 (omitted) ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(1/8).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -3.60 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.52 Pr > z = 0.606 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(23) = 67.59 Prob > chi2 = 0.000 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(23) = 31.38 Prob > chi2 = 0.114 (Robust, but weakened by many instruments.) Difference-in-Hansen tests of exogeneity of instrument subsets: iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) Hansen test excluding group: chi2(8) = 12.01 Prob > chi2 = 0.151 Difference (null H = exogenous): chi2(15) = 19.37 Prob > chi2 = 0.197
使用lag()选项控制工具变量的滞后期数
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(2 5)) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robust small nomata i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.. 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 33 Obs per group: min = 4 F(14, 139) = 117.25 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 1.017 0.284 3.58 0.000 0.455 1.578 L2. | -0.114 0.051 -2.23 0.027 -0.215 -0.013 | w | --. | -0.659 0.204 -3.22 0.002 -1.064 -0.255 L1. | 0.634 0.325 1.95 0.053 -0.009 1.276 | k | --. | 0.335 0.065 5.12 0.000 0.205 0.464 L1. | -0.158 0.117 -1.35 0.179 -0.391 0.074 L2. | -0.065 0.051 -1.28 0.204 -0.165 0.036 | ys | --. | 0.680 0.198 3.43 0.001 0.289 1.072 L1. | -0.993 0.401 -2.48 0.014 -1.785 -0.201 L2. | 0.235 0.206 1.14 0.257 -0.173 0.642 | _Iyear_1979 | 0.019 0.014 1.41 0.162 -0.008 0.047 _Iyear_1980 | 0.038 0.023 1.62 0.107 -0.008 0.084 _Iyear_1981 | 0.001 0.033 0.03 0.975 -0.064 0.066 _Iyear_1982 | -0.010 0.031 -0.32 0.747 -0.072 0.052 _Iyear_1983 | -0.002 0.031 -0.07 0.941 -0.063 0.059 _Iyear_1984 | 0.010 0.029 0.34 0.734 -0.047 0.066 ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(2/5).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -2.74 Pr > z = 0.006 Arellano-Bond test for AR(2) in first differences: z = -0.67 Pr > z = 0.504 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(17) = 27.69 Prob > chi2 = 0.049 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(17) = 21.79 Prob > chi2 = 0.193 (Robust, but weakened by many instruments.)
-使用or选项向前正交变换
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(2 5)) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robust small nomata i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.. 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 33 Obs per group: min = 4 F(14, 139) = 117.25 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 1.017 0.284 3.58 0.000 0.455 1.578 L2. | -0.114 0.051 -2.23 0.027 -0.215 -0.013 | w | --. | -0.659 0.204 -3.22 0.002 -1.064 -0.255 L1. | 0.634 0.325 1.95 0.053 -0.009 1.276 | k | --. | 0.335 0.065 5.12 0.000 0.205 0.464 L1. | -0.158 0.117 -1.35 0.179 -0.391 0.074 L2. | -0.065 0.051 -1.28 0.204 -0.165 0.036 | ys | --. | 0.680 0.198 3.43 0.001 0.289 1.072 L1. | -0.993 0.401 -2.48 0.014 -1.785 -0.201 L2. | 0.235 0.206 1.14 0.257 -0.173 0.642 | _Iyear_1979 | 0.019 0.014 1.41 0.162 -0.008 0.047 _Iyear_1980 | 0.038 0.023 1.62 0.107 -0.008 0.084 _Iyear_1981 | 0.001 0.033 0.03 0.975 -0.064 0.066 _Iyear_1982 | -0.010 0.031 -0.32 0.747 -0.072 0.052 _Iyear_1983 | -0.002 0.031 -0.07 0.941 -0.063 0.059 _Iyear_1984 | 0.010 0.029 0.34 0.734 -0.047 0.066 ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(2/5).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -2.74 Pr > z = 0.006 Arellano-Bond test for AR(2) in first differences: z = -0.67 Pr > z = 0.504 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(17) = 27.69 Prob > chi2 = 0.049 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(17) = 21.79 Prob > chi2 = 0.193 (Robust, but weakened by many instruments.) . xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n) iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year) nolevel robus small or i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm. Warning: Two-step estimated covariance matrix of moments is singular. Using a generalized inverse to calculate robust weighting matrix for Hansen test. Difference-in-Sargan/Hansen statistics may be negative. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 42 Obs per group: min = 4 F(18, 140) = 109.69 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.653 0.083 7.87 0.000 0.489 0.817 L2. | -0.100 0.073 -1.38 0.170 -0.244 0.043 | w | --. | -0.558 0.157 -3.56 0.001 -0.867 -0.248 L1. | 0.272 0.133 2.04 0.043 0.009 0.535 | k | --. | 0.398 0.059 6.78 0.000 0.282 0.514 L1. | -0.058 0.055 -1.04 0.300 -0.167 0.052 L2. | -0.033 0.042 -0.80 0.427 -0.117 0.050 | ys | --. | 0.455 0.171 2.66 0.009 0.116 0.794 L1. | -0.579 0.197 -2.93 0.004 -0.969 -0.189 L2. | 0.034 0.141 0.24 0.811 -0.245 0.313 | _Iyear_1977 | 0.000 (omitted) _Iyear_1978 | 0.012 0.030 0.38 0.703 -0.049 0.072 _Iyear_1979 | 0.014 0.030 0.48 0.632 -0.045 0.074 _Iyear_1980 | 0.020 0.029 0.71 0.482 -0.037 0.077 _Iyear_1981 | -0.015 0.028 -0.54 0.588 -0.071 0.041 _Iyear_1982 | -0.025 0.021 -1.21 0.229 -0.067 0.016 _Iyear_1983 | -0.018 0.020 -0.90 0.368 -0.058 0.022 _Iyear_1984 | 0.000 (omitted) ------------------------------------------------------------------------------ Instruments for orthogonal deviations equation Standard FOD.(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(1/8).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -4.95 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.10 Pr > z = 0.918 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(24) = 62.01 Prob > chi2 = 0.000 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(24) = 31.62 Prob > chi2 = 0.137 (Robust, but weakened by many instruments.) Difference-in-Hansen tests of exogeneity of instrument subsets: iv(L2.n w L.w k L.k L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) Hansen test excluding group: chi2(9) = 11.52 Prob > chi2 = 0.242 Difference (null H = exogenous): chi2(15) = 20.10 Prob > chi2 = 0.168
-使用更多工具变量
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n, lag(1 .)) gmm(w, lag(2 .)) gmm(L.w) gmm(L.k) gmm(k, lag(2 .)) iv(L2.n L2.k ys L.ys L2.ys i.year) > nolevel robust small i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm. Warning: Two-step estimated covariance matrix of moments is singular. Using a generalized inverse to calculate robust weighting matrix for Hansen test. Difference-in-Sargan/Hansen statistics may be negative. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 90 Obs per group: min = 4 F(18, 140) = 75.56 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.818 0.086 9.50 0.000 0.648 0.988 L2. | -0.112 0.050 -2.23 0.027 -0.212 -0.013 | w | --. | -0.682 0.143 -4.77 0.000 -0.964 -0.399 L1. | 0.656 0.203 3.23 0.002 0.255 1.056 | k | --. | 0.353 0.122 2.89 0.004 0.111 0.594 L1. | -0.154 0.086 -1.78 0.078 -0.325 0.017 L2. | -0.030 0.032 -0.95 0.346 -0.094 0.033 | ys | --. | 0.651 0.190 3.43 0.001 0.275 1.026 L1. | -0.916 0.264 -3.47 0.001 -1.439 -0.394 L2. | 0.279 0.186 1.50 0.136 -0.089 0.646 | _Iyear_1977 | 0.000 (omitted) _Iyear_1978 | 0.000 (omitted) _Iyear_1979 | 0.011 0.009 1.23 0.221 -0.007 0.030 _Iyear_1980 | 0.026 0.017 1.52 0.132 -0.008 0.061 _Iyear_1981 | -0.014 0.029 -0.47 0.640 -0.071 0.044 _Iyear_1982 | -0.035 0.030 -1.16 0.246 -0.095 0.024 _Iyear_1983 | -0.031 0.035 -0.88 0.381 -0.100 0.039 _Iyear_1984 | -0.024 0.037 -0.65 0.518 -0.097 0.049 ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(L2.n L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(2/8).k L(1/8).L.k L(1/8).L.w L(2/8).w L(1/8).L.n ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -5.39 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.78 Pr > z = 0.436 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(72) = 120.62 Prob > chi2 = 0.000 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(72) = 73.72 Prob > chi2 = 0.422 (Robust, but weakened by many instruments.) Difference-in-Hansen tests of exogeneity of instrument subsets: gmm(L.n, lag(1 .)) Hansen test excluding group: chi2(46) = 43.99 Prob > chi2 = 0.557 Difference (null H = exogenous): chi2(26) = 29.72 Prob > chi2 = 0.279 gmm(w, lag(2 .)) Hansen test excluding group: chi2(65) = 73.72 Prob > chi2 = 0.215 Difference (null H = exogenous): chi2(7) = 0.00 Prob > chi2 = 1.000 gmm(L.w, lag(1 .)) Hansen test excluding group: chi2(52) = 73.72 Prob > chi2 = 0.025 Difference (null H = exogenous): chi2(20) = 0.00 Prob > chi2 = 1.000 gmm(L.k, lag(1 .)) Hansen test excluding group: chi2(67) = 73.72 Prob > chi2 = 0.268 Difference (null H = exogenous): chi2(5) = 0.00 Prob > chi2 = 1.000 gmm(k, lag(2 .)) Hansen test excluding group: chi2(51) = 73.72 Prob > chi2 = 0.020 Difference (null H = exogenous): chi2(21) = 0.00 Prob > chi2 = 1.000 iv(L2.n L2.k ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) Hansen test excluding group: chi2(61) = 56.99 Prob > chi2 = 0.622 Difference (null H = exogenous): chi2(11) = 16.72 Prob > chi2 = 0.116
一步法与两步法的比较
. xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n L.w L.k) iv(ys L.ys L2.ys i.year) nolevel robust small nomata //一步法 i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.... 2 instrument(s) dropped because of collinearity. Estimating. Performing specification tests. Dynamic panel-data estimation, one-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 90 Obs per group: min = 4 F(14, 139) = 90.85 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Robust n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.818 0.086 9.51 0.000 0.648 0.988 L2. | -0.112 0.050 -2.23 0.027 -0.212 -0.013 | w | --. | -0.682 0.143 -4.78 0.000 -0.964 -0.400 L1. | 0.656 0.202 3.24 0.001 0.256 1.056 | k | --. | 0.353 0.122 2.89 0.004 0.112 0.593 L1. | -0.154 0.086 -1.78 0.077 -0.324 0.017 L2. | -0.030 0.032 -0.95 0.345 -0.094 0.033 | ys | --. | 0.651 0.190 3.43 0.001 0.276 1.026 L1. | -0.916 0.264 -3.47 0.001 -1.438 -0.394 L2. | 0.279 0.186 1.50 0.135 -0.088 0.645 | _Iyear_1979 | 0.011 0.009 1.23 0.220 -0.007 0.030 _Iyear_1980 | 0.026 0.017 1.52 0.131 -0.008 0.061 _Iyear_1981 | -0.014 0.029 -0.47 0.639 -0.071 0.044 _Iyear_1982 | -0.035 0.030 -1.17 0.245 -0.094 0.024 _Iyear_1983 | -0.031 0.035 -0.88 0.380 -0.100 0.038 _Iyear_1984 | -0.024 0.037 -0.65 0.517 -0.097 0.049 ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(1/.).(L.n L.w L.k) ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -5.39 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.78 Pr > z = 0.436 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(74) = 120.62 Prob > chi2 = 0.001 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(74) = 73.72 Prob > chi2 = 0.487 (Robust, but weakened by many instruments.) . xi:xtabond2 n L.n L2.n w L.w k L.k L2.k ys L.ys L2.ys i.year, gmm(L.n L.w L.k) iv(ys L.ys L2.ys i.year) two nolevel robust small nomata //两步法 i.year _Iyear_1976-1984 (naturally coded; _Iyear_1976 omitted) _Iyear_1977 dropped because of collinearity. _Iyear_1978 dropped because of collinearity. Building GMM instruments.... 2 instrument(s) dropped because of collinearity. Estimating. Computing Windmeijer finite-sample correction............................................................................................................................... > .............. Performing specification tests. Dynamic panel-data estimation, two-step difference GMM ------------------------------------------------------------------------------ Group variable: id Number of obs = 611 Time variable : year Number of groups = 140 Number of instruments = 90 Obs per group: min = 4 F(14, 139) = 78.27 avg = 4.36 Prob > F = 0.000 max = 6 ------------------------------------------------------------------------------ | Corrected n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- n | L1. | 0.824 0.097 8.51 0.000 0.633 1.016 L2. | -0.101 0.053 -1.90 0.059 -0.207 0.004 | w | --. | -0.711 0.152 -4.67 0.000 -1.013 -0.410 L1. | 0.631 0.178 3.54 0.001 0.279 0.984 | k | --. | 0.377 0.135 2.79 0.006 0.110 0.643 L1. | -0.169 0.113 -1.49 0.137 -0.392 0.055 L2. | -0.058 0.044 -1.32 0.191 -0.145 0.029 | ys | --. | 0.662 0.170 3.89 0.000 0.325 0.999 L1. | -0.943 0.259 -3.65 0.000 -1.454 -0.432 L2. | 0.361 0.196 1.84 0.068 -0.027 0.748 | _Iyear_1979 | 0.017 0.010 1.73 0.086 -0.002 0.036 _Iyear_1980 | 0.030 0.016 1.83 0.070 -0.002 0.062 _Iyear_1981 | -0.012 0.027 -0.44 0.663 -0.066 0.042 _Iyear_1982 | -0.022 0.031 -0.71 0.481 -0.084 0.040 _Iyear_1983 | -0.005 0.039 -0.12 0.905 -0.082 0.072 _Iyear_1984 | -0.002 0.044 -0.03 0.972 -0.088 0.085 ------------------------------------------------------------------------------ Instruments for first differences equation Standard D.(ys L.ys L2.ys _Iyear_1977 _Iyear_1978 _Iyear_1979 _Iyear_1980 _Iyear_1981 _Iyear_1982 _Iyear_1983 _Iyear_1984) GMM-type (missing=0, separate instruments for each period unless collapsed) L(1/.).(L.n L.w L.k) ------------------------------------------------------------------------------ Arellano-Bond test for AR(1) in first differences: z = -3.92 Pr > z = 0.000 Arellano-Bond test for AR(2) in first differences: z = -0.77 Pr > z = 0.441 ------------------------------------------------------------------------------ Sargan test of overid. restrictions: chi2(74) = 120.62 Prob > chi2 = 0.001 (Not robust, but not weakened by many instruments.) Hansen test of overid. restrictions: chi2(74) = 73.72 Prob > chi2 = 0.487 (Robust, but weakened by many instruments.)
参考资料
-
农产品电商发展对农业转型升级的倒逼效应——基于省际静态与动态面板数据的实证分析.pdf
2021-07-10 01:37:26农产品电商发展对农业转型升级的倒逼效应——基于省际静态与动态面板数据的实证分析.pdf -
农产品电商发展对农业转型升级的倒逼效应——基于省际静态与动态面板数据的实证分析.zip
2021-10-29 00:54:07农产品电商发展对农业转型升级的倒逼效应——基于省际静态与动态面板数据的实证分析 -
论文研究 - 西非贸易开放度,外国直接投资与经济增长之间的关系:静态面板数据模型
2020-05-15 02:55:17采用静态面板回归技术来评估我们回归变量的因果关系,即FDI,贸易开放度,投资和通货膨胀与以国内生产总值(GDP)衡量的经济增长。 进行了Levin-Lin-Chu单位根检验,以发现面板数据的平稳性。 统计分析的证据表明,... -
浙江大学【面板数据分析与STATA应用】——第一讲短面板数据分析
2020-07-18 18:39:49动态面板和静态面板 平衡面板和非平衡面板 截面数大于时间数就是短面板,反之,则为长面板 解释变量包含被解释变量的滞后值则为动态面板,反之,则为静态面板 平衡面板:每个个体在想他的时间内都有观测值记录,...基本概念
面板数据及分类
面板数据分类:
- 短面板和长面板
- 动态面板和静态面板
- 平衡面板和非平衡面板
截面数大于时间数就是短面板,反之,则为长面板
解释变量包含被解释变量的滞后值则为动态面板,反之,则为静态面板
平衡面板:每个个体在想他的时间内都有观测值记录,For any I, there are T observations. 反之,则为非平衡面板面板数据的优点:
1. 可以处理有不可观测的个体异质性所导致的内生性问题
2. 提供更多个体动态行为的信息
不足之处:
1. 大多数面板数据分析技术都是针对短面板
2. 寻找面板数据结构的工具变量不是很容易面板数据模型
非观测效应模型
a.固定效应模型
b.随机效应模型
混合回归模型
面板数据模型的估计和修正方法
- 固定效应模型的估计
对固定效应模型的估计有两种方法:
固定效应变换(组内变换)与LSDV(最小二乘虚拟变量法)
a. 固定效应变换(组内变换)
固定效应变换的优缺点
优点:即使个体效应与解释变量相关也可以得到一致估计;
缺点:无法估计不随时间而变的变量的影响。固定效应的STATA命令
xtreg y x,fe xi:xtreg y x i.year,fe tab year,gen(year)
b. LSDV思想
STATA命令:- 不存在时间效应: xi:reg y x i.code
- 存在时间效应:xi:reg y x i.code i.year
- 随机效应模型
对随机效应模型的估计方法是广义最小二乘法
STATA命令:
- 不存在时间效应:xtreg y x ,re
- 存在时间效应:xi: reg y x i.year,re
第一讲案例
- 导入数据及查看数据描述
. use "D:\traffic.dta" # 导入数据 . des #查看数据描述
显示:
obs: 336 vars: 54 30 Nov 2008 15:45 -------------------------------------------------------------------------------- storage display value variable name type format label variable label -------------------------------------------------------------------------------- state float %9.0g sid State ID (FIPS) Code year int %9.0g Year spircons float %9.0g Spirits Consumption unrate float %9.0g Unemployment Rate perinc float %9.0g Per Capita Personal Income emppop float %9.0g Employment/Population Ratio beertax float %9.0g Tax on Case of Beer sobapt float %9.0g % Southern Baptist mormon float %9.0g % Mormon ....等等
- 描述性统计
格式: sum + 变量名
. sum beertax Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- beertax | 336 .513256 .4778442 .0433109 2.720764 twoway (scatter fatal beertax)(lfit fatal beertax) # 核心变量和被解释变量的散点图并画出回归直线
xtline fatal # 画出核心变量的时间序列图
3. 模型选择
选择PLS 还是 FE?. tab year, gen(year) . xtreg fatal beertax spircons unrate perinck year2-year7, fe
Fixed-effects (within) regression Number of obs = 336 Group variable: state Number of groups = 48 R-sq: Obs per group: within = 0.4528 min = 7 between = 0.1090 avg = 7.0 overall = 0.0770 max = 7 F(10,278) = 23.00 corr(u_i, Xb) = -0.8728 Prob > F = 0.0000 ------------------------------------------------------------------------------ fatal | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- beertax | -0.435 0.154 -2.82 0.005 -0.738 -0.132 spircons | 0.806 0.113 7.15 0.000 0.584 1.028 unrate | -0.055 0.010 -5.31 0.000 -0.075 -0.035 perinck | 0.088 0.020 4.41 0.000 0.049 0.128 year2 | -0.053 0.030 -1.77 0.078 -0.113 0.006 year3 | -0.165 0.037 -4.40 0.000 -0.239 -0.091 year4 | -0.200 0.042 -4.80 0.000 -0.282 -0.118 year5 | -0.051 0.052 -0.99 0.325 -0.152 0.051 year6 | -0.100 0.059 -1.69 0.091 -0.216 0.016 year7 | -0.134 0.068 -1.98 0.049 -0.267 -0.001 _cons | 0.129 0.431 0.30 0.765 -0.720 0.978 -------------+---------------------------------------------------------------- sigma_u | 1.0987683 sigma_e | .14570531 rho | .98271904 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(47, 278) = 64.52 Prob > F = 0.0000
- 模型检验
截面相关检验
. xtcsd, pes Pesaran's test of cross sectional independence = -1.716, Pr = 1.9138
如果截面相关
-
R&D投入对中国高技术产业的影响--基于静态和动态的面板数据模型的实证研究
2020-03-12 21:48:15R&D投入对中国高技术产业的影响--基于静态和动态的面板数据模型的实证研究,马岳红,,利用1996-2007年我国高技术产业9个分行业面板数据,基于柯布道格拉斯生产函数,考察了研发投入对高技术产业产出增长的贡献。... -
【金融计量学】面板数据(自用笔记,第一次写)
2021-10-13 21:05:38动态/静态面板数据。 面板数据中包含两种效应: 1. 个体效应:不随时间推移而明显变化的因素,如消费者的收入、产品的价格、个人消费习惯、社会制度等。 2. 时间效应:在单个截面中难以分析,随时间推移才体现...一、简介
面板数据的分类:平衡/非平衡面板数据;动态/静态面板数据。
面板数据中包含两种效应:
1. 个体效应:不随时间推移而明显变化的因素,如消费者的收入、产品的价格、个人消费习惯、社会制度等。
2. 时间效应:在单个截面中难以分析,随时间推移才体现出差异的因素。
二、静态面板数据模型
“静态”意味着解释变量不包含前期的被解释变量值。v.s.动态~包含。
就是个体效应。
两种模型,代表两种处理个体效应的方式:
1. 固定效应模型:个体效应不随时间改变,每个个体都有一个特定的截距项。
2. 随机效应模型(误差成分模型):所有个体具有相同截距项,个体差异主要反映在随机干扰项的设定上。
2.1.1固定效应模型-虚拟变量法(适用于截面中的样本量不多的情况)
import excel using B7introFe.xlsx, first clear browse tab id , gen(dum) //为每一个id(每家公司)产生一个哑变量 reg y x dum1 dum2 dum3, nocons //模型内有三个dum,没有常数项,每个id有自己的截距项,即对应dum的系数。 est store m_pooldum1 //保存结果
结果如下图。右上角可以看到Adj R-squared就是调整R方。
也可以保留常数项,去掉dum1,稍加运算也可以得到其他截距项。
reg y x dum2 dum3 est store m_pooldum2
2.1.2固定效应模型-stata的估计方法
tsset id t //顺序不要弄反 xtreg y x,fe est store m_fe
tsset -- Declare data to be time-series data
tsset timevar [, options]
tsset panelvar timevar [, options]
xtreg -- Fixed-, between-, and random-effects and population-averaged linear models
fe表示固定效应模型Fixed-effects (FE) model
-
面板数据回归:R语言code
2021-03-07 02:56:44result: stationary ## 协整检验 # Engle-Granger reg(datas$hp~datas$lp+datas$Ltax+datas$PCGDP) summary(reg) error(reg) adf.test(error) # result: residuals stationary ### 面板数据回归 hpdatas(datas,... -
基于面板数据超效率DEA模型的区域科普绩效评价研究
2019-12-28 04:22:33基于面板数据超效率DEA模型的区域科普绩效评价研究,张立军,张梦莹,科普建设是一个动态的过程,对区域科普绩效进行综合评价必须考虑其变化发展的动态趋势。针对静态评价不能反映出科普绩效动态发展 -
基于灰色可能度函数的面板数据聚类方法
2021-01-12 18:53:28针对静态灰色可能度函数聚类方法的局限性,综合考虑评价指标发展趋势、指标权重和时间权重的影响,构建一种体现发展趋势的灰色可能度函数聚类模型用于解决面板数据问题.该方法引入发展因子概念,用于表示观测值的发展... -
我国环保企业生产效率及不确定性——基于面板数据的DEA与神经网络分析
2020-05-04 19:53:25环境保护产业作为中国战略性新兴产业之一,为新一轮中国经济增长增添动力。同时,它也是中国促进可...利用DEA方法对2004-2010年各企业面板数据分析企业的生产效率,同时利用神经网络模拟预测其2011年到2015年发展前景。 -
数据可视化大屏资料合集(网上收集的几十种样式的html静态页)
2019-03-27 09:53:52数据可视化大屏资料合集(网上收集的几十种样式的html静态页)(可能有重复) -
在R语言中进行面板数据分析
2020-12-23 02:34:54在R语言中进行面板数据分析面板数据(PanelData)是截面数据与时间序列数据综合起来的一种数据类型。它有时间序列和截面两个维度,当这类数据按两个维度排列时,是排在一个平面上,与只有一个维度的数据排在一条线上... -
FAST馈源舱的静态定标和动态跟踪
2020-08-31 11:57:35根据计算机视觉和CCD图像分析测量原理,介绍了对FAST馈源舱多个位置和姿态的静态定标,以及对舱体...推导了实验中所需馈源舱的空间坐标变换矩阵,实现了对馈源舱的动态跟踪,并为舱体的闭环控制提供了数据基础。 -
基于面板数据的长三角金融业集聚的动态研究
2020-01-16 13:53:55基于面板数据的长三角金融业集聚的动态研究,徐爱华,管驰明,本文打破传统二维的静态评价思路,从时间、空间和指标三维结构出发,通过因子分析对金融集聚的影响因素和发展趋势进行了分析,将 -
面板数据模型估计一般要做哪些步骤?
2020-12-22 17:23:45步骤一:分析数据的平稳性(单位根检验)按照正规程序,面板数据模型在回归前需检验数据的平稳性。李子奈曾指出,一些非平稳的经济时间序列往往表现出共同的变化趋势,而这些序列间本身不一定有直接的关联,此时,对... -
小白学统计|面板数据分析与Stata应用笔记(一)
2020-04-25 14:13:11小白学统计|面板数据分析与Stata应用笔记(一) 文章首发于公众号 「如风起」。 原文链接: 小白学统计|面板数据分析与Stata应用笔记(一) 面板数据分析与Stata应用笔记整理自慕课上浙江大学方红生教授的面板数据... -
c++静态库与动态库的区别
2015-08-29 12:46:571)静态链接库就是你使用的.lib文件,库中得代码最后需要连接到你的可执行文件中去,所以静态连接的可执行文件一般比较大一些。 使用方法 1> 格式如:#pragma comment(lib,"XXX.lib") 2> 针对开发... -
宝塔linux面板 伪静态,宝塔面板安装织梦TAG不能伪静态的解决方法
2021-05-17 11:19:02宝塔软件是一款linux/windows平台均可使用的服务器管理软件,自带环境包;主要基于centos操作系统,可一键...不得不说宝塔面板确实很人性化,包括后台设计的都很简洁,可以查看到服务器使用的情况,安装数据库也很方... -
Element中的Cascader(级联列表)动态加载省\市\区数据的方法
2020-10-17 06:06:54主要介绍了Element中的Cascader(级联列表)动态加载省市区数据的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧 -
面板数据分析
2020-09-02 21:52:33文章目录前言一、面板数据数据性质变量相关性二、三大问题截面相关自相关异方差三、FE VS RE 前言 面板数据(panel data)在现代社会中十分重要,常见在计量经济学之中。截面数据与时间序列数据,是其退化版本,本文... -
协整理论与面板数据分析
2018-06-10 23:53:11转载自:http://blog.sina.com.cn/s/blog_458bb22d0100x9rl.html面板数据分析方法步骤全解 步骤一:分析数据的平稳性(单位根检验) 按照正规程序,面板数据模型在回归前需检验数据的平稳性。李子奈曾指出,一些非... -
用eviews怎么做面板数据的多元回归分析呀?
2020-12-28 19:38:45按照正规程序,面板数据模型在回归前需检验数据的平稳性。步骤一:分析数据的平稳性(单位根检验)按照正规程序,面板数据模型在回归前需检验数据的平稳性。李子奈曾指出,一些非平稳的经济时间序列往往表现出共同的... -
宝塔面板安装织梦TAG不能伪静态的解决方法
2021-05-17 11:19:02宝塔软件是一款linux/windows平台均可使用的服务器管理软件,自带环境包;主要基于centos操作系统,可一键...不得不说宝塔面板确实很人性化,包括后台设计的都很简洁,可以查看到服务器使用的情况,安装数据库也很方... -
中国与东盟服务贸易竞争力和贸易流量研究-基于引力模型面板数据
2020-01-16 05:09:27中国与东盟服务贸易竞争力和贸易流量研究-基于引力模型面板数据,严敏,,本文从实证分析的角度,构造静态和动态的服务贸易竞争力指数分析了中国与东盟主要五国之间服务贸易在国际市场上的竞争力水平和地 -
面板数据固定效应 vs. 随机效应
2021-01-12 20:25:26原标题:面板数据固定效应 vs. 随机效应来源:不止点滴 一般来说,经济数据有三种类型:横截面数据(包括混合横截面数据)、面板数据和时间序列数据。对于应用微观研究而言,主要还是采用前两种数据类型,时间序列数据... -
扩展easyui数据表格datagrid,静态数据自动分页
2021-05-14 15:45:42这次的扩展可以优化数据表格在某些应用场景下的性能。比如不方便请求后端,或不方便频繁请求后端的场景。 扩展代码如下: /* 扩展easyui面板pagination,分页汉化 */ $.extend($.fn.pagination.defaults, { ...