tidy: Turn an object into a tidy dataset

Description Usage Arguments Value Examples

Description

Extract a tidy dataset with results from an object of class simsum, summary.simsum, multisimsum, or summary.multisimsum.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'simsum'
tidy(x, stats = NULL, ...)

## S3 method for class 'summary.simsum'
tidy(x, stats = NULL, ...)

## S3 method for class 'multisimsum'
tidy(x, stats = NULL, ...)

## S3 method for class 'summary.multisimsum'
tidy(x, stats = NULL, ...)

Arguments

x

An object of class simsum.

stats

Summary statistics to include; can be a scalar value or a vector. Possible choices are:

  • nsim, the number of replications with non-missing point estimates and standard error.

  • thetamean, average point estimate.

  • thetamedian, median point estimate.

  • se2mean, average standard error.

  • se2median, median 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 a nominal level\

  • becover, bias-eliminated coverage of a nominal level\

  • power, power of a (1 - level)\ Defaults to NULL, in which case all summary statistics are returned.

...

Ignored.

Value

A data.frame containing summary statistics from a simulation study.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(MIsim)
x <- simsum(
  data = MIsim, estvarname = "b", true = 0.5, se = "se",
  methodvar = "method"
)
tidy(x)

# Extracting only bias and coverage:
tidy(x, stats = c("bias", "cover"))

xs <- summary(x)
tidy(xs)

rsimsum documentation built on July 5, 2021, 5:07 p.m.