楼主: yanbridge
4190 3

[问答] pgmm函数设定不懂,求解! [推广有奖]

  • 1关注
  • 14粉丝

已卖:3372份资源

学科带头人

38%

还不是VIP/贵宾

-

威望
0
论坛币
24312 个
通用积分
70.7370
学术水平
81 点
热心指数
84 点
信用等级
62 点
经验
26079 点
帖子
918
精华
1
在线时间
2829 小时
注册时间
2007-9-29
最后登录
2025-10-3

楼主
yanbridge 发表于 2011-11-6 21:10:04 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我看包里的例子有一个地方不太懂,比如z2 <- pgmm(log(emp) ~ lag(log(emp), 1)+ lag(log(wage), 0:1) +
        lag(log(capital), 0:1) | lag(log(emp), 2:99) +
        lag(log(wage), 2:99) + lag(log(capital), 2:99),
        data = EmplUK, effect = "twoways", model = "onestep",
         transformation = "ld")
summary(z2, robust = TRUE)


我不太懂命令中红色的部分,另外2:99的设定的根据是什么?


二维码

扫码加我 拉你入群

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

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

关键词:GMM pgm capital 地方

沙发
wennyjerry 发表于 2011-11-10 19:47:16
这个也是我很困惑的地方

藤椅
epoh 发表于 2011-11-11 20:52:08

这是在建构gmm instrument时用到的参数

为保险起见都会取大范围

譬如底下例子:

  2:8 与 2:99的结果是相同的

  这时的matrix 是 28 x 6

  而2:7时,与 2:99的结果就不相同

  这时的matrix 是 27 x 6

详见plm.pdf page 31/65

#########
y~lag(y, 1:2)+lag(x1, 0:1)+lag(x2, 0:2) | lag(y, 2:99)
is similar to y~lag(y,1:2)+lag(x1, 0:1)+lag(x2, 0:2) |
                lag(y, 2:99) | lag(x1, 0:1)+lag(x2,0:2)
and indicates that all lags from 2 of y is used as gmm instruments.

The first right-hand side part describe the covariates.
The second one, which is mandatory, describes the gmm instruments.
The third one, which is optionnal,describes the ’normal’ instruments.
  By default, all the variables of the model which are not used as
  GMM instruments are used as normal instruments with the same lag
  structure as the one specified in the model.


############
library(plm)
data("EmplUK", package = "plm")

z7 <- pgmm(log(emp) ~ lag(log(emp), 1)+ lag(log(wage), 0:1) +
lag(log(capital), 0:1) | lag(log(emp), 2:7) +
lag(log(wage), 2:7) + lag(log(capital), 2:7),
data = EmplUK, effect = "twoways", model = "onestep",
transformation = "ld")
summary(z7)
Coefficients
                         Estimate Std. Error z-value  Pr(>|z|)   
lag(log(emp), 1)         0.936845   0.016543 56.6313 < 2.2e-16 ***
lag(log(wage), 0:1)0    -0.627037   0.069777 -8.9863 < 2.2e-16 ***
lag(log(wage), 0:1)1     0.479968   0.063831  7.5193 5.506e-14 ***
lag(log(capital), 0:1)0  0.478242   0.045499 10.5110 < 2.2e-16 ***
lag(log(capital), 0:1)1 -0.419226   0.047809 -8.7687 < 2.2e-16 ***

###########
z8 <- pgmm(log(emp) ~ lag(log(emp), 1)+ lag(log(wage), 0:1) +
lag(log(capital), 0:1) | lag(log(emp), 2:8) +
lag(log(wage), 2:8) + lag(log(capital), 2:8),
data = EmplUK, effect = "twoways", model = "onestep",
transformation = "ld")
summary(z8)
Coefficients
                         Estimate Std. Error z-value  Pr(>|z|)   
lag(log(emp), 1)         0.935605   0.016302 57.3931 < 2.2e-16 ***
lag(log(wage), 0:1)0    -0.630976   0.069328 -9.1013 < 2.2e-16 ***
lag(log(wage), 0:1)1     0.482620   0.063722  7.5739 3.623e-14 ***
lag(log(capital), 0:1)0  0.483930   0.044933 10.7701 < 2.2e-16 ***
lag(log(capital), 0:1)1 -0.424393   0.047422 -8.9492 < 2.2e-16 ***

###########
z99 <- pgmm(log(emp) ~ lag(log(emp), 1)+ lag(log(wage), 0:1) +
lag(log(capital), 0:1) | lag(log(emp), 2:99) +
lag(log(wage), 2:99) + lag(log(capital), 2:99),
data = EmplUK, effect = "twoways", model = "onestep",
transformation = "ld")
summary(z99)
Coefficients
                         Estimate Std. Error z-value  Pr(>|z|)   
lag(log(emp), 1)         0.935605   0.016302 57.3931 < 2.2e-16 ***
lag(log(wage), 0:1)0    -0.630976   0.069328 -9.1013 < 2.2e-16 ***
lag(log(wage), 0:1)1     0.482620   0.063722  7.5739 3.623e-14 ***
lag(log(capital), 0:1)0  0.483930   0.044933 10.7701 < 2.2e-16 ***
lag(log(capital), 0:1)1 -0.424393   0.047422 -8.9492 < 2.2e-16 ***

已有 3 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
yanbridge + 1 + 1 热心帮助其他会员
zhangtao + 5 + 5 + 5 精彩帖子
yahoocom + 40 热心帮助其他会员

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

板凳
yanbridge 发表于 2011-11-12 10:09:18
感谢epoh!!!

那么请问在分析别的数据时,如何确定这个数呢?是根据自己的经验,还是有什么规则呢?

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-3 00:32