simsum computes performance measures for simulation studies in which each simulated data set yields point estimates by one or more analysis methods. Bias, empirical standard error and precision relative to a reference method can be computed for each method. If, in addition, model-based standard errors are available then simsum can compute the average model-based standard error, the relative error in the model-based standard error, the coverage of nominal confidence intervals, the coverage under the assumption that there is no bias (bias-eliminated coverage), and the power to reject a null hypothesis. Monte Carlo errors are available for all estimated quantities.

simsum(data, estvarname, true, se, methodvar = NULL, ref = NULL,
  by = NULL, ci.limits = NULL, dropbig = FALSE, x = FALSE,
  control = list())

Arguments

data

A data.frame in which variable names are interpreted. It has to be in tidy format, e.g. each variable forms a column and each observation forms a row.

estvarname

The name of the variable containing the point estimates.

true

The true value of the parameter. This is used in calculations of bias and coverage.

se

The name of the variable containing the standard errors of the point estimates.

methodvar

The name of the variable containing the methods to compare. For instance, methods could be the models compared within a simulation study. Can be NULL.

ref

Specifies the reference method against which relative precision will be calculated. Only useful if methodvar is specified.

by

A vector of variable names to compute performance measures by a list of factors. Factors listed here are the (potentially several) data-generating mechanisms used to simulate data under different scenarios (e.g. sample size, true distribution of a variable, etc.). Can be NULL.

ci.limits

A numeric vector of length 2 specifying the limits (lower and upper) of confidence intervals used to calculate coverage. Useful for non-Wald type estimators (e.g. bootstrap). Defaults to NULL, where Wald-type confidence intervals based on the provided SEs are calculated for coverage. This feature is experimental, use with caution.

dropbig

Specifies that point estimates or standard errors beyond the maximum acceptable values should be dropped. Defaults to FALSE.

x

Set to TRUE to include the data argument used to calculate summary statistics (i.e. after pre-processing the input dataset e.g. removing values deemed too large via the dropbig argument) as a slot. Calling simsum with x = TRUE is required to produce zipper plots. The downside is that the size of the returned object increases considerably, therefore it is set to FALSE by default.

control

A list of parameters that control the behaviour of simsum. Possible values are:

  • mcse, whether to calculate Monte Carlo standard errors. Defaults to TRUE;

  • level, the significance level used for coverage, bias-eliminated coverage, and power. Defaults to 0.95;

  • df, whether to use robust critical values from a t distribution with df degrees of freedom when calculating coverage, bias-eliminated coverage, and power. Defaults to NULL, in which case a Gaussian distribution is used;

  • na.rm, whether to remove point estimates or standard errors where either (or both) is missing. Defaults to TRUE;

  • char.sep, a character utilised when splitting the input dataset data. Generally, this should not be changed;

  • dropbig.max, specifies the maximum acceptable absolute value of the point estimates, after standardisation. Defaults to 10;

  • dropbig.semax, specifies the maximum acceptable absolute value of the standard error, after standardisation. Defaults to 100

  • dropbig.robust, specifies whether to use robust standardisation (using median and inter-quartile range) rather than normal standardisation (using mean and standard deviation). Defaults to TRUE, in which case robust standardisation will be used for dropbig.

Value

An object of class simsum.

Details

The following names are not allowed for estvarname, se, methodvar, by: stat, est, mcse, lower, upper.

References

White, I.R. 2010. simsum: Analyses of simulation studies including Monte Carlo error. The Stata Journal 10(3): 369-385. http://www.stata-journal.com/article.html?article=st0200

Morris, T.P., White, I.R. and Crowther, M.J. 2019. Using simulation studies to evaluate statistical methods. Statistics in Medicine, doi: 10.1002/sim.8086

Gasparini, A. 2018. rsimsum: Summarise results from Monte Carlo simulation studies. Journal of Open Source Software 3(26):739, doi: 10.21105/joss.00739

Examples

data("MIsim", package = "rsimsum") s <- simsum(data = MIsim, estvarname = "b", true = 0.5, se = "se", methodvar = "method", ref = "CC") # If 'ref' is not specified, the reference method is inferred s <- simsum(data = MIsim, estvarname = "b", true = 0.5, se = "se", methodvar = "method")
#> 'ref' method was not specified, CC set as the reference