Stata:面板数据计量方法汇总 |
您所在的位置:网站首页 › gls是什么意思计量经济学 › Stata:面板数据计量方法汇总 |
xtpcseOLS or Prais-Winsten models with panel-corrected standard errors xthtaylorHausman-Taylor estimator for error-components models xtfrontierStochastic frontier models for panel data xtrcRandom coefficients models xtivregInstrumental variables and two-stage least squares for panel-data models xtunitrootPanel-data unit-root tests xtabondArellano-Bond linear dynamic panel-data estimator xtdpdsys Arellano-Bond/Blundell-Bond estimation xtdpd Linear dynamic panel-data estimation xttobitRandom-effects tobit models xtintregRandom-effects interval-data regression models xtlogit Fixed-effects, random-effects, & population-averaged logit models xtprobitRandom-effects and population-averaged probit models xtcloglogRandom-effects and population-averaged cloglog models xtpoissonFixed-effects, random-effects, & population-averaged Poisson models xtnbregFixed-effects, random-effects, & population-averaged negative binomial models xtmelogit Multilevel mixed-effects logistic regression xtmepoissonMultilevel mixed-effects Poisson regression xtgee Population-averaged panel-data models using GEE 三.面板数据随机效应与固定效应检验 模型设定过程中最为关键同时也是最难的一步,在这方面功力的提高还需要大量的实践经验和对理论的深入理解。 1)检验个体效应的显著性。我们做固定效应模型时,F检验表明固定效应模型由于混合OLS模型。下面我们说明如何检验随机效应是否显著,命令为:xttest0。若P 值为0.0000,表明随机效应非常显著。 2)Hausman检验。具体步骤为: step1:估计固定效应模型,存储估计结果; step2:估计随机效应模型,存储估计结果; step3:进行Hausman检验; 命令为: xtreg GDP FDI EX IM, fe /*step1*/ eststore fe xtreg GDP FDI EX IM, re /*step2*/ eststore re hausman fe re/*step3*/ eststore 的作用在于把估计结果存储到名称为fe,re的临时性文件中。然后我们就可以根据Hausman检验的值进行模型的选择了。注意 Hausman检验需要将fe放在re前面。 四.动态面板数据模型 对于面板数据,如果观测到被解释变量随时间而改变,则开启了动态面板对参数估计的可能性。动态面板模型设定了一个个体的被解释变量部分取决于前一期的值。当被解释变量的滞后一期或者多期出现在解释变量中。 对于短面板数据来说,需要研究短面板的固定效应模型估计,使用一阶差分消除固定效应。通过解释变量的适当滞后期作为工具变量对一阶差分模型中的参数进行IV估计可以得到一致估计量。但是Stata有一些固定的命令,可以直接进行动态面板估计。如:xtabond、xtdpdsys、xtdpd。以上这些命令使得模型更加容易估计,同时也提供了相关的一些检验。 关于xtabond命令的stata动态面板数据 另外,Stata有个命令xtabond2,作者是:David Roodman, http://www.cgdev.org/content/expert/detail/2719/ 写过abarnewey2ivvifcollapse2等。 xtabond2的详细说明: How to Do xtabond2:An Introduction to “Difference” and “System” GMM in Stata http://www.cgdev.org/files/11619_file_HowtoDoxtabond8_with_foreword.pdf 还有专门介绍的PPT: repec.org/nasug2006/How2Do_xtabond2.ppt 五.静态面板数据操作简介 首先对面板数据进行声明: 前面是截面单元,后面是时间标识: tsset company year tsset industry year 产生新的变量:gennewvar=human*lnrd 产生滞后变量Genfiscal(2)=L2.fiscal 产生差分变量Genfiscal(D)=D.fiscal 描述性统计 xtdes :对Panel Data截面个数、时间跨度的整体描述 Xtsum:分组内、组间和样本整体计算各个变量的基本统计量 xttab 采用列表的方式显示某个变量的分布 Stata中用于估计面板模型的主要命令:xtreg xtreg depvar [varlist] [if exp] , model_type [level(#) ] Model type 模型 be Between-effects estimator fe Fixed-effects estimator re GLSRandom-effects estimator pa GEEpopulation-averaged estimator mle Maximum-likelihood Random-effectsestimator xtreg命令的应用 声明面板数据类型:xtset 描述性统计:xtsum gdp investsci admin 1.固定效应模型估计: xtreg gdp invest culture sci health admin techno,fe 固定效应模型中个体效应和随机干扰项的方差估计值(分别为sigma u 和sigma e),二者之间的相关关系(rho) 最后一行给出了检验固定效应是否显著的F 统计量和相应的P 值 2.随机效应模型估计: xtreg gdp invest culture sci health admin techno,re 检验随机效应模型是否优于混合OLS 模型: 在进行随机效应回归之后,使用xttest0 检验得到的P 值为0.0000,表明随机效应模型优于混合OLS 模型 3. 最大似然估计Ml: xtreg gdp invest culture sci health admin techno,mle Hausman检验 Hausman检验究竟选择固定效应模型还是随机效应模型: 第一步:估计固定效应模型,存储结果 xtreg gdp invest culture sci health admin techno,fe est store fe 第二步:估计随机效应模型,存储结果 xtreg gdp invest culture sci health admin techno,re est store re 第三步:进行hausman检验 hausman fe Hausman检验量为: H=(b-B)´[Var(b)-Var(B)]-1(b-B)~x2(k) Hausman统计量服从自由度为k的χ2分布。当H大于一定显著水平的临界值时,我们就认为模型中存在固定效应,从而选用固定效应模型,否则选用随机效应模型 如果hausman检验值为负,说明的模型设定有问题,导致Hausman 检验的基本假设得不到满足,遗漏变量的问题,或者某些变量是非平稳等等 可以改用hausman检验的其他形式: hausman fe, sigmaless 对于固定效应模型的异方差检验和序列相关检验: Xtserial gdp invest culture sci health admin techno 异方差检验: xtreg gdp invest culture sci health admin techno,fe xttest3 (Modified Wald statistic for groupwise heteroskedasticity in fixedeffect model) 随机效应模型的序列相关检验: xtreg gdp invest culture sci health admin techno,re Xttest1 Xttest1用于检验随机效应(单尾和双尾) 、一阶序列相关以及两者的联合显著 检验结果表明存在随机效应和序列相关,而且对随机效应和序列相关的联合检验也非常显著 可以使用广义线性模型xtgls对异方差和序列相关进行修正: xtgls gdp invest culture sci health admin techno, panels(hetero),修正异方差 xtgls gdp invest culture sci health admin techno, panels(correlated),修正依横截面而变化的异方差 xtgls gdp invest culture sci health admin techno, panels(hetero) corr(ar1),修正异方差和一阶序列相关ar(1)返回搜狐,查看更多 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |