Learn R Programming

simFrame (version 0.5.0)

TwoStageControl-class: Class "TwoStageControl"

Description

Class for controlling the setup of samples using a two-stage procedure.

Usage

TwoStageControl(..., fun1 = srs, fun2 = srs, size1 = NULL, 
                size2 = NULL, prob1 = NULL, prob2 = NULL, 
                dots1 = list(), dots2 = list())

Arguments

...
the slots for the new object (see below).
fun1
the function to be used for sampling in the first stage (the first list component of slot fun).
fun2
the function to be used for sampling in the second stage (the second list component of slot fun).
size1
the number of PSUs to sample in the first stage (the first list component of slot size).
size2
the number of items to sample in the second stage (the second list component of slot size).
prob1
the probability weights for the first stage (the first list component of slot prob).
prob2
the probability weights for the second stage (the second list component of slot prob).
dots1
additional arguments to be passed to the function for sampling in the first stage (the first list component of slot dots).
dots2
additional arguments to be passed to the function for sampling in the second stage (the second list component of slot dots).

Objects from the Class

Objects can be created by calls of the form new("TwoStageControl", ...) or via the constructor TwoStageControl.

Details

There are some restrictions on the argument names of the functions for sampling in fun. If the sampling method needs population data as input, the corresponding argument should be called x and should expect a data.frame. If it only needs the population size as input, the argument should be called N. Note that the function is not expected to have both x and N as arguments, and that the latter is typically much faster. Furthermore, if the function has arguments for sample size and probability weights, they should be called size and prob, respectively. Note that a function with prob as its only argument is perfectly valid (for probability proportional to size sampling). Further arguments may be supplied as a list via the slot dots.

Extends

Class "VirtualSampleControl", directly. Class "OptSampleControl", by class "VirtualSampleControl", distance 2.

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 RPackage simFrame. Use vignette("simFrame-intro") to view this vignette.

See Also

"VirtualSampleControl", "SampleControl", "SampleSetup", setup, draw

Examples

Run this code
showClass("TwoStageControl")

Run the code above in your browser using DataLab