面板数据模型选择问题

面板数据模型选择问题

1.1固定效应和混合效应的选择

xtreg y x year2-year7,fe  //估计双向固定效应模型
ssc install xtcsd  //安装命令
xtcsd,pes  //检验截面相关问题
xtcsd,fri  //检验截面相关问题
xtcsd,fre  //检验截面相关问题
  • 存在截面相关问题时
ssc install xtscc  //安装命令
xi:xtscc y x year2-year7 i.state  //处理了误差项截面相关问题的LSDV估计
testparm  _Istate* 
  • 不存在截面相关问题时
xi:reg y x year2-year7 i.state, cluster(state)  //使用聚类到州获得的标准误处理自相关和异方差问题
testparm  _Istate*  //对州虚拟变量做F检验

1.2随机效应和混合效应的选择

xtreg y x year2-year7,re  //估计随机效应模型
xttest0  //LM检验,检验个体效应
xttest1  //LM检验,检验个体效应

1.3 固定效应和随机效应的选组(三种情形下的Hausman检验)

  • 1.3.1第一种Hausman检验
xtreg y x,fe
est store fe
xtreg y x,re
est store re
hausman fe re,sigmamore/sigmaless
  • 1.3.2第二种Hausman检验(适用于异方差情形)
xtreg y x i.year,fe r
est store fe
xtrg  y x i.year,re r
est store re
hausman fe re,sigmamore/sigmaless
***此种情形hausman检验不能运算,hausman检验无效
quietly xtreg y x i.year, re
scalar theta=e(theta)
global yandxforhausman y x year2 year3 year4 year5 year6 year7 
sort state
foreach x of varlist $yandxforhausman{
     by state:egen mean`x'=mean(`x') 
     gen md`x'=`x'-mean`x' 
     gen red`x'=`x'-theta*mean`x' 
      }
quietly  reg redy redx redy redx  redyear2 redyear3 redyear4 redyear5 redyear6 redyear7 mdy mdx  mdyear2  mdyear3 mdyear4 mdyear5 mdyear6 mdyear7, vce(cluster state)
test mdy mdx  mdyear2 mdyear3 mdyear4 mdyear5 mdyear6 mdyear7
  • 1.3.3第三种Hausman检验(适用于异方差和截面相关的情形)
xtreg y x year2-year7, fe  //估计随机效应模型
xtcsd,pes  //检验截面相关问题 
xtcsd,fri  //检验截面相关问题 
xtcsd,fre  //检验截面相关问题 
xtscc redy redx  redyear2 redyear3 redyear4 redyear5 redyear6 redyear7 mdy mdx  mdyear2  mdyear3 mdyear4 mdyear5 mdyear6 mdyear7
test mdy mdx mdyear2  mdyear3 mdyear4 mdyear5 mdyear6 mdyear7
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值