mirror of
https://github.com/msberends/AMR.git
synced 2025-09-04 11:29:43 +02:00
parameter combine_IR
This commit is contained in:
11
R/g.test.R
11
R/g.test.R
@@ -217,8 +217,15 @@ g.test <- function(x,
|
||||
}
|
||||
names(STATISTIC) <- "X-squared"
|
||||
names(PARAMETER) <- "df"
|
||||
if (any(E < 5) && is.finite(PARAMETER))
|
||||
warning("G-statistic approximation may be incorrect")
|
||||
# if (any(E < 5) && is.finite(PARAMETER))
|
||||
# warning("G-statistic approximation may be incorrect")
|
||||
|
||||
# suggest fisher.test when total is < 1000 (John McDonald, Handbook of Biological Statistics, 2014)
|
||||
if (sum(x, na.rm = TRUE) < 1000 && is.finite(PARAMETER)) {
|
||||
warning("G-statistic approximation may be incorrect, consider Fisher's Exact test")
|
||||
} else if (any(E < 5) && is.finite(PARAMETER)) {
|
||||
warning("G-statistic approximation may be incorrect, consider Fisher's Exact test")
|
||||
}
|
||||
structure(list(statistic = STATISTIC, parameter = PARAMETER,
|
||||
p.value = PVAL, method = METHOD, data.name = DNAME,
|
||||
observed = x, expected = E, residuals = (x - E)/sqrt(E),
|
||||
|
Reference in New Issue
Block a user