当前位置:文档之家› 短面板数据分析的基本程序

短面板数据分析的基本程序


Stata’s estimation commands with option robust also contain a cluster() option and it is this option which allows the computation of socalled Rogers or clustered standard errors.
company 1 year 1951 invest 755.9 mvalue 4833
1
1ห้องสมุดไป่ตู้
1952
1953
891.2
1304.4
4924.9
6241.7
1
2 2 2 2 3 3 3
1954
1951 1952 1953 1954 1951 1952 1953
1486.7
588.2 645.5 641 459.3 135.2 157.3 179.5
例如:共有7个州,方程可以写成:
Yit 0 1 Xit 1D1 2 D2 3D3 4 D4 5 D5 6 D6 ui
7个州的回归线斜率相同,但截距不同。
1 0 第2个州的截距是: 2 0 1 第3个州的截距是: 3 0 2 第4个州的截距是: 4 0 3
模型的估计
固定效应模型 固定效应变换(Fixed Effects Transformation) (组内变换)(Within Transformation) LSDV (Least Square Dummy Variable
固定效应变换

Yit 1 X it i it
PLS or RE xtreg fatal beertax spircons unrate perinck year2-year7,re xttest0/xttest1(AR(1))
PLS or RE
FE or RE Hausman test1 xtreg fatal beertax spircons unrate perinck year2year7, fe est store FE xtreg fatal beertax spircons unrate perinck year2year7, re hausman FE, sigmamore
y it xit ui it i 1,...n; t 1,...,T 其中u i为不可观测的个体效应 如果u i与所有解释变量不相关 ,则为随机效应模型
混合回归模型(Pooled Regression Model)
如果u i 0,即不存在个体效应,则 为混合回归模型: y it xit it i 1,...n; t 1,...,T
短面板数据分析的基本程序
方红生
浙江大学经济学院 2013年秋
参考书
计量经济学导论第四版(伍德里奇)中文版或 英文版 用Stata学计量经济学 高级计量经济学及stata应用(陈强)
内容安排
第 1讲 第 2讲 第 3讲 第 4讲 第 5讲 第 6讲 短面板数据分析 长面板数据分析(PPT 内生性与工具变量法 动态面板数据模型 双重差分模型及其应用 基于DID的权威文献做对了吗? (学生报告与讨论) 第7讲 PSMDID 第8讲 如何识别核心变量的作用机制?
Testing for Cross-sectional Dependence
xtcsd
xttest2
短面板
长面板
xtcsd is a postestimation command valid for use after running an FE or RE model. xtcsd can also perform Pesaran’s CD test for unbalanced panels.
短面板数据
面板数据(panel data)是同时在时间和截面上
取得的二维数据,也称时间序列与截面混合数
据(pooled time series and cross section data)。
是在一段时间内跟踪同一组个体的数据。既有
横截面的维度(n个个体),又有时间维度(T
个时期)。
Stata中面板数据结构
use traffic.dta des
面板数据模型
非观测效应模型(unobserved effects model) 固定效应模型(Fixed Effects Model, FE) 随机效应模型(Random Effects Model, RE) 混合回归模型(Pooled Regression Model)

RE, FE and PLS
Pooled OLS: Fixed Effects Estimator:

0
1
0,RE OLS( i 相对u i 不重要时) 1, RE FE(相对重要时)
Stata 命令
xtreg xi:xtreg ,re i.year ,re
(式1)
给定第i 个个体,将(式1)两边对时间取平均可得,
Yi 1 X i i i
(式2)
(式1) – (式2)得:

,则
可以用OLS方法估计β ,称为“固定效应估计量” ˆ FE (Fixed Effects Estimator),记为
ˆ FE主要使用了每个个体的组内离差信息,故 由于 也称为“组内估计量”(within estimator)。
第3步:模型选择
PLS or FE tab year, gen(year) 1. xtreg fatal beertax spircons unrate perinck year2year7,fe
这里误差项可能存在自相关、异方差和截面 相关问题,所以F检验显示的结果可能不可靠, 所以严格的话,首先要检验是否存在截面相关 问题,命令如下: xtcsd,pes xtcsd,fri xtcsd,fre
北京
北京 北京
1
1 1
2006
2007 2008
天津
天津
2
2
2000
2001
短面板:N>T;反之为长面板。
平衡面板数据(balanced panel data):如果每
个个体在相同的时间内都有观测值记录。
For any i, there are T observations.
非平衡面板数据(unbalanced panel):T may
第1个州的截距是:
Stata 命令
xi: reg xi: reg i.code i.code i.year
随机效应模型估计
GLS
The usual pooled OLS can give consistent estimators ,but as its standard errors ignore the positive serial correlation in the composite error term, they will be incorrect.
it i it
2 2 2 Corr( it , is ) /( ),t s
Solution: GLS transformation to eliminate the : serial correlation
yit yi 0 (1 ) 1 ( xit1 xi1 ) ... k ( xitk xik ) ( it i )
5593.6
2289.5 2159.4 2031.3 2115.5 1819.4 2079.7 2371.6
3
1954
189.6
2759.9
region 北京 北京 北京 北京 北京 北京
code 1 1 1 1 1 1
year 2000 2001 2002 2003 2004 2005
rgdp
inflation
But
While all these techniques of estimating the covariance matrix are robust to certain violations of the regression model assumptions, they do not consider cross-sectional correlation. However, due to social norms and psychological behavior patterns, spatial dependence can be a problematic feature of any microeconometric panel dataset even if the cross-sectional units(e.g. individuals or firms) have been randomly selected.
固定效应模型(Fixed Effects Model, FE)
y it xit ui it i 1,...n; t 1,...,T 其中u i 为不可观测的个体效应 如果u i 与某个解释变量相关, 则为固定效应模型
随机效应模型(Random Effects Model, RE)
These estimators can be based on the pooled OLS or fixed effects residuals.
Random Effects Estimator: The feasible GLS estimator that uses
in place of
PLS or FE
相关主题