forest_plot: Plot a forest plot

View source: R/forest_plot.R

forest_plotR Documentation

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.

Author(s)

Christian Roever and Burak Kuersad Guenhan

Source

This function is based foresplot function from foresplot R package.

See Also

foresplot::foresplot

Examples

## 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)


## End(Not run)

gunhanb/metastan documentation built on March 18, 2023, 12:09 a.m.