Strata-class {simFrame} | R Documentation |
Class "Strata"
Description
Class containing strata information for a data set.
Objects from the Class
Objects can be created by calls of the form new("Strata", ...)
or
Strata(...)
.
However, objects are expected to be created by the function
stratify
, these constructor functions are not supposed to be
called by the user.
Slots
values
:Object of class
"integer"
giving the stratum number for each observation.split
:Object of class
"list"
; each list element contains the indices of the observations belonging to the corresponding stratum.design
:Object of class
"character"
giving the variables (columns) defining the strata.nr
:Object of class
"integer"
giving the stratum numbers.legend
:Object of class
"data.frame"
describing the strata.size
:Object of class
"numeric"
giving the stratum sizes.call
:Object of class
"OptCall"
; the function call used to stratify the data, orNULL
.
Accessor methods
getValues
signature(x = "Strata")
: get slotvalues
.getSplit
signature(x = "Strata")
: get slotsplit
.getDesign
signature(x = "Strata")
: get slotdesign
.getNr
signature(x = "Strata")
: get slotnr
.getLegend
signature(x = "Strata")
: get slotlegend
.getSize
signature(x = "Strata")
: get slotsize
.getCall
signature(x = "Strata")
: get slotcall
.
Methods
head
signature(x = "Strata")
: returns the first parts of strata information.show
signature(object = "Strata")
: print strata information on the R console.simApply
signature(x = "data.frame", design = "Strata", fun = "function")
: apply a function to subsets.simSapply
signature(x = "data.frame", design = "Strata", fun = "function")
: apply a function to subsets.summary
signature(object = "Strata")
: produce a summary of strata information.tail
signature(x = "Strata")
: returns the last parts of strata information.
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.
Note
There are no mutator methods available since the slots are not supposed to be changed by the user.
Author(s)
Andreas Alfons
See Also
Examples
showClass("Strata")