diff --git a/DESCRIPTION b/DESCRIPTION
index c96e018f5..ac15b5a00 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: metafor
-Version: 4.7-29
-Date: 2024-09-04
+Version: 4.7-30
+Date: 2024-09-09
Title: Meta-Analysis Package for R
Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "wvb@metafor-project.org", comment = c(ORCID = "0000-0003-3463-4063"))
Depends: R (>= 4.0.0), methods, Matrix, metadat, numDeriv
diff --git a/NEWS.md b/NEWS.md
index ad33fbddc..fbef25200 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# metafor 4.7-29 (2024-09-04)
+# metafor 4.7-30 (2024-09-09)
- some general changes to the various `forest()` functions: argument `header` is now `TRUE` by default, the y-axis is now created with `yaxs="i"`, and the y-axis limits have been tweaked slightly in accordance
diff --git a/R/addpoly.default.r b/R/addpoly.default.r
index 7e13f3fbd..13aeb5d18 100644
--- a/R/addpoly.default.r
+++ b/R/addpoly.default.r
@@ -1,5 +1,5 @@
addpoly.default <- function(x, vi, sei, ci.lb, ci.ub, pi.lb, pi.ub,
-rows=-1, level, annotate, predstyle, digits, width, mlab,
+rows=-1, level, annotate, predstyle, predlim, digits, width, mlab,
transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...) {
#########################################################################
@@ -514,6 +514,22 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...
if (predstyle %in% c("shade","dist")) {
+ if (is.null(pi.se))
+ stop(mstyle$stop("Cannot extract SE of the prediction interval."))
+
+ if (!missing(predlim) && length(predlim) != 2L)
+ stop(mstyle$stop("Argument 'predlim' must be of length 2."))
+
+ if (is.function(transf)) {
+ funlist <- lapply(list("1"=exp, "2"=transf.ztor, "3"=tanh, "4"=transf.ilogit, "5"=plogis, "6"=transf.iarcsin), deparse)
+ funmatch <- sapply(funlist, identical, transf.char)
+ if (!any(funmatch))
+ stop(mstyle$stop("Chosen transformation not (currently) possible with this 'predstyle'."))
+ }
+
+ if (pi.dist != "norm" && pi.ddf <= 1L)
+ stop(mstyle$stop("Cannot shade/draw prediction distribution when df <= 1."))
+
if (predstyle == "shade") {
x.len <- 100
q.lo <- pi.level/2
@@ -524,19 +540,36 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...
q.hi <- 0.9999
}
- if (is.null(pi.se))
- stop(mstyle$stop("Cannot extract SE of the prediction interval."))
-
- if (pi.dist == "norm") {
- crits <- qnorm(c(q.lo,q.hi), mean=yi.utransf[i], sd=pi.se)
- xs <- seq(crits[1], crits[2], length.out=x.len)
- ys <- dnorm(xs, mean=yi.utransf[i], sd=pi.se)
+ if (missing(predlim) || predstyle == "shade") {
+ if (pi.dist == "norm") {
+ crits <- qnorm(c(q.lo,q.hi), mean=yi.utransf[i], sd=pi.se)
+ xs <- seq(crits[1], crits[2], length.out=x.len)
+ ys <- dnorm(xs, mean=yi.utransf[i], sd=pi.se)
+ } else {
+ crits <- qt(c(q.lo,q.hi), df=pi.ddf) * pi.se + yi.utransf[i]
+ xs <- seq(crits[1], crits[2], length.out=x.len)
+ ys <- dt((xs - yi.utransf[i]) / pi.se, df=pi.ddf) / pi.se
+ }
} else {
- if (pi.ddf <= 1L)
- stop(mstyle$stop("Cannot draw prediction distribution when df <= 1."))
- crits <- qt(c(q.lo,q.hi), df=pi.ddf) * pi.se + yi.utransf[i]
- xs <- seq(crits[1], crits[2], length.out=x.len)
- ys <- dt((xs - yi.utransf[i]) / pi.se, df=pi.ddf) / pi.se
+ xs <- seq(predlim[1], predlim[2], length.out=x.len)
+ if (is.function(transf)) {
+ if (funmatch[1])
+ xs <- suppressWarnings(log(xs))
+ if (any(funmatch[2:3]))
+ xs <- suppressWarnings(atanh(xs))
+ if (any(funmatch[4:5]))
+ xs <- suppressWarnings(qlogis(xs))
+ if (funmatch[6])
+ xs <- suppressWarnings(transf.arcsin(xs))
+ sel <- is.finite(xs) # FALSE for +-Inf and NA/NaN
+ x.len <- sum(sel)
+ xs <- xs[sel]
+ }
+ if (pi.dist == "norm") {
+ ys <- dnorm(xs, mean=yi.utransf[i], sd=pi.se)
+ } else {
+ ys <- dt((xs - yi.utransf[i]) / pi.se, df=pi.ddf) / pi.se
+ }
}
sel.l0 <- xs < 0
@@ -544,38 +577,32 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...
if (is.function(transf)) {
xs <- sapply(xs, transf)
- funlist <- lapply(list("1"=exp, "2"=transf.ztor, "3"=tanh, "4"=transf.ilogit, "5"=plogis, "6"=transf.iarcsin), deparse)
- funmatch <- sapply(funlist, identical, transf.char)
- if (any(funmatch)) {
- if (funmatch[1])
- ys <- ys / xs
- if (any(funmatch[2:3]))
- ys <- ys / (1-xs^2)
- if (any(funmatch[4:5]))
- ys <- ys / (xs*(1-xs))
- if (funmatch[6])
- ys <- ys / (2*sqrt(xs*(1-xs)))
- # can run into numerical problems at the extremes (esp. when pi.dist="t"),
- # so we need to find the range where ys are first increasing and then decreasing
- sdys <- sign(diff(ys))
- y.lo <- which(sdys == 1)
- if (length(y.lo) == 0L) {
- y.lo <- 1
- } else {
- y.lo <- min(y.lo) + 1
- }
- y.hi <- which(sdys == -1)
- if (length(y.hi) == 0L) {
- y.hi <- x.len
- } else {
- y.hi <- max(y.hi) + 1
- }
- sel.l0 <- sel.l0[y.lo:y.hi]
- sel.g0 <- sel.g0[y.lo:y.hi]
- xs <- xs[y.lo:y.hi]
- ys <- ys[y.lo:y.hi]
- } else {
- stop(mstyle$stop("Chosen transformation not (currently) possible with this 'predstyle'."))
+ if (funmatch[1]) {
+ ys <- ys / xs
+ x.lo <- 0.01
+ x.hi <- Inf
+ }
+ if (any(funmatch[2:3])) {
+ ys <- ys / (1-xs^2)
+ x.lo <- -0.99
+ x.hi <- 0.99
+ }
+ if (any(funmatch[4:5])) {
+ ys <- ys / (xs*(1-xs))
+ x.lo <- 0.01
+ x.hi <- 0.99
+ }
+ if (funmatch[6]) {
+ ys <- ys / (2*sqrt(xs*(1-xs)))
+ x.lo <- 0.01
+ x.hi <- 0.99
+ }
+ if (missing(predlim)) {
+ sel <- xs > x.lo & xs < x.hi
+ sel.l0 <- sel.l0[sel]
+ sel.g0 <- sel.g0[sel]
+ ys <- ys[sel]
+ xs <- xs[sel]
}
}
@@ -587,7 +614,7 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...
colfun <- colorRamp(c(col[2], col[3]))
rectcol <- colfun(intensity)
- rectcol <- apply(rectcol, 1, function(x) rgb(x[1], x[2], x[3], maxColorValue=255))
+ rectcol <- apply(rectcol, 1, function(x) if (anyNA(x)) NA else rgb(x[1], x[2], x[3], maxColorValue=255))
lrect(xs[-1], rows[2]-barheight, xs[-length(xs)], rows[2]+barheight, col=rectcol, border=rectcol, ...)
@@ -597,7 +624,11 @@ transf, atransf, targs, efac, col, border, lty, fonts, cex, constarea=FALSE, ...
ys <- ys / max(ys) * efac[2]
- sel <- ys > 0.005
+ if (missing(predlim)) {
+ sel <- ys > 0.005
+ } else {
+ sel <- rep(TRUE, length(ys))
+ }
xs.sel.l0 <- xs[sel.l0 & sel]
xs.sel.g0 <- xs[sel.g0 & sel]
diff --git a/R/forest.cumul.rma.r b/R/forest.cumul.rma.r
index 077e3e841..c9e0780a0 100644
--- a/R/forest.cumul.rma.r
+++ b/R/forest.cumul.rma.r
@@ -501,6 +501,9 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
xlim <- round(xlim, digits[[2]])
#xlim[1] <- xlim[1]*max(1, digits[[2]]/2)
#xlim[2] <- xlim[2]*max(1, digits[[2]]/2)
+ } else {
+ if (length(xlim) != 2L)
+ stop(mstyle$stop("Argument 'xlim' must be of length 2."))
}
xlim <- sort(xlim)
diff --git a/R/forest.default.r b/R/forest.default.r
index a5c0307cd..bdc519942 100644
--- a/R/forest.default.r
+++ b/R/forest.default.r
@@ -645,6 +645,9 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
xlim <- round(xlim, digits[[2]])
#xlim[1] <- xlim[1]*max(1, digits[[2]]/2)
#xlim[2] <- xlim[2]*max(1, digits[[2]]/2)
+ } else {
+ if (length(xlim) != 2L)
+ stop(mstyle$stop("Argument 'xlim' must be of length 2."))
}
xlim <- sort(xlim)
diff --git a/R/forest.rma.r b/R/forest.rma.r
index aff342f67..75bb533e6 100644
--- a/R/forest.rma.r
+++ b/R/forest.rma.r
@@ -1,6 +1,6 @@
forest.rma <- function(x,
annotate=TRUE, addfit=TRUE, addpred=FALSE, predstyle="line", showweights=FALSE, header=TRUE,
-xlim, alim, olim, ylim, at, steps=5, level=x$level, refline=0, digits=2L, width,
+xlim, alim, olim, ylim, predlim, at, steps=5, level=x$level, refline=0, digits=2L, width,
xlab, slab, mlab, ilab, ilab.lab, ilab.xpos, ilab.pos, order,
transf, atransf, targs, rows,
efac=1, pch, psize, plim=c(0.5,1.5), colout, col, border, shade, colshade,
@@ -160,6 +160,9 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
if (missing(border))
border <- .coladj(par("bg","fg"), dark=0.3, light=-0.3) # border color of the fitted value polygons
+ if (predstyle %in% c("bar","shade","dist"))
+ warning(mstyle$warning("Argument 'predstyle' not relevant for meta-regression models."), call.=FALSE)
+
}
### set default line types if user has not specified 'lty' argument
@@ -767,6 +770,9 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
xlim <- round(xlim, digits[[2]])
#xlim[1] <- xlim[1]*max(1, digits[[2]]/2)
#xlim[2] <- xlim[2]*max(1, digits[[2]]/2)
+ } else {
+ if (length(xlim) != 2L)
+ stop(mstyle$stop("Argument 'xlim' must be of length 2."))
}
xlim <- sort(xlim)
@@ -1063,6 +1069,19 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
if (predstyle %in% c("shade","dist")) {
+ if (!missing(predlim) && length(predlim) != 2L)
+ stop(mstyle$stop("Argument 'predlim' must be of length 2."))
+
+ if (is.function(transf)) {
+ funlist <- lapply(list("1"=exp, "2"=transf.ztor, "3"=tanh, "4"=transf.ilogit, "5"=plogis, "6"=transf.iarcsin), deparse)
+ funmatch <- sapply(funlist, identical, transf.char)
+ if (!any(funmatch))
+ stop(mstyle$stop("Chosen transformation not (currently) possible with this 'predstyle'."))
+ }
+
+ if (predres$pi.dist != "norm" && predres$pi.ddf <= 1L)
+ stop(mstyle$stop("Cannot shade/draw prediction distribution when df <= 1."))
+
if (predstyle == "shade") {
x.len <- 100
q.lo <- level/2
@@ -1073,16 +1092,36 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
q.hi <- 0.9999
}
- if (predres$pi.dist == "norm") {
- crits <- qnorm(c(q.lo,q.hi), mean=predres$pred, sd=predres$pi.se)
- xs <- seq(crits[1], crits[2], length.out=x.len)
- ys <- dnorm(xs, mean=predres$pred, sd=predres$pi.se)
+ if (missing(predlim) || predstyle == "shade") {
+ if (predres$pi.dist == "norm") {
+ crits <- qnorm(c(q.lo,q.hi), mean=predres$pred, sd=predres$pi.se)
+ xs <- seq(crits[1], crits[2], length.out=x.len)
+ ys <- dnorm(xs, mean=predres$pred, sd=predres$pi.se)
+ } else {
+ crits <- qt(c(q.lo,q.hi), df=predres$pi.ddf) * predres$pi.se + predres$pred
+ xs <- seq(crits[1], crits[2], length.out=x.len)
+ ys <- dt((xs - predres$pred) / predres$pi.se, df=predres$pi.ddf) / predres$pi.se
+ }
} else {
- if (predres$pi.ddf <= 1L)
- stop(mstyle$stop("Cannot draw prediction distribution when df <= 1."))
- crits <- qt(c(q.lo,q.hi), df=predres$pi.ddf) * predres$pi.se + predres$pred
- xs <- seq(crits[1], crits[2], length.out=x.len)
- ys <- dt((xs - predres$pred) / predres$pi.se, df=predres$pi.ddf) / predres$pi.se
+ xs <- seq(predlim[1], predlim[2], length.out=x.len)
+ if (is.function(transf)) {
+ if (funmatch[1])
+ xs <- suppressWarnings(log(xs))
+ if (any(funmatch[2:3]))
+ xs <- suppressWarnings(atanh(xs))
+ if (any(funmatch[4:5]))
+ xs <- suppressWarnings(qlogis(xs))
+ if (funmatch[6])
+ xs <- suppressWarnings(transf.arcsin(xs))
+ sel <- is.finite(xs) # FALSE for +-Inf and NA/NaN
+ x.len <- sum(sel)
+ xs <- xs[sel]
+ }
+ if (predres$pi.dist == "norm") {
+ ys <- dnorm(xs, mean=predres$pred, sd=predres$pi.se)
+ } else {
+ ys <- dt((xs - predres$pred) / predres$pi.se, df=predres$pi.ddf) / predres$pi.se
+ }
}
sel.l0 <- xs < 0
@@ -1090,38 +1129,32 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
if (is.function(transf)) {
xs <- sapply(xs, transf)
- funlist <- lapply(list("1"=exp, "2"=transf.ztor, "3"=tanh, "4"=transf.ilogit, "5"=plogis, "6"=transf.iarcsin), deparse)
- funmatch <- sapply(funlist, identical, transf.char)
- if (any(funmatch)) {
- if (funmatch[1])
- ys <- ys / xs
- if (any(funmatch[2:3]))
- ys <- ys / (1-xs^2)
- if (any(funmatch[4:5]))
- ys <- ys / (xs*(1-xs))
- if (funmatch[6])
- ys <- ys / (2*sqrt(xs*(1-xs)))
- # can run into numerical problems at the extremes (esp. when pi.dist="t"),
- # so we need to find the range where ys are first increasing and then decreasing
- sdys <- sign(diff(ys))
- y.lo <- which(sdys == 1)
- if (length(y.lo) == 0L) {
- y.lo <- 1
- } else {
- y.lo <- min(y.lo) + 1
- }
- y.hi <- which(sdys == -1)
- if (length(y.hi) == 0L) {
- y.hi <- x.len
- } else {
- y.hi <- max(y.hi) + 1
- }
- sel.l0 <- sel.l0[y.lo:y.hi]
- sel.g0 <- sel.g0[y.lo:y.hi]
- xs <- xs[y.lo:y.hi]
- ys <- ys[y.lo:y.hi]
- } else {
- stop(mstyle$stop("Chosen transformation not (currently) possible with this 'predstyle'."))
+ if (funmatch[1]) {
+ ys <- ys / xs
+ x.lo <- 0.01
+ x.hi <- Inf
+ }
+ if (any(funmatch[2:3])) {
+ ys <- ys / (1-xs^2)
+ x.lo <- -0.99
+ x.hi <- 0.99
+ }
+ if (any(funmatch[4:5])) {
+ ys <- ys / (xs*(1-xs))
+ x.lo <- 0.01
+ x.hi <- 0.99
+ }
+ if (funmatch[6]) {
+ ys <- ys / (2*sqrt(xs*(1-xs)))
+ x.lo <- 0.01
+ x.hi <- 0.99
+ }
+ if (missing(predlim)) {
+ sel <- xs > x.lo & xs < x.hi
+ sel.l0 <- sel.l0[sel]
+ sel.g0 <- sel.g0[sel]
+ ys <- ys[sel]
+ xs <- xs[sel]
}
}
@@ -1142,7 +1175,7 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
colfun <- colorRamp(c(col[2], col[3]))
rectcol <- colfun(intensity)
- rectcol <- apply(rectcol, 1, function(x) rgb(x[1], x[2], x[3], maxColorValue=255))
+ rectcol <- apply(rectcol, 1, function(x) if (anyNA(x)) NA else rgb(x[1], x[2], x[3], maxColorValue=255))
lrect(xs[-1], -2-barheight, xs[-length(xs)], -2+barheight, col=rectcol, border=rectcol, ...)
@@ -1152,7 +1185,12 @@ lty, fonts, cex, cex.lab, cex.axis, ...) {
ys <- ys / max(ys) * efac[4]
- sel <- ys > 0.005
+ if (missing(predlim)) {
+ sel <- ys > 0.005
+ } else {
+ sel <- rep(TRUE, length(ys))
+ }
+
sel <- sel & xs >= alim[1] & xs <= alim[2]
if (!missing(olim))
diff --git a/R/zzz.r b/R/zzz.r
index a1a8ab71e..c40695909 100644
--- a/R/zzz.r
+++ b/R/zzz.r
@@ -1,6 +1,6 @@
.onAttach <- function(libname, pkgname) {
- ver <- "4.7-29"
+ ver <- "4.7-30"
loadmsg <- paste0("\nLoading the 'metafor' package (version ", ver, "). For an\nintroduction to the package please type: help(metafor)\n")
diff --git a/README.md b/README.md
index 90bb5d424..c3d463309 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ metafor: A Meta-Analysis Package for R
[![R build status](https://github.com/wviechtb/metafor/workflows/R-CMD-check/badge.svg)](https://github.com/wviechtb/metafor/actions)
[![Code Coverage](https://codecov.io/gh/wviechtb/metafor/branch/master/graph/badge.svg)](https://app.codecov.io/gh/wviechtb/metafor)
[![CRAN Version](https://www.r-pkg.org/badges/version/metafor)](https://cran.r-project.org/package=metafor)
-[![devel Version](https://img.shields.io/badge/devel-4.7--29-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version)
+[![devel Version](https://img.shields.io/badge/devel-4.7--30-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version)
[![Monthly Downloads](https://cranlogs.r-pkg.org/badges/metafor)](https://cranlogs.r-pkg.org/badges/metafor)
[![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/metafor)](https://cranlogs.r-pkg.org/badges/grand-total/metafor)
diff --git a/docs/404.html b/docs/404.html
index bdcd74bd9..3a0ef8667 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -54,7 +54,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html
index cc60f85a2..3f71cddb5 100644
--- a/docs/ISSUE_TEMPLATE.html
+++ b/docs/ISSUE_TEMPLATE.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 8cf6ad63d..3933eb457 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/articles/pkgdown/diagram.html b/docs/articles/pkgdown/diagram.html
index 03b96c89b..9d3cb6797 100644
--- a/docs/articles/pkgdown/diagram.html
+++ b/docs/articles/pkgdown/diagram.html
@@ -51,7 +51,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/authors.html b/docs/authors.html
index 7547effb4..18a006f2d 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/index.html b/docs/index.html
index 96aea6c6b..6aa2870ec 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -55,7 +55,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -121,7 +121,7 @@
-
+
some general changes to the various forest()
functions: argument header
is now TRUE
by default, the y-axis is now created with yaxs="i"
, and the y-axis limits have been tweaked slightly in accordance
the forest.rma()
and addpoly.default()
functions now provides multiple styles for drawing the prediction interval via the predstyle
argument
forest.rma()
and addpoly.rma()
now write out the default label (instead of an abbreviation) for the model results; as before, the label can be changed via the mlab
argument
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 715713c00..acca76565 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.1.0
pkgdown_sha: ~
articles:
pkgdown/diagram: pkgdown/diagram.html
-last_built: 2024-09-04T08:39Z
+last_built: 2024-09-09T13:17Z
urls:
reference: https://wviechtb.github.io/metafor/reference
article: https://wviechtb.github.io/metafor/articles
diff --git a/docs/reference/Rplot011.png b/docs/reference/Rplot011.png
index 5fe6721a7..f3b1eb967 100644
Binary files a/docs/reference/Rplot011.png and b/docs/reference/Rplot011.png differ
diff --git a/docs/reference/Rplot012.png b/docs/reference/Rplot012.png
index ef7f90933..3c95b7338 100644
Binary files a/docs/reference/Rplot012.png and b/docs/reference/Rplot012.png differ
diff --git a/docs/reference/Rplot013.png b/docs/reference/Rplot013.png
index 50c4def77..5a4b6b7a7 100644
Binary files a/docs/reference/Rplot013.png and b/docs/reference/Rplot013.png differ
diff --git a/docs/reference/addpoly.default.html b/docs/reference/addpoly.default.html
index 78575d66d..5f77662ca 100644
--- a/docs/reference/addpoly.default.html
+++ b/docs/reference/addpoly.default.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -97,7 +97,7 @@ Add Polygons to Forest Plots (Default Method)
# Default S3 method
addpoly(x, vi, sei, ci.lb, ci.ub, pi.lb, pi.ub,
- rows=-1, level, annotate, predstyle, digits, width, mlab,
+ rows=-1, level, annotate, predstyle, predlim, digits, width, mlab,
transf, atransf, targs, efac, col, border, lty, fonts, cex,
constarea=FALSE, ...)
@@ -138,6 +138,9 @@ Arguments
predstyle
character string to specify the style of the prediction interval (either "line"
(the default), "bar"
, "shade"
, or "dist"
; the last three only when adding a single polygon). Can be abbreviated.
+ predlim
+optional argument to specify the limits of the prediction distribution when predstyle="dist"
.
+
digits
optional integer to specify the number of decimal places to which the annotations should be rounded.
diff --git a/docs/reference/addpoly.html b/docs/reference/addpoly.html
index c8b3bd459..db751e438 100644
--- a/docs/reference/addpoly.html
+++ b/docs/reference/addpoly.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/addpoly.predict.rma.html b/docs/reference/addpoly.predict.rma.html
index 3eea74c21..a55496598 100644
--- a/docs/reference/addpoly.predict.rma.html
+++ b/docs/reference/addpoly.predict.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/addpoly.rma.html b/docs/reference/addpoly.rma.html
index 2676256f1..b511a9c83 100644
--- a/docs/reference/addpoly.rma.html
+++ b/docs/reference/addpoly.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/aggregate.escalc.html b/docs/reference/aggregate.escalc.html
index 83dcf8538..f638eeca8 100644
--- a/docs/reference/aggregate.escalc.html
+++ b/docs/reference/aggregate.escalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/anova.rma.html b/docs/reference/anova.rma.html
index 90b7152e2..80f997a62 100644
--- a/docs/reference/anova.rma.html
+++ b/docs/reference/anova.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/baujat.html b/docs/reference/baujat.html
index 803954053..8b1314bd1 100644
--- a/docs/reference/baujat.html
+++ b/docs/reference/baujat.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/bldiag.html b/docs/reference/bldiag.html
index f784350a2..75f85eecc 100644
--- a/docs/reference/bldiag.html
+++ b/docs/reference/bldiag.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/blsplit.html b/docs/reference/blsplit.html
index f0a4ee26d..495647d35 100644
--- a/docs/reference/blsplit.html
+++ b/docs/reference/blsplit.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/blup.html b/docs/reference/blup.html
index 9229c7d5e..fc8d8551f 100644
--- a/docs/reference/blup.html
+++ b/docs/reference/blup.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/coef.permutest.rma.uni.html b/docs/reference/coef.permutest.rma.uni.html
index 8d2983065..27ba02e97 100644
--- a/docs/reference/coef.permutest.rma.uni.html
+++ b/docs/reference/coef.permutest.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/coef.rma.html b/docs/reference/coef.rma.html
index 8d8987afb..e39f32c21 100644
--- a/docs/reference/coef.rma.html
+++ b/docs/reference/coef.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/confint.rma.html b/docs/reference/confint.rma.html
index 7c05fd76b..bbd408636 100644
--- a/docs/reference/confint.rma.html
+++ b/docs/reference/confint.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/contrmat.html b/docs/reference/contrmat.html
index 5a43775bd..64ca790a7 100644
--- a/docs/reference/contrmat.html
+++ b/docs/reference/contrmat.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/conv.2x2.html b/docs/reference/conv.2x2.html
index 3ffa73f55..b8a673ba8 100644
--- a/docs/reference/conv.2x2.html
+++ b/docs/reference/conv.2x2.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/conv.delta.html b/docs/reference/conv.delta.html
index aed13f7cd..f2966f950 100644
--- a/docs/reference/conv.delta.html
+++ b/docs/reference/conv.delta.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/conv.fivenum.html b/docs/reference/conv.fivenum.html
index 3c2df6b60..b3b42536b 100644
--- a/docs/reference/conv.fivenum.html
+++ b/docs/reference/conv.fivenum.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/conv.wald.html b/docs/reference/conv.wald.html
index 20eef489b..b2ccdc781 100644
--- a/docs/reference/conv.wald.html
+++ b/docs/reference/conv.wald.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/cumul.html b/docs/reference/cumul.html
index 4a1fefb53..2b1f0be97 100644
--- a/docs/reference/cumul.html
+++ b/docs/reference/cumul.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/dfround.html b/docs/reference/dfround.html
index dde8ee667..f443b7238 100644
--- a/docs/reference/dfround.html
+++ b/docs/reference/dfround.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/emmprep.html b/docs/reference/emmprep.html
index 9c9149d7c..8d5350ee3 100644
--- a/docs/reference/emmprep.html
+++ b/docs/reference/emmprep.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/escalc.html b/docs/reference/escalc.html
index 843be2522..d3903c7f7 100644
--- a/docs/reference/escalc.html
+++ b/docs/reference/escalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/fitstats.html b/docs/reference/fitstats.html
index d7fe2b493..74d92e513 100644
--- a/docs/reference/fitstats.html
+++ b/docs/reference/fitstats.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/fitted.rma.html b/docs/reference/fitted.rma.html
index 4ba5f6fbe..99a306aac 100644
--- a/docs/reference/fitted.rma.html
+++ b/docs/reference/fitted.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/forest.cumul.rma.html b/docs/reference/forest.cumul.rma.html
index 5fb1a4d05..c62eaaa6c 100644
--- a/docs/reference/forest.cumul.rma.html
+++ b/docs/reference/forest.cumul.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -124,7 +124,7 @@ Arguments
the x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.
olim
-optional argument to specify observation/outcome limits. If unspecified, no limits are used.
+argument to specify observation/outcome limits. If unspecified, no limits are used.
ylim
the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).
diff --git a/docs/reference/forest.default.html b/docs/reference/forest.default.html
index 183e5035a..de3a3f85f 100644
--- a/docs/reference/forest.default.html
+++ b/docs/reference/forest.default.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -140,7 +140,7 @@ Arguments
the x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.
olim
-optional argument to specify observation/outcome limits. If unspecified, no limits are used.
+argument to specify observation/outcome limits. If unspecified, no limits are used.
ylim
the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).
diff --git a/docs/reference/forest.html b/docs/reference/forest.html
index fcf1fd25c..e30a599e0 100644
--- a/docs/reference/forest.html
+++ b/docs/reference/forest.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/forest.rma.html b/docs/reference/forest.rma.html
index 4c60bbdb4..e3ca791a6 100644
--- a/docs/reference/forest.rma.html
+++ b/docs/reference/forest.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -98,7 +98,7 @@ Forest Plots (Method for 'rma' Objects)
# S3 method for class 'rma'
forest(x, annotate=TRUE, addfit=TRUE, addpred=FALSE, predstyle="line",
showweights=FALSE, header=TRUE,
- xlim, alim, olim, ylim, at, steps=5,
+ xlim, alim, olim, ylim, predlim, at, steps=5,
level=x$level, refline=0, digits=2L, width,
xlab, slab, mlab, ilab, ilab.lab, ilab.xpos, ilab.pos,
order, transf, atransf, targs, rows,
@@ -142,6 +142,9 @@ Arguments
ylim
the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).
+ predlim
+optional argument to specify the limits of the prediction distribution when predstyle="dist"
.
+
at
position of the x-axis tick marks and corresponding labels. If unspecified, the function sets the tick mark positions/labels to some sensible values.
@@ -250,8 +253,8 @@ Details
Instead of showing the prediction interval as a dotted line (which corresponds to predstyle="line"
), one can choose a different style via the predstyle
argument:
predstyle="bar"
: the prediction interval is shown as a bar below the polygon,
predstyle="shade"
: the bar is shaded in color intensity in accordance with the density of the prediction distribution,
-predstyle="dist"
: the prediction distribution is shown and the regions beyond the prediction interval bounds are shaded in gray; the region below or above zero (depending on whether the pooled estimate is positive or negative) is also shaded in a lighter shade of gray (note: this region may not be visible if the distribution is far away from zero).
-
In all of these cases, the prediction interval bounds are then also provided as part of the annotations.
+predstyle="dist"
: the prediction distribution is shown and the regions beyond the prediction interval bounds are shaded in gray; the region below or above zero (depending on whether the pooled estimate is positive or negative) is also shaded in a lighter shade of gray.
+In all of these cases, the prediction interval bounds are then also provided as part of the annotations. For predstyle="dist"
, one can adjust the range of values for which the prediction distribution is shown via the predlim
argument. Note that the shaded regions may not be visible depending on the location/shape of the distribution.
For meta-regression models (i.e., models involving moderators), the fitted value for each study is added as a polygon to the plot. By default, the width of the polygons corresponds to the confidence interval limits for the fitted values. By setting addpred=TRUE
, the width reflects the prediction interval limits. Again, the col
and border
arguments can be used to adjust the (border) color of the polygons. These polygons can be suppressed by setting addfit=FALSE
.
With the transf
argument, the observed outcomes, pooled estimate, fitted values, confidence interval bounds, and prediction interval bounds can be transformed with some suitable function. For example, when plotting log odds ratios, one could use transf=exp
to obtain a forest plot showing odds ratios. Note that when the transformation is non-linear (as is the case for transf=exp
), the interval bounds will be asymmetric (which is visually not so appealing). Alternatively, one can use the atransf
argument to transform the x-axis labels and annotations. For example, when using atransf=exp
, the x-axis will correspond to a log scale. See transf for some other useful transformation functions in the context of a meta-analysis. The examples below illustrate the use of these arguments.
By default, the studies are ordered from top to bottom (i.e., the first study in the dataset will be placed in row \(k\), the second study in row \(k-1\), and so on, until the last study, which is placed in the first row). The studies can be reordered with the order
argument:
diff --git a/docs/reference/formatters.html b/docs/reference/formatters.html
index 1d53b88cf..c186a53f9 100644
--- a/docs/reference/formatters.html
+++ b/docs/reference/formatters.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/formula.rma.html b/docs/reference/formula.rma.html
index ff1f209ac..7b363726e 100644
--- a/docs/reference/formula.rma.html
+++ b/docs/reference/formula.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -142,13 +142,13 @@ Examples
res <- rma(yi, vi, mods = ~ ablat + alloc, data=dat)
formula(res, type="mods")
#> ~ablat + alloc
-#> <environment: 0x556c7a7e7978>
+#> <environment: 0x562a100592a8>
### specify moderators via 'yi' argument
res <- rma(yi ~ ablat + alloc, vi, data=dat)
formula(res, type="yi")
#> yi ~ ablat + alloc
-#> <environment: 0x556c7971bf20>
+#> <environment: 0x562a0de4b908>
diff --git a/docs/reference/fsn.html b/docs/reference/fsn.html
index 6772c9385..a9fb449fe 100644
--- a/docs/reference/fsn.html
+++ b/docs/reference/fsn.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/funnel.html b/docs/reference/funnel.html
index 610e9d839..67215fb17 100644
--- a/docs/reference/funnel.html
+++ b/docs/reference/funnel.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/gosh.html b/docs/reference/gosh.html
index db6d4573a..b4fbcd905 100644
--- a/docs/reference/gosh.html
+++ b/docs/reference/gosh.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/hc.html b/docs/reference/hc.html
index 3846b575d..b9b06f96a 100644
--- a/docs/reference/hc.html
+++ b/docs/reference/hc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/index.html b/docs/reference/index.html
index b199669ac..42437e11e 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/influence.rma.mv.html b/docs/reference/influence.rma.mv.html
index ca0e26432..8a796792b 100644
--- a/docs/reference/influence.rma.mv.html
+++ b/docs/reference/influence.rma.mv.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/influence.rma.uni.html b/docs/reference/influence.rma.uni.html
index d8e2dbdc7..2da3e264a 100644
--- a/docs/reference/influence.rma.uni.html
+++ b/docs/reference/influence.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/labbe.html b/docs/reference/labbe.html
index 55051d0a3..60fac43ae 100644
--- a/docs/reference/labbe.html
+++ b/docs/reference/labbe.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/leave1out.html b/docs/reference/leave1out.html
index 726b7ff5c..1f857c1c7 100644
--- a/docs/reference/leave1out.html
+++ b/docs/reference/leave1out.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/llplot.html b/docs/reference/llplot.html
index b9cb1e0a6..a6ab57372 100644
--- a/docs/reference/llplot.html
+++ b/docs/reference/llplot.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/matreg.html b/docs/reference/matreg.html
index 795cb77f5..b4feb3ec2 100644
--- a/docs/reference/matreg.html
+++ b/docs/reference/matreg.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/metafor-package.html b/docs/reference/metafor-package.html
index 5b6b1572e..4579a5da2 100644
--- a/docs/reference/metafor-package.html
+++ b/docs/reference/metafor-package.html
@@ -31,7 +31,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/metafor.news.html b/docs/reference/metafor.news.html
index e5d8a8073..4ee08380c 100644
--- a/docs/reference/metafor.news.html
+++ b/docs/reference/metafor.news.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -115,7 +115,7 @@ References
Examples
# \dontrun{
metafor.news()
-#> Changes in version 4.7-29 (2024-09-04)
+#> Changes in version 4.7-30 (2024-09-09)
#>
#> - some general changes to the various forest() functions: argument
#> header is now TRUE by default, the y-axis is now created with
diff --git a/docs/reference/methods.anova.rma.html b/docs/reference/methods.anova.rma.html
index f92c804e1..098e907fc 100644
--- a/docs/reference/methods.anova.rma.html
+++ b/docs/reference/methods.anova.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/methods.confint.rma.html b/docs/reference/methods.confint.rma.html
index 46a0bca9d..3caa810ad 100644
--- a/docs/reference/methods.confint.rma.html
+++ b/docs/reference/methods.confint.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/methods.escalc.html b/docs/reference/methods.escalc.html
index d7af00b1d..918959d12 100644
--- a/docs/reference/methods.escalc.html
+++ b/docs/reference/methods.escalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/methods.list.rma.html b/docs/reference/methods.list.rma.html
index 5a0dd1fee..b5b308757 100644
--- a/docs/reference/methods.list.rma.html
+++ b/docs/reference/methods.list.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/methods.matreg.html b/docs/reference/methods.matreg.html
index 6716fb5b5..13f6f5a13 100644
--- a/docs/reference/methods.matreg.html
+++ b/docs/reference/methods.matreg.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/methods.vif.rma.html b/docs/reference/methods.vif.rma.html
index 4e1c69427..c87a4fff6 100644
--- a/docs/reference/methods.vif.rma.html
+++ b/docs/reference/methods.vif.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/mfopt.html b/docs/reference/mfopt.html
index f788e876e..038e17f06 100644
--- a/docs/reference/mfopt.html
+++ b/docs/reference/mfopt.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/misc-models.html b/docs/reference/misc-models.html
index af627edc6..3c011a3d9 100644
--- a/docs/reference/misc-models.html
+++ b/docs/reference/misc-models.html
@@ -31,7 +31,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/misc-options.html b/docs/reference/misc-options.html
index 5e2bdbfb6..d536d16b2 100644
--- a/docs/reference/misc-options.html
+++ b/docs/reference/misc-options.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/misc-recs.html b/docs/reference/misc-recs.html
index 007ebd011..742c81a13 100644
--- a/docs/reference/misc-recs.html
+++ b/docs/reference/misc-recs.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/model.matrix.rma.html b/docs/reference/model.matrix.rma.html
index 27e02108b..6ab36c276 100644
--- a/docs/reference/model.matrix.rma.html
+++ b/docs/reference/model.matrix.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/pairmat.html b/docs/reference/pairmat.html
index 9fe558c3f..fcf53ff55 100644
--- a/docs/reference/pairmat.html
+++ b/docs/reference/pairmat.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/permutest.html b/docs/reference/permutest.html
index c49155d68..248274622 100644
--- a/docs/reference/permutest.html
+++ b/docs/reference/permutest.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.cumul.rma.html b/docs/reference/plot.cumul.rma.html
index fa5172d8b..fff84b685 100644
--- a/docs/reference/plot.cumul.rma.html
+++ b/docs/reference/plot.cumul.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.gosh.rma.html b/docs/reference/plot.gosh.rma.html
index 8413f3cc5..2570fd28a 100644
--- a/docs/reference/plot.gosh.rma.html
+++ b/docs/reference/plot.gosh.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.infl.rma.uni.html b/docs/reference/plot.infl.rma.uni.html
index bc4c331cc..7581f27f2 100644
--- a/docs/reference/plot.infl.rma.uni.html
+++ b/docs/reference/plot.infl.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.permutest.rma.uni.html b/docs/reference/plot.permutest.rma.uni.html
index 2a3ebe3d3..38cebbe43 100644
--- a/docs/reference/plot.permutest.rma.uni.html
+++ b/docs/reference/plot.permutest.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.rma.html b/docs/reference/plot.rma.html
index 62dd8d06c..308f2cc2a 100644
--- a/docs/reference/plot.rma.html
+++ b/docs/reference/plot.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.rma.uni.selmodel.html b/docs/reference/plot.rma.uni.selmodel.html
index 7f3e771ad..7018d27fa 100644
--- a/docs/reference/plot.rma.uni.selmodel.html
+++ b/docs/reference/plot.rma.uni.selmodel.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/plot.vif.rma.html b/docs/reference/plot.vif.rma.html
index cbbbecb9e..fed7318d5 100644
--- a/docs/reference/plot.vif.rma.html
+++ b/docs/reference/plot.vif.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/predict.rma.html b/docs/reference/predict.rma.html
index f74982b7e..899ddf14a 100644
--- a/docs/reference/predict.rma.html
+++ b/docs/reference/predict.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.anova.rma.html b/docs/reference/print.anova.rma.html
index f4a7f6816..1845b095f 100644
--- a/docs/reference/print.anova.rma.html
+++ b/docs/reference/print.anova.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.confint.rma.html b/docs/reference/print.confint.rma.html
index 4c4e03310..32e3269dc 100644
--- a/docs/reference/print.confint.rma.html
+++ b/docs/reference/print.confint.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.escalc.html b/docs/reference/print.escalc.html
index 34dd3a523..7843e6d89 100644
--- a/docs/reference/print.escalc.html
+++ b/docs/reference/print.escalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -134,10 +134,10 @@ Arguments
numeric value between 0 and 100 to specify the confidence interval level (the default is 95; see here for details).
olim
-optional argument to specify observation/outcome limits. If unspecified, no limits are used.
+argument to specify observation/outcome limits. If unspecified, no limits are used.
transf
-optional argument to specify a function to transform the observed effect sizes or outcomes and interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used. Any additional arguments needed for the function specified here can be passed via ...
.
+argument to specify a function to transform the observed effect sizes or outcomes and interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used. Any additional arguments needed for the function specified here can be passed via ...
.
...
other arguments.
diff --git a/docs/reference/print.fsn.html b/docs/reference/print.fsn.html
index f19abe4f9..340d4ef5e 100644
--- a/docs/reference/print.fsn.html
+++ b/docs/reference/print.fsn.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.gosh.rma.html b/docs/reference/print.gosh.rma.html
index b9c0bb7a3..8504d0c1c 100644
--- a/docs/reference/print.gosh.rma.html
+++ b/docs/reference/print.gosh.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.hc.rma.uni.html b/docs/reference/print.hc.rma.uni.html
index bd691e46a..3cbc6552b 100644
--- a/docs/reference/print.hc.rma.uni.html
+++ b/docs/reference/print.hc.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.list.rma.html b/docs/reference/print.list.rma.html
index 957c01130..c8bde668f 100644
--- a/docs/reference/print.list.rma.html
+++ b/docs/reference/print.list.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.matreg.html b/docs/reference/print.matreg.html
index a497225c0..3364aee23 100644
--- a/docs/reference/print.matreg.html
+++ b/docs/reference/print.matreg.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.permutest.rma.uni.html b/docs/reference/print.permutest.rma.uni.html
index 0833d8dce..f903a29ba 100644
--- a/docs/reference/print.permutest.rma.uni.html
+++ b/docs/reference/print.permutest.rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.ranktest.rma.html b/docs/reference/print.ranktest.rma.html
index e2a5a9804..0b5282d20 100644
--- a/docs/reference/print.ranktest.rma.html
+++ b/docs/reference/print.ranktest.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.regtest.rma.html b/docs/reference/print.regtest.rma.html
index 686d4a9ad..11363cd2d 100644
--- a/docs/reference/print.regtest.rma.html
+++ b/docs/reference/print.regtest.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/print.rma.html b/docs/reference/print.rma.html
index fb452ed8e..e962c1da1 100644
--- a/docs/reference/print.rma.html
+++ b/docs/reference/print.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/profile.rma.html b/docs/reference/profile.rma.html
index 1b46cc0ac..8cc9872a0 100644
--- a/docs/reference/profile.rma.html
+++ b/docs/reference/profile.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/qqnorm.rma.html b/docs/reference/qqnorm.rma.html
index dab1d416f..19dc0bb90 100644
--- a/docs/reference/qqnorm.rma.html
+++ b/docs/reference/qqnorm.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/radial.html b/docs/reference/radial.html
index 09d79a5e4..c37d3ab9a 100644
--- a/docs/reference/radial.html
+++ b/docs/reference/radial.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/ranef.html b/docs/reference/ranef.html
index 1a1f00e1d..3a80e571b 100644
--- a/docs/reference/ranef.html
+++ b/docs/reference/ranef.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/ranktest.html b/docs/reference/ranktest.html
index bfc812ce7..737ea7026 100644
--- a/docs/reference/ranktest.html
+++ b/docs/reference/ranktest.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rcalc.html b/docs/reference/rcalc.html
index ce581e0bb..6136b224f 100644
--- a/docs/reference/rcalc.html
+++ b/docs/reference/rcalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/regplot-11.png b/docs/reference/regplot-11.png
new file mode 100644
index 000000000..87997d20d
Binary files /dev/null and b/docs/reference/regplot-11.png differ
diff --git a/docs/reference/regplot-12.png b/docs/reference/regplot-12.png
new file mode 100644
index 000000000..3abab069e
Binary files /dev/null and b/docs/reference/regplot-12.png differ
diff --git a/docs/reference/regplot-13.png b/docs/reference/regplot-13.png
new file mode 100644
index 000000000..d2a1f4461
Binary files /dev/null and b/docs/reference/regplot-13.png differ
diff --git a/docs/reference/regplot.html b/docs/reference/regplot.html
index 51bffa78c..3e9c0ffed 100644
--- a/docs/reference/regplot.html
+++ b/docs/reference/regplot.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -137,10 +137,10 @@ Arguments
y-axis limits. If unspecified, the function sets the y-axis limits to some sensible values.
predlim
-optional argument to specify the limits of the (marginal) regression line. If unspecified, the limits are based on the range of the moderator variable.
+argument to specify the limits of the (marginal) regression line. If unspecified, the limits are based on the range of the moderator variable.
olim
-optional argument to specify observation/outcome limits. If unspecified, no limits are used.
+argument to specify observation/outcome limits. If unspecified, no limits are used.
xlab
title for the x-axis. If unspecified, the function sets an appropriate axis title.
@@ -155,10 +155,10 @@ Arguments
integer to specify the number of decimal places to which the tick mark labels of the y-axis should be rounded. When specifying an integer (e.g., 2L
), trailing zeros after the decimal mark are dropped for the y-axis labels. When specifying a numeric value (e.g., 2
), trailing zeros are retained.
transf
-optional argument to specify a function to transform the observed outcomes, predicted values, and confidence/prediction interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used.
+argument to specify a function to transform the observed outcomes, predicted values, and confidence/prediction interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used.
atransf
-optional argument to specify a function to transform the y-axis labels (e.g., atransf=exp
; see also transf). If unspecified, no transformation is used.
+argument to specify a function to transform the y-axis labels (e.g., atransf=exp
; see also transf). If unspecified, no transformation is used.
targs
optional arguments needed by the function specified via transf
or atransf
.
@@ -170,7 +170,7 @@ Arguments
plotting symbol to use for the observed outcomes. By default, an open circle is used. Can also be a vector of values. See points
for other options.
psize
-optional numeric value to specify the point sizes for the observed outcomes. If unspecified, the point sizes are a function of the model weights. Can also be a vector of values. Can also be a character string (either "seinv"
or "vinv"
) to make the point sizes proportional to the inverse standard errors or inverse sampling variances.
+numeric value to specify the point sizes for the observed outcomes. If unspecified, the point sizes are a function of the model weights. Can also be a vector of values. Can also be a character string (either "seinv"
or "vinv"
) to make the point sizes proportional to the inverse standard errors or inverse sampling variances.
plim
numeric vector of length 2 to scale the point sizes (ignored when a numeric value or vector is specified for psize
). See ‘Details’.
@@ -182,7 +182,7 @@ Arguments
character string to specify the background color of open plot symbols. Can also be a vector.
slab
-optional vector with labels for the \(k\) studies. If unspecified, the function tries to extract study labels from x
.
+vector with labels for the \(k\) studies. If unspecified, the function tries to extract study labels from x
.
grid
logical to specify whether a grid should be added to the plot. Can also be a color name for the grid.
@@ -472,6 +472,143 @@ Examples
### add points back to the plot (so they are on top of the lines)
points(tmp)
+
+############################################################################
+
+### an example where we place a dichotomous variable on the x-axis
+
+### dichotomize the 'random' variable
+dat$random <- ifelse(dat$alloc == "random", 1, 0)
+
+### fit mixed-effects model with this dummy variable as moderator
+res <- rma(yi, vi, mods = ~ random, data=dat)
+res
+#>
+#> Mixed-Effects Model (k = 13; tau^2 estimator: REML)
+#>
+#> tau^2 (estimated amount of residual heterogeneity): 0.3184 (SE = 0.1779)
+#> tau (square root of estimated tau^2 value): 0.5642
+#> I^2 (residual heterogeneity / unaccounted variability): 89.92%
+#> H^2 (unaccounted variability / sampling variability): 9.92
+#> R^2 (amount of heterogeneity accounted for): 0.00%
+#>
+#> Test for Residual Heterogeneity:
+#> QE(df = 11) = 138.5113, p-val < .0001
+#>
+#> Test of Moderators (coefficient 2):
+#> QM(df = 1) = 1.8327, p-val = 0.1758
+#>
+#> Model Results:
+#>
+#> estimate se zval pval ci.lb ci.ub
+#> intrcpt -0.4673 0.2574 -1.8157 0.0694 -0.9717 0.0371 .
+#> random -0.4900 0.3619 -1.3538 0.1758 -1.1994 0.2194
+#>
+#> ---
+#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+#>
+
+### draw bubble plot
+regplot(res, mod="random")
+
+
+### draw bubble plot and add a nicer x-axis
+regplot(res, mod="random", xlab="Method of Treatment Allocation", xaxt="n")
+axis(side=1, at=c(0,1), labels=c("Non-Random", "Random"))
+
+
+############################################################################
+
+### an example where we place a categorical variable with more than two levels
+### on the x-axis; this is done with a small trick, representing the moderator
+### as a polynomial regression model
+
+### fit mixed-effects model with a three-level factor
+res <- rma(yi, vi, mods = ~ alloc, data=dat)
+res
+#>
+#> Mixed-Effects Model (k = 13; tau^2 estimator: REML)
+#>
+#> tau^2 (estimated amount of residual heterogeneity): 0.3615 (SE = 0.2111)
+#> tau (square root of estimated tau^2 value): 0.6013
+#> I^2 (residual heterogeneity / unaccounted variability): 88.77%
+#> H^2 (unaccounted variability / sampling variability): 8.91
+#> R^2 (amount of heterogeneity accounted for): 0.00%
+#>
+#> Test for Residual Heterogeneity:
+#> QE(df = 10) = 132.3676, p-val < .0001
+#>
+#> Test of Moderators (coefficients 2:3):
+#> QM(df = 2) = 1.7675, p-val = 0.4132
+#>
+#> Model Results:
+#>
+#> estimate se zval pval ci.lb ci.ub
+#> intrcpt -0.5180 0.4412 -1.1740 0.2404 -1.3827 0.3468
+#> allocrandom -0.4478 0.5158 -0.8682 0.3853 -1.4588 0.5632
+#> allocsystematic 0.0890 0.5600 0.1590 0.8737 -1.0086 1.1867
+#>
+#> ---
+#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+#>
+
+### compute the predicted pooled effect for each level of the factor
+predict(res, newmods=rbind(alternate=c(0,0), random=c(1,0), systematic=c(0,1)))
+#>
+#> pred se ci.lb ci.ub pi.lb pi.ub
+#> alternate -0.5180 0.4412 -1.3827 0.3468 -1.9796 0.9437
+#> random -0.9658 0.2672 -1.4896 -0.4420 -2.2554 0.3238
+#> systematic -0.4289 0.3449 -1.1050 0.2472 -1.7875 0.9297
+#>
+
+### represent the three-level factor as a quadratic polynomial model
+dat$anum <- as.numeric(factor(dat$alloc))
+res <- rma(yi, vi, mods = ~ poly(anum, degree=2, raw=TRUE), data=dat)
+res
+#>
+#> Mixed-Effects Model (k = 13; tau^2 estimator: REML)
+#>
+#> tau^2 (estimated amount of residual heterogeneity): 0.3615 (SE = 0.2111)
+#> tau (square root of estimated tau^2 value): 0.6013
+#> I^2 (residual heterogeneity / unaccounted variability): 88.77%
+#> H^2 (unaccounted variability / sampling variability): 8.91
+#> R^2 (amount of heterogeneity accounted for): 0.00%
+#>
+#> Test for Residual Heterogeneity:
+#> QE(df = 10) = 132.3676, p-val < .0001
+#>
+#> Test of Moderators (coefficients 2:3):
+#> QM(df = 2) = 1.7675, p-val = 0.4132
+#>
+#> Model Results:
+#>
+#> estimate se zval pval ci.lb ci.ub
+#> intrcpt 0.9145 1.5854 0.5768 0.5641 -2.1929 4.0219
+#> poly(anum, degree = 2, raw = TRUE)1 -1.9248 1.6208 -1.1876 0.2350 -5.1015 1.2519
+#> poly(anum, degree = 2, raw = TRUE)2 0.4923 0.3871 1.2719 0.2034 -0.2663 1.2510
+#>
+#> ---
+#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+#>
+
+### compute the predicted pooled effect for each level of the factor
+### (note that these values are exactly the same as above)
+pred <- predict(res, newmods=unname(poly(1:3, degree=2, raw=TRUE)))
+pred
+#>
+#> pred se ci.lb ci.ub pi.lb pi.ub
+#> 1 -0.5180 0.4412 -1.3827 0.3468 -1.9796 0.9437
+#> 2 -0.9658 0.2672 -1.4896 -0.4420 -2.2554 0.3238
+#> 3 -0.4289 0.3449 -1.1050 0.2472 -1.7875 0.9297
+#>
+
+### draw bubble plot, placing the linear (1:3) term on the x-axis and add a
+### nicer x-axis for the three levels
+regplot(res, mod=2, pred=pred, xvals=c(1:3), xlim=c(1,3), xlab="Allocation Method", xaxt="n")
+axis(side=1, at=1:3, labels=levels(factor(dat$alloc)))
+
+
+############################################################################
diff --git a/docs/reference/regtest.html b/docs/reference/regtest.html
index 6b389e748..ed20e99e2 100644
--- a/docs/reference/regtest.html
+++ b/docs/reference/regtest.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/replmiss.html b/docs/reference/replmiss.html
index 1b525b26a..72dbd84c5 100644
--- a/docs/reference/replmiss.html
+++ b/docs/reference/replmiss.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/reporter.html b/docs/reference/reporter.html
index 4556b6f8c..78aeb5471 100644
--- a/docs/reference/reporter.html
+++ b/docs/reference/reporter.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -184,12 +184,12 @@ Examples
### generate report
reporter(res)
#>
-#> Directory for generating the report is: /tmp/RtmpK6wHf8
+#> Directory for generating the report is: /tmp/RtmpiWQyvS
#> Copying references.bib and apa.csl to report directory ...
#> Saving model object to report_res.rdata ...
#> Creating report_res.rmd file ...
#> Rendering report_res.rmd file ...
-#> Generated /tmp/RtmpK6wHf8/report_res.html ...
+#> Generated /tmp/RtmpiWQyvS/report_res.html ...
#> Opening report ...
diff --git a/docs/reference/residuals.rma.html b/docs/reference/residuals.rma.html
index 07ab9970b..2d10cb1d2 100644
--- a/docs/reference/residuals.rma.html
+++ b/docs/reference/residuals.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rma.glmm.html b/docs/reference/rma.glmm.html
index e569b5265..b91265044 100644
--- a/docs/reference/rma.glmm.html
+++ b/docs/reference/rma.glmm.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rma.mh.html b/docs/reference/rma.mh.html
index a35026c3a..f202030b9 100644
--- a/docs/reference/rma.mh.html
+++ b/docs/reference/rma.mh.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rma.mv.html b/docs/reference/rma.mv.html
index 9f9ac7c65..eb3392644 100644
--- a/docs/reference/rma.mv.html
+++ b/docs/reference/rma.mv.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rma.peto.html b/docs/reference/rma.peto.html
index 04127448f..0a5b33625 100644
--- a/docs/reference/rma.peto.html
+++ b/docs/reference/rma.peto.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/rma.uni.html b/docs/reference/rma.uni.html
index 55da7a4c5..c4c6a4420 100644
--- a/docs/reference/rma.uni.html
+++ b/docs/reference/rma.uni.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/robust.html b/docs/reference/robust.html
index 722cccba9..7e8fd713b 100644
--- a/docs/reference/robust.html
+++ b/docs/reference/robust.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/se.html b/docs/reference/se.html
index 782bebb40..998cb3aad 100644
--- a/docs/reference/se.html
+++ b/docs/reference/se.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/selmodel.html b/docs/reference/selmodel.html
index 894a67c84..2029bce6b 100644
--- a/docs/reference/selmodel.html
+++ b/docs/reference/selmodel.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/simulate.rma.html b/docs/reference/simulate.rma.html
index 499e8391b..81a59ec22 100644
--- a/docs/reference/simulate.rma.html
+++ b/docs/reference/simulate.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
@@ -112,7 +112,7 @@ Arguments
an object to specify if and how the random number generator should be initialized (‘seeded’). Either NULL
or an integer that will be used in a call to set.seed
before simulating the response vectors. If set, the value is saved as the "seed"
attribute of the returned value. The default, NULL
will not change the random generator state, and return .Random.seed
as the "seed"
attribute; see ‘Value’.
olim
-optional argument to specify observation/outcome limits for the simulated values. If unspecified, no limits are used.
+argument to specify observation/outcome limits for the simulated values. If unspecified, no limits are used.
...
other arguments.
diff --git a/docs/reference/tes.html b/docs/reference/tes.html
index c0d8ab898..9ec2fd6d0 100644
--- a/docs/reference/tes.html
+++ b/docs/reference/tes.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/to.long.html b/docs/reference/to.long.html
index 5c71168d0..a807b542e 100644
--- a/docs/reference/to.long.html
+++ b/docs/reference/to.long.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/to.table.html b/docs/reference/to.table.html
index d3e30c281..5b14c716e 100644
--- a/docs/reference/to.table.html
+++ b/docs/reference/to.table.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/to.wide.html b/docs/reference/to.wide.html
index 5893674f2..025f35172 100644
--- a/docs/reference/to.wide.html
+++ b/docs/reference/to.wide.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/transf.html b/docs/reference/transf.html
index 096876aa2..a9350ef30 100644
--- a/docs/reference/transf.html
+++ b/docs/reference/transf.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/trimfill.html b/docs/reference/trimfill.html
index e3fc1e625..992f4fbad 100644
--- a/docs/reference/trimfill.html
+++ b/docs/reference/trimfill.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/update.rma.html b/docs/reference/update.rma.html
index 620850be7..68f709822 100644
--- a/docs/reference/update.rma.html
+++ b/docs/reference/update.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/vcalc.html b/docs/reference/vcalc.html
index dc1aa6c33..2c65e1e26 100644
--- a/docs/reference/vcalc.html
+++ b/docs/reference/vcalc.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/vcov.rma.html b/docs/reference/vcov.rma.html
index 2157281fd..ca46ca8e4 100644
--- a/docs/reference/vcov.rma.html
+++ b/docs/reference/vcov.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/vec2mat.html b/docs/reference/vec2mat.html
index 275911cf6..9ea8cb445 100644
--- a/docs/reference/vec2mat.html
+++ b/docs/reference/vec2mat.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/vif.html b/docs/reference/vif.html
index 5aa6df632..0421717fb 100644
--- a/docs/reference/vif.html
+++ b/docs/reference/vif.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/docs/reference/weights.rma.html b/docs/reference/weights.rma.html
index 865ce24e8..0052ac787 100644
--- a/docs/reference/weights.rma.html
+++ b/docs/reference/weights.rma.html
@@ -29,7 +29,7 @@
metafor
- 4.7-29
+ 4.7-30
diff --git a/man/addpoly.default.Rd b/man/addpoly.default.Rd
index 3299a8265..8cacf77d7 100644
--- a/man/addpoly.default.Rd
+++ b/man/addpoly.default.Rd
@@ -6,7 +6,7 @@
}
\usage{
\method{addpoly}{default}(x, vi, sei, ci.lb, ci.ub, pi.lb, pi.ub,
- rows=-1, level, annotate, predstyle, digits, width, mlab,
+ rows=-1, level, annotate, predstyle, predlim, digits, width, mlab,
transf, atransf, targs, efac, col, border, lty, fonts, cex,
constarea=FALSE, \dots)
}
@@ -22,6 +22,7 @@
\item{level}{optional numeric value between 0 and 100 to specify the confidence interval level (see \link[=misc-options]{here} for details).}
\item{annotate}{optional logical to specify whether annotations should be added to the plot for the polygons that are drawn.}
\item{predstyle}{character string to specify the style of the prediction interval (either \code{"line"} (the default), \code{"bar"}, \code{"shade"}, or \code{"dist"}; the last three only when adding a single polygon). Can be abbreviated.}
+ \item{predlim}{optional argument to specify the limits of the prediction distribution when \code{predstyle="dist"}.}
\item{digits}{optional integer to specify the number of decimal places to which the annotations should be rounded.}
\item{width}{optional integer to manually adjust the width of the columns for the annotations.}
\item{mlab}{optional character vector of the same length as \code{x} giving labels for the polygons that are drawn.}
diff --git a/man/forest.cumul.rma.Rd b/man/forest.cumul.rma.Rd
index a999384c8..e22ec206a 100644
--- a/man/forest.cumul.rma.Rd
+++ b/man/forest.cumul.rma.Rd
@@ -19,7 +19,7 @@
\item{header}{logical to specify whether column headings should be added to the plot (the default is \code{TRUE}). Can also be a character vector to specify the left and right headings (or only the left one).}
\item{xlim}{horizontal limits of the plot region. If unspecified, the function sets the horizontal plot limits to some sensible values.}
\item{alim}{the x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.}
- \item{olim}{optional argument to specify observation/outcome limits. If unspecified, no limits are used.}
+ \item{olim}{argument to specify observation/outcome limits. If unspecified, no limits are used.}
\item{ylim}{the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).}
\item{at}{position of the x-axis tick marks and corresponding labels. If unspecified, the function sets the tick mark positions/labels to some sensible values.}
\item{steps}{the number of tick marks for the x-axis (the default is 5). Ignored when the positions are specified via the \code{at} argument.}
diff --git a/man/forest.default.Rd b/man/forest.default.Rd
index c045d5bac..dbb434200 100644
--- a/man/forest.default.Rd
+++ b/man/forest.default.Rd
@@ -25,7 +25,7 @@
\item{header}{logical to specify whether column headings should be added to the plot (the default is \code{TRUE}). Can also be a character vector to specify the left and right headings (or only the left one).}
\item{xlim}{horizontal limits of the plot region. If unspecified, the function sets the horizontal plot limits to some sensible values.}
\item{alim}{the x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.}
- \item{olim}{optional argument to specify observation/outcome limits. If unspecified, no limits are used.}
+ \item{olim}{argument to specify observation/outcome limits. If unspecified, no limits are used.}
\item{ylim}{the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).}
\item{at}{position of the x-axis tick marks and corresponding labels. If unspecified, the function sets the tick mark positions/labels to some sensible values.}
\item{steps}{the number of tick marks for the x-axis (the default is 5). Ignored when the positions are specified via the \code{at} argument.}
diff --git a/man/forest.rma.Rd b/man/forest.rma.Rd
index ab8317155..4f04c8eb9 100644
--- a/man/forest.rma.Rd
+++ b/man/forest.rma.Rd
@@ -7,7 +7,7 @@
\usage{
\method{forest}{rma}(x, annotate=TRUE, addfit=TRUE, addpred=FALSE, predstyle="line",
showweights=FALSE, header=TRUE,
- xlim, alim, olim, ylim, at, steps=5,
+ xlim, alim, olim, ylim, predlim, at, steps=5,
level=x$level, refline=0, digits=2L, width,
xlab, slab, mlab, ilab, ilab.lab, ilab.xpos, ilab.pos,
order, transf, atransf, targs, rows,
@@ -26,6 +26,7 @@
\item{alim}{the x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.}
\item{olim}{optional argument to specify observation/outcome limits. If unspecified, no limits are used.}
\item{ylim}{the y-axis limits of the plot. If unspecified, the function sets the y-axis limits to some sensible values. Can also be a single value to set the lower bound (while the upper bound is still set automatically).}
+ \item{predlim}{optional argument to specify the limits of the prediction distribution when \code{predstyle="dist"}.}
\item{at}{position of the x-axis tick marks and corresponding labels. If unspecified, the function sets the tick mark positions/labels to some sensible values.}
\item{steps}{the number of tick marks for the x-axis (the default is 5). Ignored when the positions are specified via the \code{at} argument.}
\item{level}{numeric value between 0 and 100 to specify the confidence interval level (see \link[=misc-options]{here} for details). The default is to take the value from the object.}
@@ -72,10 +73,10 @@
\itemize{
\item \code{predstyle="bar"}: the prediction interval is shown as a bar below the polygon,
\item \code{predstyle="shade"}: the bar is shaded in color intensity in accordance with the density of the prediction distribution,
- \item \code{predstyle="dist"}: the prediction distribution is shown and the regions beyond the prediction interval bounds are shaded in gray; the region below or above zero (depending on whether the pooled estimate is positive or negative) is also shaded in a lighter shade of gray (note: this region may not be visible if the distribution is far away from zero).
+ \item \code{predstyle="dist"}: the prediction distribution is shown and the regions beyond the prediction interval bounds are shaded in gray; the region below or above zero (depending on whether the pooled estimate is positive or negative) is also shaded in a lighter shade of gray.
}
- In all of these cases, the prediction interval bounds are then also provided as part of the annotations.
+ In all of these cases, the prediction interval bounds are then also provided as part of the annotations. For \code{predstyle="dist"}, one can adjust the range of values for which the prediction distribution is shown via the \code{predlim} argument. Note that the shaded regions may not be visible depending on the location/shape of the distribution.
For meta-regression models (i.e., models involving moderators), the fitted value for each study is added as a polygon to the plot. By default, the width of the polygons corresponds to the confidence interval limits for the fitted values. By setting \code{addpred=TRUE}, the width reflects the prediction interval limits. Again, the \code{col} and \code{border} arguments can be used to adjust the (border) color of the polygons. These polygons can be suppressed by setting \code{addfit=FALSE}.
diff --git a/man/print.escalc.Rd b/man/print.escalc.Rd
index eddf4c798..c8abb198a 100644
--- a/man/print.escalc.Rd
+++ b/man/print.escalc.Rd
@@ -21,8 +21,8 @@
\item{append}{logical to specify whether the data frame specified via the \code{object} argument should be returned together with the additional variables that are calculated by the \code{summary} function (the default is \code{TRUE}).}
\item{replace}{logical to specify whether existing values for \code{sei}, \code{zi}, \code{ci.lb}, and \code{ci.ub} in the data frame should be replaced. Only relevant when the data frame already contains these variables. If \code{replace=TRUE} (the default), all of the existing values will be overwritten. If \code{replace=FALSE}, only \code{NA} values will be replaced.}
\item{level}{numeric value between 0 and 100 to specify the confidence interval level (the default is 95; see \link[=misc-options]{here} for details).}
- \item{olim}{optional argument to specify observation/outcome limits. If unspecified, no limits are used.}
- \item{transf}{optional argument to specify a function to transform the observed effect sizes or outcomes and interval bounds (e.g., \code{transf=exp}; see also \link{transf}). If unspecified, no transformation is used. Any additional arguments needed for the function specified here can be passed via \code{\dots}.}
+ \item{olim}{argument to specify observation/outcome limits. If unspecified, no limits are used.}
+ \item{transf}{argument to specify a function to transform the observed effect sizes or outcomes and interval bounds (e.g., \code{transf=exp}; see also \link{transf}). If unspecified, no transformation is used. Any additional arguments needed for the function specified here can be passed via \code{\dots}.}
\item{\dots}{other arguments.}
}
\value{
diff --git a/man/regplot.Rd b/man/regplot.Rd
index b244cd555..84cb0d4c1 100644
--- a/man/regplot.Rd
+++ b/man/regplot.Rd
@@ -27,22 +27,22 @@ regplot(x, \dots)
\item{shade}{logical to specify whether the confidence/prediction interval regions should be shaded (the default is \code{TRUE}). Can also be a two-element character vector to specify the colors for shading the confidence and prediction interval regions (if shading only the former, a single color can also be specified).}
\item{xlim}{x-axis limits. If unspecified, the function sets the x-axis limits to some sensible values.}
\item{ylim}{y-axis limits. If unspecified, the function sets the y-axis limits to some sensible values.}
- \item{predlim}{optional argument to specify the limits of the (marginal) regression line. If unspecified, the limits are based on the range of the moderator variable.}
- \item{olim}{optional argument to specify observation/outcome limits. If unspecified, no limits are used.}
+ \item{predlim}{argument to specify the limits of the (marginal) regression line. If unspecified, the limits are based on the range of the moderator variable.}
+ \item{olim}{argument to specify observation/outcome limits. If unspecified, no limits are used.}
\item{xlab}{title for the x-axis. If unspecified, the function sets an appropriate axis title.}
\item{ylab}{title for the y-axis. If unspecified, the function sets an appropriate axis title.}
\item{at}{position of the y-axis tick marks and corresponding labels. If unspecified, the function sets the tick mark positions/labels to some sensible values.}
\item{digits}{integer to specify the number of decimal places to which the tick mark labels of the y-axis should be rounded. When specifying an integer (e.g., \code{2L}), trailing zeros after the decimal mark are dropped for the y-axis labels. When specifying a numeric value (e.g., \code{2}), trailing zeros are retained.}
- \item{transf}{optional argument to specify a function to transform the observed outcomes, predicted values, and confidence/prediction interval bounds (e.g., \code{transf=exp}; see also \link{transf}). If unspecified, no transformation is used.}
- \item{atransf}{optional argument to specify a function to transform the y-axis labels (e.g., \code{atransf=exp}; see also \link{transf}). If unspecified, no transformation is used.}
+ \item{transf}{argument to specify a function to transform the observed outcomes, predicted values, and confidence/prediction interval bounds (e.g., \code{transf=exp}; see also \link{transf}). If unspecified, no transformation is used.}
+ \item{atransf}{argument to specify a function to transform the y-axis labels (e.g., \code{atransf=exp}; see also \link{transf}). If unspecified, no transformation is used.}
\item{targs}{optional arguments needed by the function specified via \code{transf} or \code{atransf}.}
\item{level}{numeric value between 0 and 100 to specify the confidence/prediction interval level (see \link[=misc-options]{here} for details). The default is to take the value from the object.}
\item{pch}{plotting symbol to use for the observed outcomes. By default, an open circle is used. Can also be a vector of values. See \code{\link{points}} for other options.}
- \item{psize}{optional numeric value to specify the point sizes for the observed outcomes. If unspecified, the point sizes are a function of the model weights. Can also be a vector of values. Can also be a character string (either \code{"seinv"} or \code{"vinv"}) to make the point sizes proportional to the inverse standard errors or inverse sampling variances.}
+ \item{psize}{numeric value to specify the point sizes for the observed outcomes. If unspecified, the point sizes are a function of the model weights. Can also be a vector of values. Can also be a character string (either \code{"seinv"} or \code{"vinv"}) to make the point sizes proportional to the inverse standard errors or inverse sampling variances.}
\item{plim}{numeric vector of length 2 to scale the point sizes (ignored when a numeric value or vector is specified for \code{psize}). See \sQuote{Details}.}
\item{col}{character string to specify the (border) color of the points. Can also be a vector.}
\item{bg}{character string to specify the background color of open plot symbols. Can also be a vector.}
- \item{slab}{optional vector with labels for the \mjseqn{k} studies. If unspecified, the function tries to extract study labels from \code{x}.}
+ \item{slab}{vector with labels for the \mjseqn{k} studies. If unspecified, the function tries to extract study labels from \code{x}.}
\item{grid}{logical to specify whether a grid should be added to the plot. Can also be a color name for the grid.}
\item{refline}{optional numeric value to specify the location of a horizontal reference line that should be added to the plot.}
\item{label}{argument to control the labeling of the points (the default is \code{FALSE}). See \sQuote{Details}.}
@@ -179,5 +179,53 @@ lines(xs, preds$pred, lwd=3)
### add points back to the plot (so they are on top of the lines)
points(tmp)
+
+############################################################################
+
+### an example where we place a dichotomous variable on the x-axis
+
+### dichotomize the 'random' variable
+dat$random <- ifelse(dat$alloc == "random", 1, 0)
+
+### fit mixed-effects model with this dummy variable as moderator
+res <- rma(yi, vi, mods = ~ random, data=dat)
+res
+
+### draw bubble plot
+regplot(res, mod="random")
+
+### draw bubble plot and add a nicer x-axis
+regplot(res, mod="random", xlab="Method of Treatment Allocation", xaxt="n")
+axis(side=1, at=c(0,1), labels=c("Non-Random", "Random"))
+
+############################################################################
+
+### an example where we place a categorical variable with more than two levels
+### on the x-axis; this is done with a small trick, representing the moderator
+### as a polynomial regression model
+
+### fit mixed-effects model with a three-level factor
+res <- rma(yi, vi, mods = ~ alloc, data=dat)
+res
+
+### compute the predicted pooled effect for each level of the factor
+predict(res, newmods=rbind(alternate=c(0,0), random=c(1,0), systematic=c(0,1)))
+
+### represent the three-level factor as a quadratic polynomial model
+dat$anum <- as.numeric(factor(dat$alloc))
+res <- rma(yi, vi, mods = ~ poly(anum, degree=2, raw=TRUE), data=dat)
+res
+
+### compute the predicted pooled effect for each level of the factor
+### (note that these values are exactly the same as above)
+pred <- predict(res, newmods=unname(poly(1:3, degree=2, raw=TRUE)))
+pred
+
+### draw bubble plot, placing the linear (1:3) term on the x-axis and add a
+### nicer x-axis for the three levels
+regplot(res, mod=2, pred=pred, xvals=c(1:3), xlim=c(1,3), xlab="Allocation Method", xaxt="n")
+axis(side=1, at=1:3, labels=levels(factor(dat$alloc)))
+
+############################################################################
}
\keyword{hplot}
diff --git a/man/simulate.rma.Rd b/man/simulate.rma.Rd
index 02b0c7498..ab6fe431f 100644
--- a/man/simulate.rma.Rd
+++ b/man/simulate.rma.Rd
@@ -12,7 +12,7 @@
\item{object}{an object of class \code{"rma"}.}
\item{nsim}{number of response vectors to simulate (defaults to 1).}
\item{seed}{an object to specify if and how the random number generator should be initialized (\sQuote{seeded}). Either \code{NULL} or an integer that will be used in a call to \code{set.seed} before simulating the response vectors. If set, the value is saved as the \code{"seed"} attribute of the returned value. The default, \code{NULL} will not change the random generator state, and return \code{\link{.Random.seed}} as the \code{"seed"} attribute; see \sQuote{Value}.}
- \item{olim}{optional argument to specify observation/outcome limits for the simulated values. If unspecified, no limits are used.}
+ \item{olim}{argument to specify observation/outcome limits for the simulated values. If unspecified, no limits are used.}
\item{\dots}{other arguments.}
}
\details{
diff --git a/tests/testthat/images/test_plots_forest_plot_with_predstyle_d_transf.png b/tests/testthat/images/test_plots_forest_plot_with_predstyle_d_transf.png
index 9d54a8ff4..0903a8a33 100644
Binary files a/tests/testthat/images/test_plots_forest_plot_with_predstyle_d_transf.png and b/tests/testthat/images/test_plots_forest_plot_with_predstyle_d_transf.png differ