Learn R Programming

bayesmeta (version 3.4)

summary.bmr: Summarizing a bmr object).

Description

Summarizes a bmr object, and (potentially) computes means and predictions.

Usage

# S3 method for bmr
summary(object, X.mean, X.prediction, ...)

Value

A list (of class summary.bmr) containing the following elements:

bmr

the supplied bmr object.

call

an object of class call giving the function call that generated the summary.bmr object.

X.mean, X.prediction

the ‘X.mean’ and ‘X.prediction’ arguments.

mean, prediction

mean and predictions estimates (mode, median, mean, sd, and 95 percent credible intervals)

Arguments

object

a bmr object.

X.mean

a regressor matrix (\(X\)) for effect estimates that are to be derived. The matrix' row names define the labels passed on to the results.

X.prediction

an optional regressor matrix (\(X\)) for predictions that are to be derived. The matrix' row names define the labels passed on to the results.

...

other arguments.

Details

Prints details of the supplied bmr oject.

Specification of the (optional) “X.mean” or “X.prediction” arguments allows to request computation of mean estimates or predictions corresponding to the supplied regressor matrices. Estimates (mode, median, mean, standard deviation, and 95 percent CI) may be retrieved from the returned object's “mean” or “prediction” elements (see example below).

References

C. Roever, T. Friede. Using the bayesmeta R package for Bayesian random-effects meta-regression. Computer Methods and Programs in Biomedicine, 299:107303, 2023. tools:::Rd_expr_doi("10.1016/j.cmpb.2022.107303").

Examples

Run this code
if (FALSE) {
# perform a meta-analysis using binary ("indicator") covariables;
# load data:
data("CrinsEtAl2014")
# compute effect measures (log-OR):
crins.es <- escalc(measure="OR",
                   ai=exp.AR.events,  n1i=exp.total,
                   ci=cont.AR.events, n2i=cont.total,
                   slab=publication, data=CrinsEtAl2014)

# specify regressor matrix (binary indicator variables):
X <- cbind("basiliximab"=as.numeric(crins.es$IL2RA=="basiliximab"),
           "daclizumab" =as.numeric(crins.es$IL2RA=="daclizumab"))
print(X)

# perform meta-analysis:
bmr01 <- bmr(crins.es, X=X,
             tau.prior=function(t){dhalfnormal(t, scale=0.5)})

# show summary:
summary(bmr01)

# show summary with additional estimates and predictions:
summary(bmr01,
        X.mean = rbind("basiliximab" = c(1,0),
                       "daclizumab"  = c(0,1),
                       "difference"  = c(-1,1)),
        X.pred = rbind("basiliximab" = c(1,0),
                       "daclizumab"  = c(0,1)))

# compute mean estimates
smry <- summary(bmr01,
                X.mean = rbind("basiliximab" = c(1,0),
                               "daclizumab"  = c(0,1),
                               "difference"  = c(-1,1)))
# show mean estimates:
smry$mean
}

Run the code above in your browser using DataLab