找回密码
 注册
查看: 529|回复: 0

R语言 simFrame包 SampleControl-class()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 02:43:10 | 显示全部楼层 |阅读模式
SampleControl-class(simFrame)
SampleControl-class()所属R语言包:simFrame

                                        Class "SampleControl"
                                         类“SampleControl”

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Class for controlling the setup of samples.
一类用于控制样品的设置。


类对象----------Objects from the Class----------

Objects can be created by calls of the form new("SampleControl", ...)  or SampleControl(...).
可以创建对象通过调用的形式new("SampleControl", ...)或SampleControl(...)。


插槽----------Slots----------




design: Object of class "BasicVector" specifying
design:类的对象"BasicVector"指定




grouping: Object of class "BasicVector" specifying a  grouping variable (column) to be used for sampling whole groups rather
grouping:类的对象"BasicVector"用于采样整个群体,而指定的一组变量(列)




collect: Object of class "logical"; if  a grouping  variable is specified and this is FALSE (which is the default  value), groups are sampled directly.  If grouping variable is specified  and this is TRUE, individuals are sampled in a first step.  In a  second step, all individuals that belong to the same group as any of the  sampled individuals are collected and added to the sample.  If no
collect:类的对象"logical";如果指定了一组变量,这是FALSE(这是默认值),组直接取样。如果分组变量指定这是TRUE,在第一步骤中进行采样,个人。在第二步骤中,所有的属于相同的组中的采样的任何个人的个人,被收集并添加到样品中。如果没有




fun: Object of class "function" to be used for  sampling (defaults to srs).  It should return a vector
fun类的对象"function"用于采样(默认到srs)。它应该返回一个向量




size: Object of class "OptNumeric"; an optional  non-negative integer giving the number of items (observations or groups)  to sample.  In case of stratified sampling, a vector of non-negative  integers, each giving the number of items to sample from the
size:类的对象"OptNumeric";一个可选的非负整数的项目数(观察组)的样品。箱子分层抽样,一个向量的非负整数,每个样品从给予的项目数




prob: Object of class "OptBasicVector"; an optional  numeric vector giving the probability weights, or a character string or  logical vector specifying a variable (column) that contains the
prob:类的对象"OptBasicVector";一个可选的数字矢量给出概率的权重,或一个字符串或逻辑向量,它指定一个变量(列)包含




dots: Object of class "list" containing additional
dots:对象类"list"包含额外的




k: Object of class "numeric"; a single positive
k类的对象"numeric";一个单一的正


Details

详细信息----------Details----------

There are some restrictions on the argument names of the function  supplied to fun.  If it needs population data as input,  the corresponding argument should be called x and should expect  a data.frame.  If the sampling method only needs the population size  as input, the argument should be called N.  Note that fun is  not expected to have both x and N as arguments, and that the  latter is much faster for stratified sampling or group sampling.   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 of  fun may be supplied as a list via the slot dots.
参数名称的功能提供给fun有一些限制。如果需要人口数据作为输入,相应的参数应该被称为x和预期data.frame。如果抽样的方法只需要输入的人口规模,参数应该被称为N。请注意,fun预计不会有两个x和N作为参数,而后者是更快的分层抽样或整群抽样的。此外,如果该函数有参数样本大小和概率权重,他们应该被称为size和prob“。需要注意的是同一个函数prob作为其唯一的参数是完全合法的概率成比例规模抽样。进一步的论据fun可以提供通过槽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 = "SampleControl"): get slot
getDesignsignature(x = "SampleControl"):得到插槽




setDesign signature(x = "SampleControl"): set slot
setDesignsignature(x = "SampleControl"):设定插槽




getGrouping signature(x = "SampleControl"): get slot
getGroupingsignature(x = "SampleControl"):得到插槽




setGrouping signature(x = "SampleControl"): set slot
setGroupingsignature(x = "SampleControl"):设定插槽




getCollect signature(x = "SampleControl"): get slot
getCollectsignature(x = "SampleControl"):得到插槽




setCollect signature(x = "SampleControl"): set slot
setCollectsignature(x = "SampleControl"):设定插槽




getFun signature(x = "SampleControl"): get slot
getFunsignature(x = "SampleControl"):得到插槽




setFun signature(x = "SampleControl"): set slot
setFunsignature(x = "SampleControl"):设定插槽




getSize signature(x = "SampleControl"): get slot
getSizesignature(x = "SampleControl"):得到插槽




setSize signature(x = "SampleControl"): set slot
setSizesignature(x = "SampleControl"):设定插槽




getProb signature(x = "SampleControl"): get slot
getProbsignature(x = "SampleControl"):得到插槽




setProb signature(x = "SampleControl"): set slot
setProbsignature(x = "SampleControl"):设定插槽




getDots signature(x = "SampleControl"): get slot
getDotssignature(x = "SampleControl"):得到插槽




setDots signature(x = "SampleControl"): set slot
setDotssignature(x = "SampleControl"):设定插槽


方法----------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 = "SampleControl"): print the
showsignature(object = "SampleControl"):打印


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")查看这个小插曲。


注意----------Note----------

The slots grouping and fun were named group and  method, respectively, prior to version 0.2.  Renaming the slots was  necessary since accessor and mutator functions were introduced in this  version and functions named getGroup, getMethod and  setMethod already exist.
插槽grouping和fun被命名为group和method,之前的0.2版本。重命名的插槽是必要的,因为访问和修改功能引入这个版本和功能名为getGroup,getMethod和setMethod已经存在。


(作者)----------Author(s)----------


Andreas Alfons



参考文献----------References----------

Statistical Simulation: The R Package <code>simFrame</code>. Journal of  Statistical Software, 37(3), 1&ndash;36. URL  http://www.jstatsoft.org/v37/i03/.

参见----------See Also----------

"VirtualSampleControl",  "TwoStageControl", "SampleSetup",  setup, draw
"VirtualSampleControl","TwoStageControl","SampleSetup",setup,draw


实例----------Examples----------


data(eusilcP)

## simple random sampling[#简单随机抽样]
srsc <- SampleControl(size = 20)
draw(eusilcP[, c("id", "eqIncome")], srsc)

## group sampling[#整群抽样]
gsc <- SampleControl(grouping = "hid", size = 10)
draw(eusilcP[, c("hid", "hid", "eqIncome")], gsc)

## stratified simple random sampling[#分层简单随机抽样]
ssrsc <- SampleControl(design = "region",
    size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
draw(eusilcP[, c("id", "region", "eqIncome")], ssrsc)

## stratified group sampling[#分层整群抽样]
sgsc <- SampleControl(design = "region", grouping = "hid",
    size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
draw(eusilcP[, c("hid", "id", "region", "eqIncome")], sgsc)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-24 06:50 , Processed in 0.023825 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表