楼主: sdpanbo2015
13251 17

[面板数据求助] 关于面板数据时间和行业虚拟变量的互相作用(interacted) [推广有奖]

  • 2关注
  • 2粉丝

已卖:12份资源

硕士生

37%

还不是VIP/贵宾

-

威望
0
论坛币
1808 个
通用积分
0.2639
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1579 点
帖子
64
精华
0
在线时间
215 小时
注册时间
2016-7-16
最后登录
2025-11-30

楼主
sdpanbo2015 学生认证  发表于 2016-8-8 02:22:53 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
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的相互影响是如何输入呢?还需要重新定义他们的相互作用吗?感谢

二维码

扫码加我 拉你入群

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

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

关键词:interact 关于面板数据 ACTED inter 虚拟变量 industry 回归分析 行业 如何

回帖推荐

黃河泉 发表于2楼  查看完整内容

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

沙发
黃河泉 在职认证  发表于 2016-8-8 09:06:29
1. 下列 code 應該有回答你的問題:
  1. reghdfe npsctas lagnpsctas lagsalsctas lagnpsctas2 lagcfsctas laglodsctas laglersctas, a(id ind1 year ind1#year) vce(robust)
复制代码

  1. egen iy = group(ind1 year)
  2. reghdfe npsctas lagnpsctas lagsalsctas lagnpsctas2 lagcfsctas laglodsctas laglersctas, a(id ind1 year iy) vce(robust)
复制代码
More information, 請見:https://bbs.pinggu.org/thread-4752189-1-1.html2. 你的解釋變量 lagnpsctas 不會剛好是被解釋變量 npsctas 的落後期吧? 若是,你將會遭遇動態面板資料的估計問題!用 xtreg 估計會有問題!用上述之 reghdfe 之指令估計"應該"沒問題!

藤椅
sdpanbo2015 学生认证  发表于 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);

谢谢

板凳
sdpanbo2015 学生认证  发表于 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 了!

地板
sdpanbo2015 学生认证  发表于 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:有什么具体含义吗?

7
黃河泉 在职认证  发表于 2016-8-11 08:19:48
行不行我不知道(我上述提及之 1, 2 点),但就第 3 点与你这次的问题来看,1. "xt"tobit 的 xt 已考虑(公司)固定效果,2. 你的 year 与 ind9 若是数值,就可不用加 xi: 于前面(若是 string,就需要),3. 你加入 i.year##i.ind9 与我之建议 i.iy 应该会得到一样结果!

8
saly@123 发表于 2017-5-15 19:45:49
黃河泉 发表于 2016-8-11 08:19
行不行我不知道(我上述提及之 1, 2 点),但就第 3 点与你这次的问题来看,1. "xt"tobit 的 xt 已考虑(公 ...
我用的是非均衡的面板数据,可以生成时间虚拟变量吗?

9
黃河泉 在职认证  发表于 2017-5-16 07:45:00
saly@123 发表于 2017-5-15 19:45
我用的是非均衡的面板数据,可以生成时间虚拟变量吗?
是不是均衡的面板数据不重要,都可以的!

10
saly@123 发表于 2017-5-16 08:36:33
黃河泉 发表于 2017-5-16 07:45
是不是均衡的面板数据不重要,都可以的!
但是这样的话,使用xtreg    ,fe就存在共线性了,这是什么原因??

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 02:11