prelim fix for g.test

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2023-01-30 12:26:48 +01:00
1 parent 126afb01a4
commit 89a577805f
5 files changed
+10 -5

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ g.test <- function(x,
V <- outer(sr, sc, v, n)
dimnames(E) <- dimnames(x)
STATISTIC <- 2 * sum(x * log(x / E)) # sum((abs(x - E) - YATES)^2/E) for chisq.test
STATISTIC <- 2 * sum(x * log(x / E), na.rm = TRUE) # sum((abs(x - E) - YATES)^2/E) for chisq.test
PARAMETER <- (nr - 1L) * (nc - 1L)
PVAL <- pchisq(STATISTIC, PARAMETER, lower.tail = FALSE)
} else {