全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
13341 17
2016-08-08
stata新手,求大神指导,现在已得出面板数据要进行回归分析,但需要考虑企业固定效应(fe),时间虚拟变量(time dummies),行业虚拟变量(industry dummies),时间和行业虚拟变量的互相作用(industry and time dummies interacted)
现在model为npsctas=lagnpsctas+lagsalsctas+lagnpsctas2+lagcfsctas+laglodsctas+laglersctas+vi+dt+uj+qj,t+ei,t
其中,vi应该为企业固定效应,dt为时间虚拟变量,ui为行业虚拟变量,qj,t为时间和行业虚拟变量的相互作用吧?
现已定义完time dummies和industry dummies,请问如何将这几个变量尤其是时间和行业虚拟变量的相互作用加到回归方程中呢?
回归方程这样输入有错误
xi: xtreg npsctas lagnpsctas lagsalsctas lagnpsctas2 lagcfsctas laglodsctas laglersctas i.year i.ind1 i.year*i.ind1, fe
显示错误
matsize too small
    You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many variables.
    You need to increase matsize; it is currently 400.  Use set matsize; see help matsize.

    If you are using factor variables and included an interaction that has lots of missing cells, either increase matsize or
    set emptycells drop to reduce the required matrix size; see help set emptycells.

    If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting
    in lots of categories.  Use the c. operator on such variables.
r(908);


所以time和industry的相互影响是如何输入呢?还需要重新定义他们的相互作用吗?感谢

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-8-8 09:06:29
1. 下列 code 應該有回答你的問題:
复制代码

复制代码
More information, 請見:https://bbs.pinggu.org/thread-4752189-1-1.html2. 你的解釋變量 lagnpsctas 不會剛好是被解釋變量 npsctas 的落後期吧? 若是,你將會遭遇動態面板資料的估計問題!用 xtreg 估計會有問題!用上述之 reghdfe 之指令估計"應該"沒問題!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-8-9 01:22:36
黃河泉 发表于 2016-8-8 09:06
1. 下列 code 應該有回答你的問題:

More information, 請見:https://bbs.pinggu.org/thread-4752189- ...
恩恩,谢谢指导。感觉你说的这个很有道理,那个解释变量lagnpsctas确实是被解释变量npsctas的滞后期,xtreg在这里应该不合适。那这个reghdfe指令应该是结局这方面问题的指令吧?而且我现在发现因为被解释变量数据很多确实不连续,因此打算借鉴key paper中的方法采用角点解模型的tobit命令,但是导师给我推荐的指令是xttobit,请问大神这个xt对指令有什么具体影响呢?我俩个指令都试了一下显示无法操作。
tobit npsctas lagnpsctas lagsalsctas lagnpsctas2 lagcfsctas laglodsctas laglersctas, a(newid year ind9 ind9#year)
must specify at least one of ll() or ul()
r(198);

. xttobit npsctas lagnpsctas lagsalsctas lagnpsctas2 lagcfsctas laglodsctas laglersctas, a(newid year ind9 ind9#year)
option a() not allowed
r(198);

谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-8-9 01:25:58
黃河泉 发表于 2016-8-8 09:06
1. 下列 code 應該有回答你的問題:

More information, 請見:https://bbs.pinggu.org/thread-4752189- ...
起初打算采用xi: xttobit npsctas lagnpsctas lagnpsctas2 lagsalsctas lagcfsctas laglodsctas laglersctas i.year i.ind9。但这样无法考虑interaction和fe,同时,输入结果是把每一年的dummy作为解释变量显示出来了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-8-9 09:00:21
你的情况比我想像的更复杂多了,1. 被解释变量数据很多确实不连续 (什么意思?真的是 xttobit 适合估计之模型吗(被解释变量是被 censored)?) 2. 即使是(xttobit),落后期之被解释变量会不会影响 xttobit 估计之正确性,我也不确定。3. 加上你要控制这么多之固定效果,估计上不知容不容易收敛?至于你最后之问题可另外加入 "i.iy" 来控制 [egen iy = group(ind1 year)]。这时你就不应该用 reghdfe 了!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-8-10 21:28:07
黃河泉 发表于 2016-8-9 09:00
你的情况比我想像的更复杂多了,1. 被解释变量数据很多确实不连续 (什么意思?真的是 xttobit 适合估计之模 ...
谢谢老师,我现在输入的指令是这样的
xttobit npsctas lagnpsctas lagnpsctas2 lagsalsctas lagcfsctas laglodsctas laglersctas i.year i.ind9 i.year##i.ind9
请您指导这样行吗?
但是如果这样输入的话我没法加入固定效应fe了,同时我看有人在xttobit加入xi:,请问这个xi:有什么具体含义吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群