全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
16016 10
2022-02-22
悬赏 60 个论坛币 已解决
输入reg ROE did1 Cfo2 Lev i.ID i.Year,robust,准备回归,但是系统报错(图片和文字如下)

maxvar too small
    You have attempted to use an interaction with too many levels or attempted to fit a model with too many
    variables.  You need to increase maxvar; it is currently 5000.  Use set maxvar; see help maxvar.


    If you are using factor variables and included an interaction that has lots of missing cells, either increase
    maxvar 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(907);

之后输入代码扩大变量的容量,结果显示如下:
. clear
.  set maxvar 40000 [, permanently]
weights not allowed
r(101);
请问大佬们知道问题出在哪儿吗?

最佳答案

黃河泉 查看完整内容

关键应该在于你加入 i.ID (可能数千个虚拟变量),请考虑用 (ssc install) reghdfe。
二维码

扫码加我 拉你入群

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

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

全部回复
2022-2-22 12:20:14
关键应该在于你加入 i.ID (可能数千个虚拟变量),请考虑用 (ssc install) reghdfe。
二维码

扫码加我 拉你入群

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

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

2022-2-27 14:18:35
黃河泉 发表于 2022-2-22 12:20
关键应该在于你加入 i.ID (可能数千个虚拟变量),请考虑用 (ssc install) reghdfe。
谢谢老师,问题已解决,最后用了多维固定效应reghdfe这个命令。前面maxvar报错是因为加了[]符号
二维码

扫码加我 拉你入群

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

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

2022-2-27 14:20:55
黃河泉 发表于 2022-2-22 12:20
关键应该在于你加入 i.ID (可能数千个虚拟变量),请考虑用 (ssc install) reghdfe。
老师,请问面板数据,我想统计不同行业企业的数量和所占百分比,应该用什么命令呀?(tabulate ind只能分行业统计观测值数量,统计不到企业数量)
二维码

扫码加我 拉你入群

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

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

2022-9-19 11:10:10
黃河泉 发表于 2022-2-22 12:20
关键应该在于你加入 i.ID (可能数千个虚拟变量),请考虑用 (ssc install) reghdfe。
黄老师,如果被解释变量是1,2,3,4这种评分指标,一般应该用ologit或者oprobit,但是也出现这种情况,因为需要固定效应太多了,reghdfe还继续适用吗
二维码

扫码加我 拉你入群

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

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

2022-9-19 11:36:55
新的小蛋糕 发表于 2022-9-19 11:10
黄老师,如果被解释变量是1,2,3,4这种评分指标,一般应该用ologit或者oprobit,但是也出现这种情况,因 ...
若是这种情况,不适合用 reghdfe。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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