Learn R Programming

rsimsum (version 0.3.3)

forest.multisimsum: forest method for multisimsum objects

Description

forest() method for objects of class multisimsum.

Usage

# S3 method for multisimsum
forest(obj, sstat, par = NULL, by = NULL,
  target = NULL, level = 0.95, gpars = list(), ...)

Arguments

obj

An object of class multisimsum.

sstat

Summary statistic to plot. Possible choices are: nsim, number of replications without missing estimates / standard errors; thetamean, average estimated value; thetamedian, median estimated value; se2mean, average estimated standard error; se2median, median estimated standard error; bias, bias in point estimate; empse, empirical standard error; mse, mean squared error; relprec, percentage gain in precision relative to the reference method; modelse, model-based standard error; relerror, relative percentage error in standard error; cover, coverage of nominal \((1 - \alpha)\)% CI; bccover, bias corrected coverage of nominal \((1 - \alpha)\)% CI; power, power of \(\alpha\)% level test.

par

Estimand to plot. Defaults to NULL, in which case the par variable from multisimsum will be used for faceting.

by

Faceting factors passed to ggplot2::facet_wrap(). Defaults to NULL, i.e. no faceting.

target

Target value for the summary statistic of interest. If NULL (the default), the target value is inferred (except for sstat = nsim).

level

Specifies the confidence level for confidence intervals based on Monte Carlo standard errors, produced by default if the simsum or summary.simsum object passed to forest estimated Monte Carlo standard errors (e.g. with mcse = TRUE).

gpars

Graphical parameters. Must be a named list, with possible parameters:

  • target.shape, shape of the horizontal line at target value;

  • target.colour, colour of the horizontal line at target value;

  • width, the width of the end of each confidence interval. It is possible to redefine all the graphical parameters of a subset only; if not specified, sensible default values will be utilised.

...

Ignored.

Value

A ggplot2::ggplot() object that can be combined with additional geom_*, scale_*, theme_*, etc.

Details

Coverage, bias corrected coverage, and power will be based on the \(\alpha\) defined in the call to simsum.

Examples

Run this code
# NOT RUN {
library(rsimsum)
library(ggplot2)
data("frailty", package = "rsimsum")
ms <- multisimsum(data = frailty, par = "par", true = c(trt = -0.50,
   fv = 0.75), estvarname = "b", se = "se", methodvar = "model",
   by = "fv_dist")
forest(ms, sstat = "bias", par = "trt", by = "fv_dist")
# }

Run the code above in your browser using DataLab