diff --git a/R/est_gmm.R b/R/est_gmm.R index 2aa9da3..09fa747 100755 --- a/R/est_gmm.R +++ b/R/est_gmm.R @@ -804,11 +804,11 @@ summary.pgmm <- function(object, robust = TRUE, time.dummies = FALSE, ...) { K <- if(model == "onestep") length(object$coefficients) else length(object$coefficients[[2L]]) object$sargan <- sargan(object, "twosteps") - object$m1 <- mtest(object, order = 1L, vcov = vv) + object$m1 <- mtest(object, order = 1L, vcov = if(!robust) NULL else vv) # mtest with order = 2 is only feasible if more than 2 observations are present - if(NROW(object$model[[1L]]) > 2L) object$m2 <- mtest(object, order = 2L, vcov = vv) - object$wald.coef <- pwaldtest(object, param = "coef", vcov = vv) - if(effect == "twoways") object$wald.td <- pwaldtest(object, param = "time", vcov = vv) + if(NROW(object$model[[1L]]) > 2L) object$m2 <- mtest(object, order = 2L, vcov = if(!robust) NULL else vv) + object$wald.coef <- pwaldtest(object, param = "coef", vcov = if(!robust) NULL else vv) + if(effect == "twoways") object$wald.td <- pwaldtest(object, param = "time", vcov = if(!robust) NULL else vv) Kt <- length(object$args$namest) rowsel <- if(!time.dummies && effect == "twoways") -c((K - Kt + 1):K) else seq_len(K)