Description Usage Arguments Value Details Methods Author(s) References See Also Examples
Aggregate simulation results, i.e, split the data into subsets if applicable and compute summary statistics.
1 2 
x 
the simulation results to be aggregated, i.e., an object of class

select 
an integer, character or logical vector specifying the columns
to be aggregated. It must specify a subset of the 
FUN 
a function to compute the summary statistics (defaults to

... 
additional arguments to be passed down to methods. 
A data frame containing the summary statistics for the different subsets of the simulation results.
The summary statistics of the simulation results are computed using the
aggregate
method for the data frame in slot
values
.
signature(x = "SimResults")
aggregate simulation results.
Andreas Alfons
Alfons, A., Templ, M. and Filzmoser, P. (2010) An ObjectOriented Framework for Statistical Simulation: The R Package simFrame. Journal of Statistical Software, 37(3), 1–36. URL http://www.jstatsoft.org/v37/i03/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51  #### designbased simulation
data("eusilcP") # load data
## control objects for sampling and contamination
sc < SampleControl(size = 100, k = 50, seed = 12345)
cc < ContControl(target = "eqIncome", epsilon = 0.02,
fun = function(x) x * 10, type = "CAR")
## function for simulation runs
sim < function(x) {
c(mean = mean(x$eqIncome), trimmed = mean(x$eqIncome, 0.05))
}
## run simulation
results < runSimulation(eusilcP, sc, contControl = cc,
fun = sim, seed = 12345)
## aggregate
aggregate(results) # means of results
aggregate(results, FUN = sd) # standard deviations of results
#### modelbased simulation
## function for generating data
rgnorm < function(n, means) {
group < sample(1:2, n, replace=TRUE)
data.frame(group=group, value=rnorm(n) + means[group])
}
## control objects for data generation and contamination
means < c(0, 0.25)
dc < DataControl(size = 100, fun = rgnorm,
dots = list(means = means))
cc < ContControl(target = "value", epsilon = 0.02,
dots = list(mean = 10), type = "CCAR")
## function for simulation runs
sim < function(x) {
c(mean = mean(x$value),
trimmed = mean(x$value, trim = 0.05),
median = median(x$value))
}
## run simulation
results < runSimulation(dc, nrep = 50, contControl = cc,
design = "group", fun = sim, seed = 12345)
## aggregate
aggregate(results) # means of results
aggregate(results, FUN = sd) # standard deviations of results

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.