Skip to content

Commit 0e359ce

Browse files
committed
Compute deviance correctly for 'reshet'.
1 parent d543291 commit 0e359ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/rma.uni.r

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,8 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) {
19921992
if (missing(alpha) || is.null(alpha) || all(is.na(alpha))) {
19931993
alpha <- rep(NA_real_, q)
19941994
} else {
1995+
if (any(is.infinite(alpha)))
1996+
stop(mstyle$stop("Infinite values in 'alpha' argument not allowed."))
19951997
alpha <- .expand1(alpha, q)
19961998
if (length(alpha) != q)
19971999
stop(mstyle$stop(paste0("Length of the 'alpha' argument (", length(alpha), ") does not match the actual number of parameters (", q, ").")))
@@ -2789,9 +2791,9 @@ test="z", level=95, btt, att, tau2, verbose=FALSE, digits, control, ...) {
27892791
}
27902792

27912793
if (k > p) {
2792-
if (allvipos && !reshet) {
2794+
if (allvipos) {
27932795
dev.ML <- -2 * (ll.ML - sum(dnorm(yi, mean=yi, sd=sqrt(vi), log=TRUE)))
2794-
} else {
2796+
} else { # when vi = 0, then dnorm(yi, yi, 0, log=TRUE) is Inf
27952797
dev.ML <- -2 * ll.ML
27962798
}
27972799
} else {

0 commit comments

Comments
 (0)