Skip to content

Commit 776a4db

Browse files
authored
Adjust variance calculation for unbiased estimation
1 parent ea052c4 commit 776a4db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/att_gt.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ att_gt <- function(yname,
292292
# same with clustered standard errors
293293
# but it is always ignored b/c bstrap has to be true in that case
294294
n <- ifelse(faster_mode, dp$id_count, dp$n)
295-
V <- Matrix::t(inffunc)%*%inffunc/n
295+
V <- Matrix::t(inffunc)%*%inffunc/(n-1)
296296
se <- sqrt(Matrix::diag(V)/n)
297297

298298
# Zero standard error replaced by NA

0 commit comments

Comments
 (0)