楼主: 大心脏跑跑
2348 8

[面板数据求助] 在选择mg估计时,“invalid new variable name; variable name ec is in the list of [推广有奖]

  • 1关注
  • 2粉丝

等待验证会员

本科生

95%

还不是VIP/贵宾

-

威望
0
论坛币
415 个
通用积分
0.1702
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
390 点
帖子
44
精华
0
在线时间
199 小时
注册时间
2020-1-9
最后登录
2021-10-16

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
在选择mg估计时,老是出现“invalid new variable name; variable name ec is in the list of predictors是怎么回事啊
二维码

扫码加我 拉你入群

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

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

关键词:Variable invalid Valid ABLE name

沙发
Tingle123 发表于 2021-7-7 14:48:34 |只看作者 |坛友微信交流群
你好,请问解决了吗?我也遇到同样的问题,不管把ec(ec),括号里的ec换成其他名字,怎么换,结果都出错。同样的invalid new variable name;variable name ec is in the list of predictors。

使用道具

藤椅
张粑粑 发表于 2021-8-26 14:09:56 |只看作者 |坛友微信交流群
Tingle123 发表于 2021-7-7 14:48
你好,请问解决了吗?我也遇到同样的问题,不管把ec(ec),括号里的ec换成其他名字,怎么换,结果都出错。同样 ...
请问解决了吗  我遇到相同的问题

使用道具

板凳
张粑粑 发表于 2021-8-26 15:29:19 |只看作者 |坛友微信交流群
请问解决了吗 我也遇到这样的问题

使用道具

报纸
橘子汽水5522 学生认证  发表于 2022-1-27 23:10:59 |只看作者 |坛友微信交流群
张粑粑 发表于 2021-8-26 15:29
请问解决了吗 我也遇到这样的问题
我也遇到同样的问题,请问您解决了么

使用道具

地板
周紫玉 学生认证  发表于 2022-2-7 12:49:38 |只看作者 |坛友微信交流群
橘子汽水5522 发表于 2022-1-27 23:10
我也遇到同样的问题,请问您解决了么
同样的问题,请问解决了吗

使用道具

7
qibijing3 发表于 2022-4-1 11:06:11 |只看作者 |坛友微信交流群
请问您解决了吗

使用道具

8
MZ不想秃头 发表于 2022-4-11 17:08:33 |只看作者 |坛友微信交流群
一般stata13 14都没问题,但stata15 16就不行了。我在STATALIST论坛里看到了一个解决方法,是JanDitzen提出的,他给了一个叫xtpmg2的ado file,我安装完这个就没问题了。

我分享下那个ado file的链接吧:
链接:https://pan.baidu.com/s/1-eIlblz4JfOPJGVZUpawAA  密码:xbjp

他的原文是这么说的:
I can confirm the problem in Stata 16 (16.0, latest update). Using Stata 15.0 it still works, but with 15.1 it does not work. In Stata 14.2 it is working. Thus there must have been a change from 15.0 to 15.1.

Using trace, xtpmg stops working when predicting fitted values. The command line is:
Code:
_predict double ec if __000003, eq(ec)
xtpmg does not come with it's own predict command, it uses Stata's _predict command. There was an update to predict on 20 February 2019, see help whatsnew15. The change reads:
14. predict, when specified with a new variable name that matches a variable in the current estimation results, now exits with an error message even when that variable does not exist in the current dataset. The old behavior, which provided invalid predicted values, is not preserved under version control.
Is my reading that correct, that predicted values were invalid?

I had a further look at the code of xtpmg and it looks like the predicted values are not required. When removing the lines, xtpmg works and I obtain the same results. I attached the ado file and called the program xtpmg2. Please check.

Jan

使用道具

9
MZ不想秃头 发表于 2022-4-13 15:11:57 |只看作者 |坛友微信交流群
MZ不想秃头 发表于 2022-4-11 17:08
一般stata13 14都没问题,但stata15 16就不行了。我在STATALIST论坛里看到了一个解决方法,是JanDitzen提出 ...
简而言之就是安装完之后在做mg时把xtpmg命令变成xtpmg2,其他的都不变。

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-23 01:13