Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • forestplot
  • master
  • regression
  • v_1.6
  • v_2.0
  • v_2.1
  • v_2.2
  • v_2.3
  • v_2.4
  • v_2.5
  • v_2.6
  • v_2.7
  • v_3.0
  • v_3.1
  • v_3.2
  • v_3.3
  • v_3.4
17 results

Target

Select target project
  • croever/bayesmeta
1 result
Select Git revision
  • forestplot
  • master
  • regression
  • v_1.6
  • v_2.0
  • v_2.1
  • v_2.2
  • v_2.3
  • v_2.4
  • v_2.5
  • v_2.6
  • v_2.7
  • v_3.0
  • v_3.1
  • v_3.2
  • v_3.3
  • v_3.4
17 results
Show changes
Commits on Source (3)
......@@ -2,7 +2,7 @@ Package: bayesmeta
Type: Package
Title: Bayesian Random-Effects Meta-Analysis and Meta-Regression
Version: 3.1
Date: 2022-03-23
Date: 2022-09-14
Authors@R: c(person(given="Christian", family="Roever", role=c("aut","cre"),
email="christian.roever@med.uni-goettingen.de",
comment=c(ORCID="0000-0002-6911-698X")),
......@@ -12,7 +12,7 @@ Authors@R: c(person(given="Christian", family="Roever", role=c("aut","cre"),
Maintainer: Christian Roever <christian.roever@med.uni-goettingen.de>
Depends: forestplot (>= 2.0.0), metafor (>= 2.0-0), mvtnorm (>= 1.1-1), numDeriv (>= 2016.8-1.1)
Suggests: compute.es, knitr, rmarkdown, R.rsp
Description: A collection of functions allowing to derive the posterior distribution of the two parameters in a random-effects meta-analysis, and providing functionality to evaluate joint and marginal posterior probability distributions, predictive distributions, shrinkage effects, posterior predictive p-values, etc.; For more details, see also Roever C (2020) <doi:10.18637/jss.v093.i06>.
Description: A collection of functions allowing to derive the posterior distribution of the model parameters in random-effects meta-analysis or meta-regression, and providing functionality to evaluate joint and marginal posterior probability distributions, predictive distributions, shrinkage effects, posterior predictive p-values, etc.; For more details, see also Roever C (2020) <doi:10.18637/jss.v093.i06>, or Roever C and Friede T (2022) <arXiv:2209.06004>.
License: GPL (>=2)
URL: https://gitlab.gwdg.de/croever/bayesmeta
VignetteBuilder: knitr, R.rsp
......@@ -792,7 +792,7 @@ bayesmeta.default <- function(y, sigma, labels=names(y),
c("tau","mu","theta")))
expectation <- try(integrate(function(x)return(dposterior(x)*x), lower=0, upper=Inf,
rel.tol=rel.tol.integrate, abs.tol=abs.tol.integrate)$value, silent=TRUE)
if (class(expectation)=="try-error") {
if (inherits(expectation, "try-error")) {
expectation <- NA
variance <- NA
}
......@@ -800,7 +800,7 @@ bayesmeta.default <- function(y, sigma, labels=names(y),
variance <- try(integrate(function(x)return(dposterior(x)*(x-expectation)^2), lower=0, upper=Inf,
rel.tol=rel.tol.integrate, abs.tol=abs.tol.integrate)$value,
silent=TRUE)
if (class(variance)=="try-error")
if (inherits(variance, "try-error"))
variance <- NA
}
sumstats[c("mean","sd"),"tau"] <- c(expectation, sqrt(variance))
......
......@@ -63,9 +63,15 @@ beta.convert <- function(beta, which.beta, d, betanames)
if (missing(which.beta)) { # default "which.beta"
betaIdx <- 1:d
} else { # try to make sense of "which.beta" argument; general sanity checks:
#if (!is.vector(which.beta)
# || (!is.element(class(which.beta),
# c("numeric", "integer", "logical", "character"))
# | (length(which.beta) > d))) {
# warning("Cannot make sense of \"which.beta\" argument (1).")
#}
if (!is.vector(which.beta)
|| (!is.element(class(which.beta),
c("numeric", "integer", "logical", "character"))
|| (!inherits(which.beta,
c("numeric", "integer", "logical", "character"))
| (length(which.beta) > d))) {
warning("Cannot make sense of \"which.beta\" argument (1).")
}
......@@ -430,13 +436,23 @@ bmr.default <- function(y, sigma, labels = names(y),
missing(beta) || (is.matrix(beta) | is.data.frame(beta) | is.vector(beta)))
if (!missing(beta)) {
if (!missing(which.beta)) { # general sanity checks
#if (!is.vector(which.beta)
# || (!is.element(class(which.beta),
# c("numeric", "integer", "logical", "character"))
# | ((class(which.beta)=="logical")
# && ((length(which.beta) != d) | (sum(which.beta)!=1)))
# | ((is.element(class(which.beta),
# c("numeric", "integer", "character"))
# & (length(which.beta) != 1))))) {
# warning("Cannot make sense of \"which.beta\" argument (1).")
#}
if (!is.vector(which.beta)
|| (!is.element(class(which.beta),
c("numeric", "integer", "logical", "character"))
| ((class(which.beta)=="logical")
|| (!inherits(which.beta,
c("numeric", "integer", "logical", "character"))
| (inherits(which.beta, "logical")
&& ((length(which.beta) != d) | (sum(which.beta)!=1)))
| ((is.element(class(which.beta),
c("numeric", "integer", "character"))
| ((inherits(which.beta,
c("numeric", "integer", "character"))
& (length(which.beta) != 1))))) {
warning("Cannot make sense of \"which.beta\" argument (1).")
}
......@@ -517,13 +533,23 @@ bmr.default <- function(y, sigma, labels = names(y),
missing(beta.p) || (is.matrix(beta.p) | is.data.frame(beta.p) | is.vector(beta.p)))
if (!missing(beta.p)) {
if (!missing(which.beta)) { # general sanity checks
#if (!is.vector(which.beta)
# || (!is.element(class(which.beta),
# c("numeric", "integer", "logical", "character"))
# | ((class(which.beta)=="logical")
# & ((length(which.beta) != d) | (sum(which.beta) != 1)))
# | ((is.element(class(which.beta),
# c("numeric", "integer", "character"))
# & (length(which.beta) != 1))))) {
# warning("Cannot make sense of \"which.beta\" argument (1).")
#}
if (!is.vector(which.beta)
|| (!is.element(class(which.beta),
c("numeric", "integer", "logical", "character"))
| ((class(which.beta)=="logical")
& ((length(which.beta) != d) | (sum(which.beta) != 1)))
| ((is.element(class(which.beta),
c("numeric", "integer", "character"))
|| (!inherits(which.beta,
c("numeric", "integer", "logical", "character"))
| (inherits(which.beta,"logical")
& ((length(which.beta) != d) | (sum(which.beta) != 1)))
| ((inherits(which.beta,
c("numeric", "integer", "character"))
& (length(which.beta) != 1))))) {
warning("Cannot make sense of \"which.beta\" argument (1).")
}
......@@ -1248,7 +1274,7 @@ bmr.default <- function(y, sigma, labels = names(y),
lower=0, upper=Inf,
rel.tol=rel.tol.integrate,
abs.tol=abs.tol.integrate)$value, silent=TRUE)
if (class(expectation)=="try-error") {
if (inherits(expectation,"try-error")) {
expectation <- NA
variance <- NA
} else {
......@@ -1256,7 +1282,7 @@ bmr.default <- function(y, sigma, labels = names(y),
lower=0, upper=Inf,
rel.tol=rel.tol.integrate,
abs.tol=abs.tol.integrate)$value, silent=TRUE)
if (class(variance)=="try-error")
if (inherits(variance, "try-error"))
variance <- NA
}
sumstats[c("mean","sd"), "tau"] <- c(expectation, sqrt(variance))
......@@ -1583,7 +1609,7 @@ summary.bmr <- function(object, X.mean, X.prediction, ...)
{
############################################################
# default treatment of "X.mean" argument:
if (missing(X.mean) || (is.null(X.mean) || is.na(X.mean))) {
if (missing(X.mean) || (is.null(X.mean) || all(is.na(X.mean)))) {
X.mean <- NULL
meanNumber <- 0
} else {
......@@ -1597,7 +1623,7 @@ summary.bmr <- function(object, X.mean, X.prediction, ...)
meanNumber <- nrow(X.mean)
}
# default treatment of "X.prediction" argument:
if (missing(X.prediction) || (is.null(X.prediction) || is.na(X.prediction))) {
if (missing(X.prediction) || (is.null(X.prediction) || all(is.na(X.prediction)))) {
X.prediction <- NULL
predNumber <- 0
} else {
......@@ -1672,7 +1698,7 @@ summary.bmr <- function(object, X.mean, X.prediction, ...)
}
}
maxi <- optimize(function(b){return(object$dpredict(theta=b, x=X.prediction[i,], mean=FALSE))},
lower=summary.mean[,"95% lower"], upper=summary.mean[,"95% upper"],
lower=summary.pred[,"95% lower"], upper=summary.pred[,"95% upper"],
maximum=TRUE)
summary.pred[i,"mode"] <- maxi$maximum
}
......
......@@ -41,7 +41,12 @@
\emph{Journal of Clinical Epidemiology}, \bold{50}(6):683-691, 1997.
\doi{10.1016/S0895-4356(97)00049-8}.
}
\references{J.P.T. Higgins, J. Thomas, J. Chandler, M. Cumpston, T. Li,
\references{
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
J.P.T. Higgins, J. Thomas, J. Chandler, M. Cumpston, T. Li,
M.J. Page, V.A. Welch (eds.).
\emph{Cochrane handbook for systematic reviews of interventions}.
Wiley and Sons, 2nd edition, 2019.
......
......@@ -46,7 +46,17 @@
\seealso{
\code{\link{GoralczykEtAl2011}}.
}
\references{T.G. Heffron et al.
\references{
C. Roever.
Bayesian random-effects meta-analysis using the bayesmeta R package.
\emph{Journal of Statistical Software}, \bold{93}(6):1-51, 2020.
\doi{10.18637/jss.v093.i06}.
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
T.G. Heffron et al.
Pediatric liver transplantation with daclizumab induction therapy.
\emph{Transplantation}, \bold{75}(12):2040-2043, 2003.
\doi{10.1097/01.TP.0000065740.69296.DA}.
......
......@@ -31,6 +31,10 @@
\emph{Multiple Sclerosis Journal}, \bold{25}(11):1462-1471, 2019.
\doi{10.1177/1352458518794063}.
}
\references{C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
}
\examples{
# load data:
data("NicholasEtAl2019")
......
......@@ -40,6 +40,10 @@
\bold{216}(2):110-120, 2017.
\doi{10.1016/j.ajog.2016.09.076}.
}
\references{C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
}
\seealso{
\code{\link{bmr}}, \code{\link[metafor]{escalc}},
\code{\link[stats]{model.matrix}}.
......
......@@ -19,7 +19,8 @@
age-related macular degeneration (AMD)} was considered. Trial
design, and in particular considerations regarding the required sample
size, hinge on the expected amount of variability in the primary
endpoint (here: \emph{visual acuity}).
endpoint (here: \emph{visual acuity}, which is measured on a scale
ranging from 0 to 100 via an eye test chart).
Historical data from six previous trials are available (Szabo \emph{et
al.}; 2015), each trial providing an estimate \eqn{\hat{s}_i}{s[i]} of
......@@ -30,7 +31,7 @@
\deqn{y_i=\log(\hat{s}_i) \quad \mbox{and} \quad
\sigma_i=\sqrt{\frac{1}{2\,\nu_i}}}{y[i] = log(s[i]) and sigma[i] = sqrt(1/(2*nu[i]))}
The \emph{unit information standard deviation} for a logarithmic
The \emph{unit information standard deviation (UISD)} for a logarithmic
standard deviation then is at approximately
\eqn{\frac{1}{\sqrt{2}}}{2^-0.5}.
}
......
......@@ -5,27 +5,28 @@
Bayesian Random-Effects Meta-Analysis and Meta-Regression
}
\description{
Description: A collection of functions allowing to derive the
posterior distribution of the two parameters in a random-effects
meta-analysis, and providing functionality to evaluate joint and
A collection of functions allowing to derive the posterior
distribution of the model parameters in random-effects meta-analysis
or meta-regression, and providing functionality to evaluate joint and
marginal posterior probability distributions, predictive
distributions, shrinkage effects, posterior predictive p-values,
etc.
distributions, shrinkage effects, posterior predictive p-values, etc.
}
\details{
\tabular{ll}{
Package: \tab bayesmeta\cr
Type: \tab Package\cr
Version: \tab 3.1\cr
Date: \tab 2022-03-23\cr
Date: \tab 2022-09-14\cr
License: \tab GPL (>=2)
}
The main functionality is provided by the \code{\link{bayesmeta}()}
function. It takes the data (estimates and associated standard
errors) and prior information (effect and heterogeneity priors), and
returns an object containing functions that allow to derive posterior
quantities like joint or marginal densities, quantiles, etc.
The \code{\link{bmr}()} function extends the approach to meta-regression.
and \code{\link{bmr}()} function. It takes the data (estimates and
associated standard errors) and prior information (effect and
heterogeneity priors), and returns an object containing functions that
allow to derive posterior quantities like joint or marginal densities,
quantiles, etc. The \code{\link{bmr}()} function extends the approach
to meta-regression by allowing to specify covariables (moderators) in
addition.
}
\author{
Christian Roever <christian.roever@med.uni-goettingen.de>
......@@ -39,6 +40,10 @@ Christian Roever <christian.roever@med.uni-goettingen.de>
Bayesian random-effects meta-analysis using the bayesmeta R package.
\emph{Journal of Statistical Software}, \bold{93}(6):1-51, 2020.
\doi{10.18637/jss.v093.i06}.
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
}
\keyword{ models }
\keyword{ package }
......
......@@ -319,6 +319,10 @@
the \code{bmr} object.}
}
\references{
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
C. Roever.
Bayesian random-effects meta-analysis using the bayesmeta R package.
\emph{Journal of Statistical Software}, \bold{93}(6):1-51, 2020.
......
......@@ -90,6 +90,10 @@
Christian Roever \email{christian.roever@med.uni-goettingen.de}
}
\references{
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
C. Roever.
Bayesian random-effects meta-analysis using the bayesmeta R package.
\emph{Journal of Statistical Software}, \bold{93}(6):1-51, 2020.
......
......@@ -70,7 +70,8 @@
\seealso{
\code{\link[metafor]{escalc}},
\code{\link[forestplot]{forestplot}},
\code{\link{forestplot.bayesmeta}}.
\code{\link{forestplot.bayesmeta}},
\code{\link{forestplot.bmr}}.
}
\examples{
# load data:
......
......@@ -53,6 +53,11 @@
\author{
Christian Roever \email{christian.roever@med.uni-goettingen.de}
}
\references{
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
}
\examples{
\dontrun{
# perform a meta-analysis using binary ("indicator") covariables;
......
......@@ -77,6 +77,10 @@
\emph{Journal of Statistical Software}, \bold{93}(6):1-51, 2020.
\doi{10.18637/jss.v093.i06}.
C. Roever, T. Friede.
Using the bayesmeta R package for Bayesian random-effects meta-regression.
\href{https://arxiv.org/abs/2209.06004}{arXiv preprint 2209.06004}, 2022.
D.B. Rubin.
Estimation in parallel randomized experiments.
\emph{Journal of Educational Statistics}, \bold{6}(4):377-401, 1981.
......
File added
%\VignetteIndexEntry{Using the bayesmeta R package for Bayesian random-effects meta-regression}
%\VignetteEngine{R.rsp::asis}