TwoStageControl-class(simFrame)
TwoStageControl-class()所属R语言包:simFrame
Class "TwoStageControl"
类“TwoStageControl”
译者:生物统计家园网 机器人LoveR
描述----------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).
函数被用于抽样检验在第一阶段(第一列表组件的时隙fun)。
参数:fun2
the function to be used for sampling in the second stage (the second list component of slot fun).
函数要在第二阶段(用于采样的时隙的第二列表组件fun)。
参数:size1
the number of PSUs to sample in the first stage (the first list component of slot size).
在第一阶段中的PSU的数量样品(第一列表组件的时隙size)。
参数:size2
the number of items to sample in the second stage (the second list component of slot size).
项目数,以样品中的第二阶段(第二列表组件的时隙size)。
参数:prob1
the probability weights for the first stage (the first list component of slot prob).
的概率权重的第一阶段(第一列表组分的时隙prob)。
参数:prob2
the probability weights for the second stage (the second list component of slot prob).
的概率权重,在第二阶段(第二列表组分的时隙prob)。
参数:dots1
additional arguments to be passed to the function for sampling in the first stage (the first list component of slot dots).
额外的参数被传递到采样功能,在第一阶段(第一个列表组件插槽dots“)。
参数:dots2
additional arguments to be passed to the function for sampling in the second stage (the second list component of slot dots).
额外的参数被传递到采样的功能在第二阶段(第二个列表组件的插槽dots“)。
类对象----------Objects from the Class----------
Objects can be created by calls of the form new("TwoStageControl", ...) or via the constructor TwoStageControl.
可以创建对象通过调用的形式new("TwoStageControl", ...)或通过构造TwoStageControl的。
插槽----------Slots----------
design: Object of class "BasicVector" specifying variables (columns) to be used for stratified sampling in the first
design:对象的类"BasicVector"指定变量(列),以用于在第一分层抽样
grouping: Object of class "BasicVector" specifying grouping variables (columns) to be used for sampling primary sampling
“”grouping:对象类"BasicVector"指定分组变量(列)用于初级抽样取样
fun: Object of class "list"; a list of length two containing the functions to be used for sampling in the first and second stage, respectively (defaults to srs for both stages). The functions should return a vector containing the indices of the sampled
fun:类对象的"list";包含要用于抽样检验在第一和第二阶段,分别(默认为srs的两个阶段)的功能的列表的长度2。函数应该返回一个向量,包含的采样的指数,其中
size: Object of class "list"; a list of length two, where each component contains an optional non-negative integer giving the number of items to sample in the first and second stage, respectively. In case of stratified sampling in the first stage, a vector of non-negative integers, each giving the number of PSUs to sample from the corresponding stratum, may be supplied. For the second stage, a vector of non-negative integers giving the number of items to sample from each
size:对象类"list";的列表的长度为2的方法,其中每个组件包含一个可选的非负整数,分别在第一和第二阶段的样品,给予的项目数。以分层抽样的情况下,在第一阶段中,一个向量的非负整数,每个样品从对应的阶层的PSU的数量,可提供。给予的项目数的向量的非负整数,在第二阶段,从每个取样
prob: Object of class "list"; a list of length two, where each component gives optional probability weights for the first and second stage, respectively. Each component may thereby be a numerical vector, or a character string or integer vector specifying a variable
prob:类对象的"list";长度为两个,其中每个组件给出了可选的概率加权分别为第一和第二阶段中,一个列表。由此,每个组件可以是一个数值矢量,或者是一个字符串或整数矢量指定一个变量
dots: Object of class "list"; a list of length two, where each component is again a list containing additional arguments to
dots:类的对象"list";长度为二的列表,其中每个组件又是一个列表,其中包含额外的参数
k: Object of class "numeric"; a single positive
k类的对象"numeric";一个单一的正
Details
详细信息----------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.
在fun采样参数的函数名上有一些限制。如果采样方法需要人口数据作为输入,相应的参数应该被称为x和预期data.frame。如果只需要输入的人口规模,参数应该被称为N。请注意,该功能预计不会有两个x和N作为参数,而后者通常是更快的。此外,如果该函数有参数样本大小和概率权重,他们应该被称为size和prob“。需要注意的是同一个函数prob作为其唯一的参数是完全合法的概率成比例规模抽样。可以提供进一步的论据,通过槽dots为一个列表。
扩展----------Extends----------
Class "VirtualSampleControl", directly. Class "OptSampleControl", by class "VirtualSampleControl", distance 2.
类"VirtualSampleControl",直接。类"OptSampleControl"“类”VirtualSampleControl“,距离2。
访问和修改方法----------Accessor and mutator methods----------
In addition to the accessor and mutator methods for the slots inherited from "VirtualSampleControl", the following are available:
除了访问和修改方法继承自"VirtualSampleControl"的插槽,下面是可供选择:
getDesign signature(x = "TwoStageControl"): get slot
getDesignsignature(x = "TwoStageControl"):得到插槽
setDesign signature(x = "TwoStageControl"): set slot
setDesignsignature(x = "TwoStageControl"):设定插槽
getGrouping signature(x = "TwoStageControl"): get slot
getGroupingsignature(x = "TwoStageControl"):得到插槽
setGrouping signature(x = "TwoStageControl"): set slot
setGroupingsignature(x = "TwoStageControl"):设定插槽
getCollect signature(x = "TwoStageControl"): get slot
getCollectsignature(x = "TwoStageControl"):得到插槽
setCollect signature(x = "TwoStageControl"): set slot
setCollectsignature(x = "TwoStageControl"):设定插槽
getFun signature(x = "TwoStageControl"): get slot
getFunsignature(x = "TwoStageControl"):得到插槽
setFun signature(x = "TwoStageControl"): set slot
setFunsignature(x = "TwoStageControl"):设定插槽
getSize signature(x = "TwoStageControl"): get slot
getSizesignature(x = "TwoStageControl"):得到插槽
setSize signature(x = "TwoStageControl"): set slot
setSizesignature(x = "TwoStageControl"):设定插槽
getProb signature(x = "TwoStageControl"): get slot
getProbsignature(x = "TwoStageControl"):得到插槽
setProb signature(x = "TwoStageControl"): set slot
setProbsignature(x = "TwoStageControl"):设定插槽
getDots signature(x = "TwoStageControl"): get slot
getDotssignature(x = "TwoStageControl"):得到插槽
setDots signature(x = "TwoStageControl"): set slot
setDotssignature(x = "TwoStageControl"):设定插槽
方法----------Methods----------
In addition to the methods inherited from "VirtualSampleControl", the following are available:
除了从"VirtualSampleControl"继承的方法,下面的是可用的:
clusterSetup signature(cl = "ANY", x = "data.frame",
clusterSetup <CODE>签名(CL =“ANY”,X =“数据框”,
setup signature(x = "data.frame",
setup <CODE>签名(X =“数据框”
show signature(object = "TwoStageControl"): print the
showsignature(object = "TwoStageControl"):打印
UML类图----------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.
稍微简单的UML类图的框架,可以发现在图1的包小插曲统计模拟方法的一种面向对象的框架:R封装simFrame。使用vignette("simFrame-intro")查看这个小插曲。
(作者)----------Author(s)----------
Andreas Alfons
参见----------See Also----------
"VirtualSampleControl", "SampleControl", "SampleSetup", setup, draw
"VirtualSampleControl","SampleControl","SampleSetup",setup,draw
实例----------Examples----------
showClass("TwoStageControl")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|