楼主: maodongjun
3148 12

[回归分析求助] xtpmg运行pmg/mg/dfe时出问题 [推广有奖]

  • 9关注
  • 14粉丝

细雨江南痴书生

已卖:678份资源

副教授

82%

还不是VIP/贵宾

-

威望
0
论坛币
29180 个
通用积分
819.9258
学术水平
37 点
热心指数
45 点
信用等级
38 点
经验
12410 点
帖子
830
精华
0
在线时间
1136 小时
注册时间
2005-8-2
最后登录
2025-12-26

楼主
maodongjun 发表于 2021-8-28 00:28:33 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
第一步,PMG
xtpmg D.ltb D.lrex, lr(L.ltb lrex) ec(ec) replace pmg
eststo pmg
outreg2 using "pss99jasa2", word dec(4) ctitle(pmg) replace
没问题!
第二步,MG
xtpmg D.ltb D.lrex, lr(L.ltb lrex) ec(ec) replace mg
运行这行命令时,报错
“invalid new variable name;
variable name ec is in the list of predictors”
r(110);
我看黄老师的课件里头,都是设置的ec(ec)。后来修改为ec(fxck)继续报错。何故?

二维码

扫码加我 拉你入群

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

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

关键词:xtpmg pmg xtp TPM Predictors

沙发
maodongjun 发表于 2021-8-28 13:05:48
而且,只能先运行pmg,后运行mg。如果先运行xtpmg d.c d.y d.pi,lr(l.c y pi)  mg replace   ec(E),则直接报错。

藤椅
maodongjun 发表于 2021-8-28 13:48:20
都散了吧,我自己解决了。

板凳
泡芙可可 发表于 2021-10-10 19:23:45
您好,本人在写面板误差修正模型方面的论文,是小白,想问一下为啥我也是和您相似代码,结果ec总是说没有认定呢?谢谢

报纸
橘子汽水5522 学生认证  发表于 2021-11-23 21:24:09
maodongjun 发表于 2021-8-28 13:48
都散了吧,我自己解决了。
我遇到同样的问题,请问您是怎么解决的呢

地板
casjerry 发表于 2022-1-5 14:42:28
maodongjun 发表于 2021-8-28 13:48
都散了吧,我自己解决了。
大神,我也遇到了同样的问题,请教大神如何解决?

7
sdy404781 发表于 2022-4-1 21:45:47
怎么解决的呢?

8
sdy404781 发表于 2022-4-1 21:48:56
maodongjun 发表于 2021-8-28 13:48
都散了吧,我自己解决了。
怎么能解决的?

9
peace111111 发表于 2022-4-2 11:02:13 来自手机
maodongjun 发表于 2021-8-28 13:48
都散了吧,我自己解决了。
请问怎么解决的?

10
MZ不想秃头 发表于 2022-4-11 17:08:04
一般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

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

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