可以用啊。
> data("EmplUK", package="plm")
> z1 <- pgmm(dynformula(log(emp)~log(wage)+log(capital)+log(output),list(2,1,0,1)),
+ data=EmplUK, effect="twoways", model="twosteps",
+ gmm.inst=~log(emp),lag.gmm=list(c(2,99)))
> summary(z1,robust=TRUE)
Twoways effects Two steps model
Call:
pgmm(formula = log(emp) ~ lag(log(emp), 1) + lag(log(emp), 2) +
log(wage) + lag(log(wage), 1) + log(capital) + log(output) +
lag(log(output), 1), data = EmplUK, effect = "twoways", model = "twosteps",
gmm.inst = ~log(emp), lag.gmm = list(c(2, 99)))
Unbalanced Panel: n=140, T=7-9, N=1031
Number of Observations Used: 611
Residuals
Min. 1st Qu. Median Mean 3rd Qu. Max.
-0.6191000 -0.0494800 -0.0004565 -0.0001841 0.0533500 0.6410000
Coefficients
Estimate Std. Error z-value Pr(>|z|)
lag(log(emp), 1) 0.474151 0.185398 2.5575 0.0105437 *
lag(log(emp), 2) -0.052967 0.051749 -1.0235 0.3060506
log(wage) -0.513205 0.145565 -3.5256 0.0004225 ***
lag(log(wage), 1) 0.224640 0.141950 1.5825 0.1135279
log(capital) 0.292723 0.062627 4.6741 2.953e-06 ***
log(output) 0.609775 0.156263 3.9022 9.530e-05 ***
lag(log(output), 1) -0.446373 0.217302 -2.0542 0.0399605 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Sargan Test: chisq(25) = 30.11247 (p.value=0.22011)
Autocorrelation test (1): normal = -1.538450 (p.value=0.061969)
Autocorrelation test (2): normal = -0.2796829 (p.value=0.38986)
Wald test for coefficients: chisq(7) = 142.0353 (p.value=< 2.22e-16)
Wald test for time dummies: chisq(6) = 16.97046 (p.value=0.0093924)