Strata-class: Class "Strata"

Description Objects from the Class Slots Accessor methods Methods UML class diagram Note Author(s) See Also Examples

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, or NULL.

Accessor methods

getValues

signature(x = "Strata"): get slot values.

getSplit

signature(x = "Strata"): get slot split.

getDesign

signature(x = "Strata"): get slot design.

getNr

signature(x = "Strata"): get slot nr.

getLegend

signature(x = "Strata"): get slot legend.

getSize

signature(x = "Strata"): get slot size.

getCall

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

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

stratify

Examples

1
showClass("Strata")

simFrame documentation built on Oct. 14, 2021, 5:24 p.m.