Learn R Programming

simFrame (version 0.5.4)

SampleSetup-class: Class "SampleSetup"

Description

Class for set up samples.

Arguments

Objects from the Class

Objects can be created by calls of the form new("SampleSetup", …) or SampleSetup(…).

However, objects are expected to be created by the function setup or clusterSetup, these constructor functions are not supposed to be called by the user.

Slots

indices:

Object of class "list"; each list element contains the indices of the sampled observations.

prob:

Object of class "numeric" giving the inclusion probabilities.

% \item{\code{design}:}{Object of class \code{"character"} giving the % variables (columns) defining the strata of the sample design.} % \item{\code{grouping}:}{Object of class \code{"character"} giving the % variable (column) used for sampling whole groups rather than % individual observations.} % \item{\code{collect}:}{Object of class \code{"logical"} indicating whether % groups were collected after sampling individuals or sampled directly.} % \item{\code{fun}:}{Object of class \code{"function"} used for sampling.}
control:

Object of class "VirtualSampleControl"; the control object used to set up the samples.

seed:

Object of class "list" containing the seeds of the random number generator before and after setting up the samples, respectively (for replication purposes).

call:

Object of class "SimCall"; the function call used to set up the samples, or NULL.

Accessor methods

getIndices

signature(x = "SampleSetup"): get slot indices.

getProb

signature(x = "SampleSetup"): get slot prob.

% \item{\code{getDesign}}{\code{signature(x = "SampleSetup")}: get slot % \code{design}.} % \item{\code{getGrouping}}{\code{signature(x = "SampleSetup")}: get slot % \code{grouping}.} % \item{\code{getCollect}}{\code{signature(x = "SampleSetup")}: get slot % \code{collect}.} % \item{\code{getFun}}{\code{signature(x = "SampleSetup")}: get slot % \code{fun}.}
getControl

signature(x = "SampleSetup"): get slot control.

getSeed

signature(x = "SampleSetup"): get slot seed.

getCall

signature(x = "SampleSetup"): get slot call.

Methods

clusterRunSimulation

signature(cl = "ANY", x = "data.frame", setup = "SampleSetup", nrep = "missing", control = "SimControl"): run a simulation experiment on a cluster.

draw

signature(x = "data.frame", setup = "SampleSetup"): draw a sample.

head

signature(x = "SampleSetup"): returns the first parts of set up samples.

length

signature(x = "SampleSetup"): get the number of set up samples.

runSimulation

signature(x = "data.frame", setup = "SampleSetup", nrep = "missing", control = "SimControl"): run a simulation experiment.

show

signature(object = "SampleSetup"): print set up samples on the R console.

summary

signature(object = "SampleSetup"): produce a summary of set up samples.

tail

signature(x = "SampleSetup"): returns the last parts of set up samples.

UML class diagram

A slightly simplified UML class diagram of the framework can be found in Figure 1 of the package vignette An Object-Oriented Framework for Statistical Simulation: The R Package simFrame. Use vignette("simFrame-intro") to view this vignette.

References

Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for Statistical Simulation: The R Package simFrame. Journal of Statistical Software, 37(3), 1--36. 10.18637/jss.v037.i03.

See Also

"'>SampleControl", "'>TwoStageControl", "'>VirtualSampleControl", setup, draw

Examples

Run this code
# NOT RUN {
showClass("SampleSetup")
# }

Run the code above in your browser using DataLab