From 03aa426332bd4961f8846cf0e03867dd04deb3ce Mon Sep 17 00:00:00 2001 From: tappek <77916431+tappek@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:48:13 +0200 Subject: [PATCH] better fix for #58 (commit 7390235 did not take care of an arbitrary number of these special case) --- R/tool_vcovG.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tool_vcovG.R b/R/tool_vcovG.R index 9c62648..ccad106 100644 --- a/R/tool_vcovG.R +++ b/R/tool_vcovG.R @@ -503,7 +503,7 @@ vcovG.plm <- function(x, type = c("HC0", "sss", "HC1", "HC2", "HC3", "HC4"), # drop groups in Ti that are now empty (group had 1 observation before first-differencing, hence 0 after) # and adjust n0 due to same reason Ti <- Ti[!drop] - n0 <- n0 - 1 + n0 <- n0 - sum(drop) } t0 <- t0 - 1 @@ -1033,7 +1033,7 @@ vcovBK.plm <- function(x, type = c("HC0", "HC1", "HC2", "HC3", "HC4"), # drop groups in Ti that are now empty (group had 1 observation before first-differencing, hence 0 after) # and adjust n0 due to same reason Ti <- Ti[!drop] - n0 <- n0 - 1 + n0 <- n0 - sum(drop) } t0 <- t0 - 1 }