Learn R Programming

rsimsum (version 0.3.1)

heat.simsum: heat method for simsum objects

Description

heat() method for objects of class simsum.

Usage

# S3 method for simsum
heat(obj, sstat, y, target = NULL, text = FALSE,
  gpars = list(), ...)

Arguments

obj

An object of class simsum.

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.

y

Factor on the y-axis of the plot.

target

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

text

Including estimates and Monte Carlo standard errors in the plot? Defaults to FALSE.

gpars

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

  • target.colour, colour representing the target value;

  • low.colour, colour representing the lowest value;

  • high.colour, colour representing the highest value;

  • fmt, format string passed to base::sprintf() to format values and Monte Carlo standard errors.

It is possible to redefine all the graphical parameters of a subset only; if not specified, sensible default values will be utilised. The default colours are colorblind-friendly.

...

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("relhaz", package = "rsimsum")
s <- simsum(
  data = relhaz, estvarname = "theta", true = -0.5, se = "se",
  methodvar = "model", by = c("n", "baseline")
)
heat(s, sstat = "bias", y = "baseline")
heat(s, sstat = "bias", y = "n", text = TRUE)
# }

Run the code above in your browser using DataLab