Stata 论坛看到的,
command:
testparm x1 x2 x3 x4 x5 x6 x7
https://www.statalist.org/forums ... or-wald-test-in-gmm
以下是问和答:
I have two questions in this regard:
Q: (1) How can I get the results of Wald test for my regressors and also for i.Year separately?
(2) If I find that the Wald test result of my regressors (apart from i.Year) is significant while the test result of i.Year is insignificant, will that question my model?
Please note, the p-values of AR(2) and Hansen J Statistic are 0.124 and 0.458 respectively; Difference-in-Hansen tests of exogeneity is 0.705.
A:
(1)
Code:
testparm x1 x2 x3 x4 x5 x6 x7
testparm i.Year
(2)
If the Wald test for the time dummies does not reject the null hypothesis of joint insignificance, you may exclude the time dummies from the model (provided that this does not adversely affect the other specification tests). You can still keep them to be on the safe side. The risk of model misspecification is higher when you exclude variables.
As an aside: There is a bug in xtabond2 that produces incorrect degrees of freedom for the overidentification tests (Sargan-Hansen) if time dummies are specified with the factor-variable notation and some of them are displayed as omitted (or empty) in the regression output. This implies that the corresponding p-values are incorrect and the test results are invalid. To avoid this problem, you need to specify all the time dummies separately and ensure that none of them get omitted. Alternatively, you can use my xtdpdgmm command:
XTDPDGMM: new Stata command for efficient GMM estimation of linear (dynamic) panel models with nonlinear moment conditions
https://twitter.com/Kripfganz