楼主: 天斯吾下
2871 6

[数据管理求助] encode超过65,536个公司怎么办? [推广有奖]

  • 7关注
  • 4粉丝

已卖:11份资源

副教授

53%

还不是VIP/贵宾

-

威望
0
论坛币
1176 个
通用积分
87.5911
学术水平
8 点
热心指数
14 点
信用等级
7 点
经验
92 点
帖子
443
精华
0
在线时间
713 小时
注册时间
2013-3-6
最后登录
2021-7-19

楼主
天斯吾下 学生认证  发表于 2015-3-5 14:22:46 |AI写论文
88论坛币
我有一个面板数据,十万家公司,想用xtset 来申明面板数据,但是company name 是字符串
xtset Companyname year
varlist:  Companyname:  string variable not allowed

然后我就encode Companyname, gen(company)  想要把字符串变为数字处理,得到以下结果

encode Companyname, gen(company)
too many values
r(134);
error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 134
        too many values;
        1) You attempted to encode a string variable that takes on
        more than 65,536 unique values.  2) You attempted to tabulate
        a variable or pair of variables that take on too many values.
        If you specified two variables, try interchanging them.
        3) You issued a graph command using the by option.  The
        by-variable takes on too many different values to construct
        a readable chart.
我应该是公司数过多导致的。如何解决?

最佳答案

蓝色 查看完整内容

egen这命令很强大,试试吧 egen id =group(Companyname) 一般最好不要用encode
关键词:encode code COD NCO ODE company encode 电视机 values 字符串

回帖推荐

蓝色 发表于2楼  查看完整内容

egen这命令很强大,试试吧 egen id =group(Companyname) 一般最好不要用encode

沙发
蓝色 发表于 2015-3-5 14:22:47
egen这命令很强大,试试吧

egen id =group(Companyname)

一般最好不要用encode
已有 2 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
SpencerMeng + 1 + 1 我很赞同
Alfred_G + 5 + 4 + 4 + 4 观点有启发

总评分: 论坛币 + 5  学术水平 + 5  热心指数 + 5  信用等级 + 4   查看全部评分

藤椅
天斯吾下 学生认证  发表于 2015-3-5 15:12:06
蓝色 发表于 2015-3-5 14:22
egen这命令很强大,试试吧

egen id =group(Companyname)
很好,72万家公司同样毫无压力

板凳
LHZ@EW 发表于 2020-6-16 15:13:35
. interflex abs_da_mjones multiexp_yearprov_dum abs_err4, type(linear)
too many values
r(134);
我在进行能否使用交叉项时进行了箱型图检验也出现了这个提醒,这是为什么呢?我已经把interflex.ado和interflex.sthlp放到base下的i文件夹下了,是我安装interflex安装的不对吗?
求大神回复

报纸
LHZ@EW 发表于 2020-6-16 15:15:57
蓝色 发表于 2015-3-5 14:22
egen这命令很强大,试试吧

egen id =group(Companyname)
. interflex abs_da_mjones multiexp_yearprov_dum abs_err4, type(linear)
too many values
r(134);
我在进行能否使用交叉项时进行了箱型图检验也出现了这个提醒,这是为什么呢?我已经把interflex.ado和interflex.sthlp放到base下的i文件夹下了,是我安装interflex安装的不对吗?
求大神回复

地板
蓝色 发表于 2020-6-16 17:40:11
LHZ@EW 发表于 2020-6-16 15:15
. interflex abs_da_mjones multiexp_yearprov_dum abs_err4, type(linear)
too many values
r(134);
你安装interflex命令时
应该看到,这个命令还有对应的例子的数据

你先试试命令的数据是否存在问题(我用命令help里面例子是没有问题的)
如果没有,那就是你的数据的问题。数据只有你知道,大家是不知道的

7
LHZ@EW 发表于 2020-6-16 18:42:22
蓝色 发表于 2020-6-16 17:40
你安装interflex命令时
应该看到,这个命令还有对应的例子的数据
好的谢谢,给的例子是可以运行起来的,我看看我的数据有什么问题

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

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