--- a/metafor/R/rma.uni.r Sat Aug 15 23:23:44 2020 +++ b/metafor/R/rma.uni.r Sat Aug 15 23:24:38 2020 @@ -1953,6 +1953,14 @@ crit <- NaN } } else { + dfs <- k-p + if (dfs < 10 & dfs >= 1) { + inflation <- round((2*pt(qnorm(0.975), df=dfs, lower.tail=FALSE))*100) + message <- paste0("z-test approximation is very poor with ", dfs, " degrees of freedom.\n", + "At 5% significance level, type I error rate raises to ", inflation, "%\n", + "Please, use test=\"knha\" to fix that issue") + warning(mstyle$warning(message), call.=FALSE) + } dfs <- NA QMp <- pchisq(QM, df=m, lower.tail=FALSE) pval <- 2*pnorm(abs(zval), lower.tail=FALSE)