楼主: danna-33
13660 18

[其他] stata中已在导入数据做具体回归前 set max_memory .为何依然报错,具体该如何解决? [推广有奖]

  • 0关注
  • 0粉丝

本科生

27%

还不是VIP/贵宾

-

威望
0
论坛币
7 个
通用积分
1.0008
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1267 点
帖子
54
精华
0
在线时间
48 小时
注册时间
2016-6-7
最后登录
2023-9-20

楼主
danna-33 发表于 2018-6-27 22:05:51 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
具体问题如下:
      在导入数据跑回归前已设置最大maxvar
命令如: set max_memory .
              use "数据.dta",clear
              +
              多重固定效应回归方程...
报错:
macro substitution results in line that is too long
    The line resulting from substituting macros would be longer than allowed.  The maximum allowed length is 165,216 characters, which is
    calculated on the basis of set maxvar.
    You can change that in Stata/SE and Stata/MP.  What follows is relevant only if you are using Stata/SE or Stata/MP.
    The maximum line length is defined as 16 more than the maximum macro length, which is currently 165,200 characters.  Each unit
    increase in set maxvar increases the length maximums by 33.  The maximum value of set maxvar is 32,767.  Thus, the maximum line
    length may be set up to 1,084,827 characters if you set maxvar to its largest value.
r(920);
我不知道是哪里问题,明明已经设置成最大限度了。。。
请教大神我具体该如何解决?

二维码

扫码加我 拉你入群

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

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

关键词:固定效应回归 如何解决 最大限度 具体问题 固定效应

回帖推荐

天南水北 发表于17楼  查看完整内容

对上面要stata15MP的同学,统一回答在这里。你们按照论坛里或者是网上安装stata15SE的教程,下载安装stata15和相应的runasdate,然后不要选择SE,选择MP安装。序列号不要用教程里的,而用下面的: Serial number:501509263653 Code:shyc Lrrm e7$n azL3 n1hw ap48 diLm f6yo 6q7q rh Authorization:id82 至于runasdate的时间,在2015和2016中随便选个日子,如( 23\05\2016)能运行就行了。还有每隔一段时间,如果提示试用 ...

天南水北 发表于5楼  查看完整内容

stataSE版就是阉割版的意思。自己找一个MP版吧。我这里倒是有一个破解了的stata15MP版。要的话,回我邮箱。怎么用自己百度去。

沙发
天南水北 发表于 2018-6-28 11:17:25
你说stataSE还是stataMP,是哪个版本的stata。

藤椅
danna-33 发表于 2018-6-28 19:39:06
天南水北 发表于 2018-6-28 11:17
你说stataSE还是stataMP,是哪个版本的stata。
谢谢您,我的是stataSE 13.0版本的

板凳
蓝色 发表于 2018-6-29 07:38:54
1、把 你用的具体的命令都写全了
2、把数据的信息介绍清楚

报纸
天南水北 发表于 2018-6-29 09:23:48
danna-33 发表于 2018-6-28 19:39
谢谢您,我的是stataSE 13.0版本的
stataSE版就是阉割版的意思。自己找一个MP版吧。我这里倒是有一个破解了的stata15MP版。要的话,回我邮箱。怎么用自己百度去。

地板
danna-33 发表于 2018-6-29 10:13:41
天南水北 发表于 2018-6-29 09:23
stataSE版就是阉割版的意思。自己找一个MP版吧。我这里倒是有一个破解了的stata15MP版。要的话,回我邮箱 ...
谢谢您,我的邮箱是mengdan9311@163.com,麻烦您了,用法我可以自己百度的,谢谢~~~

7
danna-33 发表于 2018-6-29 10:44:27
蓝色 发表于 2018-6-29 07:38
1、把 你用的具体的命令都写全了
2、把数据的信息介绍清楚
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input float(y x) int year float(desCountryCode1 hs8_1 country_year)
  4.         0 1 2007 194 2 2591
  5. 8.044626 1 2008 106 2 1427
  6. 8.4677925 0 2007  21 1  288
  7. 12.327812 1 2012 160 2 2164
  8. 10.187726 1 2010  48 2  639
  9. 10.763124 0 2008 168 1 2272
  10. 9.627668 0 2006  28 1  380
  11.   11.8431 0 2000  80 2 1055
  12.   2.70805 0 2000 152 2 2044
  13. 9.392662 0 2005  44 1  580
  14. 13.52904 1 2011 135 2 1827
  15. 10.24381 0 2013 165 1 2235
  16. 12.864036 1 2010  54 2  715
  17. 9.514215 1 2008   5 2   65
  18. 7.573017 1 2013 128 2 1731
  19. 6.774224 0 2013 132 1 1787
  20. 12.259784 1 2011  71 2  940
  21. 8.809863 0 2008 138 1 1865
  22. 9.743905 0 2007   3 1   36
  23. 9.788526 1 2007 213 2 2837
  24. 5.652489 0 2011 149 1 2013
  25.   6.73578 1 2009  73 2  966
  26.   9.75719 1 2010  34 2  466
  27. 12.794798 1 2005  80 2 1060
  28. 8.337349 1 2013 100 2 1348
  29. 11.066045 1 2008  98 2 1315
  30. 5.141664 1 2005  34 2  461
  31. 8.859364 0 2010 201 1 2690
  32. 11.11106 0 2009 168 1 2273
  33. 11.600698 0 2001 224 2 2958
  34. 10.501582 0 2007 174 1 2355
  35. 5.774551 0 2008  34 1  464
  36. 13.596825 1 2011 132 2 1785
  37. 12.01949 1 2010 178 2 2403
  38. 13.976732 1 2007 218 2 2894
  39. 8.853094 0 2011 181 1 2446
  40. 11.978645 1 2008 154 2 2080
  41. 9.617537 1 2006 166 2 2242
  42. 9.933434 0 2013  39 1  526
  43. 13.500393 1 2005 101 2 1354
  44. 11.042873 0 2000  11 1  141
  45. 12.725821 1 2008 221 2 2925
  46. 10.66546 1 2012  53 2  703
  47. 12.749373 1 2007 131 2 1767
  48. 8.866582 1 2006  20 2  273
  49. 9.953087 0 2009 113 1 1521
  50. 7.763871 0 2003  79 2 1044
  51. 9.559799 0 2011  91 1 1220
  52. 13.802166 1 2011 163 2 2205
  53. 10.58081 1 2006 157 2 2116
  54. 6.697034 0 2001 165 2 2223
  55. 12.585892 1 2011  91 2 1220
  56. 5.480639 1 2008  53 2  700
  57. 12.963142 1 2007  91 2 1216
  58. 9.782506 0 2004  58 2  765
  59. 5.991465 0 2013 103 1 1390
  60. 8.745125 0 2013  30 1  415
  61. 9.929886 0 2008 179 1 2415
  62. 16.770266 0 2001  85 2 1126
  63. 9.733293 1 2013 228 2 3021
  64. 10.02127 1 2012 151 2 2042
  65. 6.025866 0 2007  51 1  678
  66. 5.602119 0 2012 113 1 1524
  67. 9.394077 0 2006 181 1 2441
  68. 9.714987 1 2011 222 2 2942
  69. 5.298317 1 2011  50 2  668
  70. 10.556984 1 2013  34 2  469
  71. 7.056175 0 2005 117 1 1572
  72. 4.4998097 0 2011  19 1  264
  73. 9.889845 0 2003  92 2 1226
  74. 7.964503 0 2009 154 1 2081
  75. 9.665294 0 2005 111 1 1489
  76. 9.467305 1 2011  37 2  509
  77. 5.926926 1 2006  30 2  408
  78. 9.540075 0 2000  87 1 1153
  79. 4.1108737 0 2006  20 1  273
  80. 12.452053 1 2008 179 2 2415
  81. 10.746992 1 2013  45 2  602
  82. 11.49064 0 2007 163 1 2201
  83. 8.133294 0 2002  49 2  645
  84. 7.668094 1 2011  36 2  495
  85. 7.063904 1 2005 179 2 2412
  86. 8.921057 1 2007 123 2 1658
  87. 7.710653 0 2008 135 1 1824
  88. 9.773777 0 2008  11 1  149
  89. 9.751676 0 2004 102 1 1367
  90. 6.688354 1 2013 215 2 2871
  91. 13.094332 0 2003 224 2 2960
  92. 13.576241 1 2012 132 2 1786
  93. 10.860632 1 2006 162 2 2186
  94. 15.06306 1 2009 101 2 1358
  95. 7.470794 0 2009 198 1 2649
  96.   8.33327 0 2011  44 1  586
  97. 13.177798 0 2012  85 1 1137
  98. 14.868014 0 2004  85 1 1129
  99. 11.84673 0 2008   6 1   79
  100. 11.98246 0 2008   4 1   51
  101. 10.943305 0 2012 168 1 2276
  102. 6.548219 0 2002  51 2  673
  103. 6.214608 0 2001 210 2 2791
  104. end
复制代码
以上是具有代表性的数据
回归命令如下
use "数据.dta",clear
quietly reghdfe y x ,absorb(i.year)
est store m1
quietly reghdfe y x ,absorb(i.year i.desCountryCode1)
est store m2
quietly reghdfe y x ,absorb(i.year i.desCountryCode1 i.hs8_1)
est store m3
quietly reghdfe y x ,absorb(i.year i.desCountryCode1 i.hs8_1 i.country_year)
est store m4
quietly reghdfe y x ,absorb(i.year i.desCountryCode1 i.hs8_1 i.country_year i.hs8_1#i.desCountryCode1)
est store m5
esttab m1 m2 m3 m4 m5  using hhh.rtf, nocon ar2 compress ///
starlevels(* 0.10 ** 0.05 *** 0.01) mtitles("ly" "ly" "ly" "ly" "ly" )
eststo clear
报错如下:
macro substitution results in line that is too long
    The line resulting from substituting macros would be longer than allowed.  The maximum allowed length is 165,216 characters, which is
    calculated on the basis of set maxvar.
    You can change that in Stata/SE and Stata/MP.  What follows is relevant only if you are using Stata/SE or Stata/MP.
    The maximum line length is defined as 16 more than the maximum macro length, which is currently 165,200 characters.  Each unit
    increase in set maxvar increases the length maximums by 33.  The maximum value of set maxvar is 32,767.  Thus, the maximum line
    length may be set up to 1,084,827 characters if you set maxvar to its largest value.
r(920);
所以我在写入数据前执行
set max_memory .
use "数据.dta",clear
然后进行上述回归,报出相同错误,我不太清楚接下来还应如何修正?

8
蓝色 发表于 2018-6-29 12:12:19
你单独执行
看看是哪一条出的问题

如果是最后一条,应该是虚拟变量太多了,超出范围

9
danna-33 发表于 2018-6-30 09:21:04
蓝色 发表于 2018-6-29 12:12
你单独执行
看看是哪一条出的问题
确实是最后一条,那么我具体该如何解决呢?还是不换stata版本没办法解决啊?

10
danna-33 发表于 2018-6-30 16:15:51
天南水北 发表于 2018-6-29 09:23
stataSE版就是阉割版的意思。自己找一个MP版吧。我这里倒是有一个破解了的stata15MP版。要的话,回我邮箱 ...
谢谢您,已经收到邮件啦

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-10 22:56