




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、短面板数据分析的基本程序,方红生 浙江大学经济学院 2013年秋,参考书,计量经济学导论第四版(伍德里奇)中文版或英文版 用Stata学计量经济学 高级计量经济学及stata应用(陈强),内容安排,第1讲 短面板数据分析 第2讲 长面板数据分析(PPT 第3讲 内生性与工具变量法 第4讲动态面板数据模型 第5讲双重差分模型及其应用 第6讲 基于DID的权威文献做对了吗? (学生报告与讨论) 第7讲PSMDID 第8讲 如何识别核心变量的作用机制?,短面板数据,面板数据(panel data)是同时在时间和截面上取得的二维数据,也称时间序列与截面混合数据(pooled time series a
2、nd cross section data)。 是在一段时间内跟踪同一组个体的数据。既有横截面的维度(n个个体),又有时间维度(T个时期)。,Stata中面板数据结构,短面板:NT;反之为长面板。 平衡面板数据(balanced panel data):如果每个个体在相同的时间内都有观测值记录。 For any i, there are T observations. 非平衡面板数据(unbalanced panel):T may different over i.,Benefits of panel data analysis,use traffic.dta des,第一步:构造计量模型,面
3、板数据模型,非观测效应模型(unobserved effects model) 固定效应模型(Fixed Effects Model, FE) 随机效应模型(Random Effects Model, RE) 混合回归模型(Pooled Regression Model),固定效应模型(Fixed Effects Model, FE),随机效应模型(Random Effects Model, RE),混合回归模型(Pooled Regression Model),模型的估计,固定效应模型 固定效应变换(Fixed Effects Transformation) (组内变换)(Within Tr
4、ansformation) LSDV (Least Square Dummy Variable,(式1),给定第i 个个体,将(式1)两边对时间取平均可得,,(式2),固定效应变换,(式1) (式2)得:,可以用OLS方法估计 ,称为“固定效应估计量”(Fixed Effects Estimator),记为,由于 主要使用了每个个体的组内离差信息,故也称为“组内估计量”(within estimator)。,令 ,则,Stata 命令,xtreg ,fe xi: xtreg i.year, fe,LSDV(Least Square Dummy Variable ),基本思想:将不可观测的个体效
5、应ai 看做待估计的参数,ai就是第i个个体的截距。估计n个截距的方法就是引入n1个虚拟变量(如果省略常数项,则引入n个虚拟变量)。,例如:共有7个州,方程可以写成:,7个州的回归线斜率相同,但截距不同。 第1个州的截距是: 第2个州的截距是: 第3个州的截距是: 第4个州的截距是:,Stata 命令,xi: reg i.code xi: reg i.code i.year,随机效应模型估计,GLS The usual pooled OLS can give consistent estimators ,but as its standard errors ignore the positiv
6、e serial correlation in the composite error term, they will be incorrect.,Solution: GLS transformation to eliminate the serial correlation,:,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,RE, FE a
7、nd PLS,Pooled OLS: Fixed Effects Estimator:,Stata 命令,xtreg ,re xi:xtreg i.year ,re,进一步的解释,heteroscedasticity consistent or “White” standard errors are obtained by choosing option vce(robust) which is available for most estimation commands.,Statas estimation commands with option robust also contain a
8、 cluster() option and it is this option which allows the computation of so-called Rogers or clustered standard errors.,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 correla
9、tion. 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.,*引入了时 间虚拟变量 导致exper 消失,第2步:描述性统计,变量解释与变量的描述性统计 use t
10、raffic.dta xtset state year sum fatal beertax spircons unrate perinck 关键变量与被解释变量的散点图并画出回归直线 twoway (scatter fatal beertax) (lfit fatal beertax),PLS or FE tab year, gen(year) 1. xtreg fatal beertax spircons unrate perinck year2-year7,fe 这里误差项可能存在自相关、异方差和截面相关问题,所以F检验显示的结果可能不可靠,所以严格的话,首先要检验是否存在截面相关问题,命
11、令如下: xtcsd,pes xtcsd,fri xtcsd,fre,第3步:模型选择,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 Pesarans CD test for unbalanced panels.,PLS or FE,在使用命令“xtreg,fe ”时,如果不加选项cluster(state),则输
12、出结果还包含一个F检验,其原假设为“H0:all ui=0”,即混合回归是可以接受的。,2. xi:xtscc fatal beertax spircons unrate perinck year2-year7 i.state 对州虚拟变量做F检验 如果不存在截面相关,则 xi:reg fatal beertax spircons unrate perinck year2-year7 i.state, cluster(state) 对州虚拟变量做F检验,PLS or RE xtreg fatal beertax spircons unrate perinck year2-year7,re xt
13、test0/xttest1(AR(1)),PLS or RE,FE or RE Hausman test1 xtreg fatal beertax spircons unrate perinck year2-year7, fe est store FE xtreg fatal beertax spircons unrate perinck year2-year7, re hausman FE, sigmamore,Hausman检验: 基本思想:如果 , Fe 和 Re 都是一致的,但Re更有效。 如果 , Fe 仍然一致,但Re是有偏的。 因此: 如果原假设成立,则FE与RE估计量将共同收敛
14、于真实的参数值,反之,两者的差距过大,则倾向于拒绝原假设,选择FE,FE or RE,解决办法:构造一个辅助回归,继续,基于随机效应估计的自相关检验 xtserial fatal beertax spircons unrate perinck year2-year7,Hausman test2,quietly xtreg fatal beertax spircons unrate perinck year2 year3 year4 year5 year6 year7, re scalar theta=e(theta) global yandxforhausman fatal beertax s
15、pircons unrate perinck year2 year3 year4 year5 year6 year7 sort state foreach x of varlist $yandxforhausman by state:egen meanx=mean(x) gen mdx=x-meanx gen redx=x-theta*meanx quietly reg redfatal redbeertax redspircons redunrate redperinck redyear2 redyear3 redyear4 redyear5 redyear6 redyear7 mdbeer
16、tax mdspircons mdunrate mdperinck mdyear2 mdyear3 mdyear4 mdyear5 mdyear6 mdyear7, vce(cluster state) test mdbeertax mdspircons mdunrate mdperinck mdyear2 mdyear3 mdyear4 mdyear5 mdyear6 mdyear7,Hausman test 3,基于随机效应估计的截面相关检验 xtreg fatal beertax spircons unrate perinck year2-year7, re xtcsd,pes abs
17、xtcsd,fri abs xtcsd,fre abs,Hausman test3,quietly xtscc redfatal redbeertax redspircons redunrate redperinck redyear2 redyear3 redyear4 redyear5 redyear6 redyear7 mdbeertax mdspircons mdunrate mdperinck mdyear2 mdyear3 mdyear4 mdyear5 mdyear6 mdyear7 test mdbeertax mdspircons mdunrate mdperinck mdye
18、ar2 mdyear3 mdyear4 mdyear5 mdyear6 mdyear7,第4步:报告计量结果,假设Hausman test 选择FE,则 xtreg fatal beertax spircons unrate perinck year2-year7, fe xtcsd,pes abs xtcsd,fri abs xtcsd,fre abs,如果存在截面相关,则最终报告由如下命令估计的结果: xtscc fatal beertax spircons unrate perinck year2-year7, fe 其中标准误是Driscoll-Kraay,估计量是组内估计量 如果不存在截面
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 社区小区农村生态农业发展协议
- 行政管理学影响力评估试题及答案
- 2025年电子装联专用设备项目建议书
- 世界旅游大会出席与学习证明书(8篇)
- 深入市政学公共管理实践试题及答案
- 预防艾滋病教育
- 行政管理面临的挑战试题及答案
- 行政管理中的人本理念试题及答案
- 2024-2025学年高中历史专题五无产阶级革命家四俄国无产阶级革命的导师-列宁二练习含解析人民版选修4
- 行政管理与社会福利的现实关联探讨试题及答案
- 企业EHS风险管理基础智慧树知到期末考试答案2024年
- 国内信用证基础知识培训
- 矿山救护工考试:矿山救护规程题库考试题
- 建筑工地安全文明施工
- 机关餐饮项目服务方案(完整版)
- 土地管理学课件
- 橡胶制品纳米技术应用
- 《钢铁是怎样炼成的》选择题100题(含答案)
- 生活中的心理学课件
- 2024年浙江乐清市金融控股有限公司招聘笔试参考题库含答案解析
- 无期限的六合公式汇编
评论
0/150
提交评论