Skip to content

Commit

Permalink
summary.pgmm: rather pass on NULL in non-robust case
Browse files Browse the repository at this point in the history
  • Loading branch information
tappek committed Jan 5, 2025
1 parent 8755b3d commit 241aa96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/est_gmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 241aa96

Please sign in to comment.