summary.simulation: Print summary of simulations.

Description Usage Arguments Value See Also Examples

View source: R/summary.R

Description

summary.simulation calculates a summary of a given variable across all, or a portion of, the simulations.

Usage

1
2
## S3 method for class 'simulation'
summary(sim, outcome, params = NULL, func = mean, ...)

Arguments

sim

A list of class 'simulation' generated by the function simulate.

outcome

A string with the variable name across which to generate the summaries.

params

If NULL, the function will return a summary across all generated simulation parameters. A character vector can also be included here, in which case the function will return summaries for only the selected parameter names. Finally, users can input a list, with the names of the elements corresponding to parameter names, and the values of each element providing a vector with the parameter values to be included in the summary. In all cases, the summary will collapse across all parameters or parameter values that are excluded from params.

func

The function to be used to generate the summary (e.g., mean, sum).

...

Any other arguments to be passed to func.

Value

Returns a data frame with one row per set of unique simulation tests.

See Also

simulate

Examples

1
2
3
# will calculate the mean for all 'sig' values in all simulations where N=200,
# and all simulations where N=300
summary(power_sim, 'sig', params=list(N=c(200, 300)))

jeff-hughes/simulateR documentation built on May 19, 2019, 1:45 a.m.