网站大量收购独家精品文档,联系QQ:2885784924

第4讲-面板数据:随机效应与随机效应.ppt

  1. 1、本文档共67页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2. 截面合并: use D:\ff1.dta merge id using D:\ff2.dta drop _merge sort id merge id using D:\ff3.dta drop _merge save D:\total.dta, replace id y1 a1 b1 c1 d1 y2 a2 b2 c2 d2 y3 a3 b3 c3 d3 1001 2000 25 400 2400 7.78 2400 26 3000 5400 8.59 0 27 0 0 0.00 1002 0 38 0 0 0.00 2000 39 4000 6000 8.70 3600 40 0 3600 8.19 1003 700 18 0 700 6.55 1000 19 0 1000 6.91 1000 19 0 1000 6.91 合并后的文件”total”中,数据格式如下: 3.转化为面板数据: use D:\total.dta xtset id reshape long y a b c d, i(id) j(year) save D:\sample.dta, replace id year y a b c d 1001 1 2000 25 400 2400 7.78 1001 2 2400 26 3000 5400 8.59 1001 3 0 27 0 0 0.00 1002 1 0 38 0 0 0.00 1002 2 2000 39 4000 6000 8.70 1002 3 3600 40 0 3600 8.19 1003 1 700 18 0 700 6.55 1003 2 1000 19 0 1000 6.91 1003 3 0 20 30 30 3.43 转化后的面板数据格式: 如果仍将转化回宽数据格式,命令行如下: id y1 a1 b1 c1 d1 y2 a2 b2 c2 d2 y3 a3 b3 c3 d3 1001 2000 25 400 2400 7.78 2400 26 3000 5400 8.59 0 27 0 0 0.00 1002 0 38 0 0 0.00 2000 39 4000 6000 8.70 3600 40 0 3600 8.19 1003 700 18 0 700 6.55 1000 19 0 1000 6.91 1000 19 0 1000 6.91 use D:\sample.dta reshape wide y-d, i(id) j(year) save D:\sample.dta, replace 面板数据回归指令: GLS random-effects (RE) model xtreg depvar [indepvars] [if] [in] [, re RE_options] Between-effects (BE) model xtreg depvar [indepvars] [if] [in] , be [BE_options] Fixed-effects (FE) model xtreg depvar [indepvars] [if] [in] [weight] , fe [FE_options] ML random-effects (MLE) model xtreg depvar [indepvars] [if] [in] [weight] , mle [MLE_options] 实例: Random-effects (RE) model: xtreg y a b c d, i(id) xtreg y a b c d if a=25, i(id) Fixed-effects (FE) model: xtreg y a b c d, fe i(id) Logit Model: xtlogit y a b c d, i(id) xtlogit y a b c d, fe i(id) Probit Model: xtprobit y a b c d, i(id) id year y a b c d 1001 1 2000 25 400 2400 7.78 1001 2 2400 26 3000 5400 8.59 1001 3 0 27 0 0 0.00 1002 1 0 38 0 0 0.00 1002 2 2000 39 4000 6000 8.70 1002 3 3600 40 0 3600 8.19 1003 1 7

文档评论(0)

annylsq + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档