Learn R Programming

MetaStan (version 1.0.0)

forest_plot: Plot a forest plot

Description

Takes a meta_stan object which is obtained by function meta_stan and plot a forestplot, showing individual estimates along with their 95 percent credible intervals, resulting effect estimate and prediction interval.

Usage

forest_plot(
  x = NULL,
  labels = NULL,
  digits = 2,
  boxsize = 0.3,
  heterogeneity = TRUE,
  col,
  ...
)

Arguments

x

A meta_stan object.

labels

Optional vector with labels for the studies (publication author/year).

digits

A numerical value specifying the number of significant digits to be shown. Default is 2.

boxsize

A numerical value specifying the box size. Default is 0.3.

heterogeneity

A logical value to include heterogeneity estimates (DEFAULT = TRUE)

col

A function specifying the colors. See forestplot::fpColors for details.

...

Further arguments passed to or from other methods.

Value

The return value is invisible NULL.

See Also

foresplot::foresplot

Examples

Run this code
# NOT RUN {
data('dat.Crins2014', package = "MetaStan")
dat_long <- create_MetaStan_dat(dat = dat.Crins2014,
                                    armVars = c(responders = "r", sampleSize = "n"))
bnhm.Crins  <- meta_stan(data = dat_long, likelihood = "binomial",
                         mu_prior = c(0, 10), theta_prior = c(0, 100),
                         tau_prior =  0.5)
forest_plot(bnhm.Crins, xlab = "log-OR", labels = dat.Crins2014$publication)

# }

Run the code above in your browser using DataLab