draw(simFrame)
draw()所属R语言包:simFrame
Draw a sample
抽取样本
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generic function for drawing a sample.
通用函数抽取一个样本。
用法----------Usage----------
draw(x, setup, ...)
## S4 method for signature 'data.frame,SampleSetup'
draw(x, setup, i = 1)
## S4 method for signature 'data.frame,VirtualSampleControl'
draw(x, setup)
参数----------Arguments----------
参数:x
the data to sample from.
的数据采样。
参数:setup
an object of class "SampleSetup" containing previously set up samples, a control object inheriting from the virtual class "VirtualSampleControl" or a character string specifying such a control class (the default being "SampleControl").
类的一个对象"SampleSetup"包含以前成立的样品,控制对象从虚拟类继承"VirtualSampleControl"或一个字符串指定这样的控制类(默认是"SampleControl")。
参数:i
an integer specifying which one of the previously set up samples should be drawn.
一个整数,指定哪一个以前成立的样品应当制定。
参数:...
if setup is a character string or missing, the slots of the control object may be supplied as additional arguments. See "SampleControl" for details on the slots.
如果setup是一个字符串或丢失,控制对象的插槽,可以提供额外的参数。见"SampleControl"的插槽。
值----------Value----------
A data.frame containing the sampled observations. In addition, the column ".weight", which consists of the sample weights, is added to the data.frame.
Adata.frame包含采样的意见。此外,列".weight",它包括的样本权重,添加到data.frame。
方法----------Methods----------
x = "data.frame", setup = "character" draw a sample using a control class specified by the character string setup. The slots of
x = "data.frame", setup = "character"绘制指定的字符串setup控制类的一个示例使用。的插槽
x = "data.frame", setup = "missing" draw a sample using a control object of class "SampleControl". Its slots may be supplied
x = "data.frame", setup = "missing"抽取样本使用的控制对象类"SampleControl"。它的时隙可以提供
x = "data.frame", setup = "SampleSetup" draw a previously set
x = "data.frame", setup = "SampleSetup"先前设置的绘制
x = "data.frame", setup = "VirtualSampleControl" draw a sample using a control object inheriting from the virtual class
x = "data.frame", setup = "VirtualSampleControl"画一个示例使用一个控制对象从虚拟类继承
(作者)----------Author(s)----------
Andreas Alfons
参考文献----------References----------
Statistical Simulation: The R Package <code>simFrame</code>. Journal of Statistical Software, 37(3), 1–36. URL http://www.jstatsoft.org/v37/i03/.
参见----------See Also----------
setup, "SampleSetup", "SampleControl", "TwoStageControl", "VirtualSampleControl"
setup,"SampleSetup","SampleControl","TwoStageControl","VirtualSampleControl"
实例----------Examples----------
## load data[#加载数据]
data(eusilcP)
## simple random sampling[#简单随机抽样]
draw(eusilcP[, c("id", "eqIncome")], size = 20)
## group sampling[#整群抽样]
draw(eusilcP[, c("hid", "id", "eqIncome")],
grouping = "hid", size = 10)
## stratified simple random sampling[#分层简单随机抽样]
draw(eusilcP[, c("id", "region", "eqIncome")],
design = "region", size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
## stratified group sampling[#分层整群抽样]
draw(eusilcP[, c("hid", "id", "region", "eqIncome")],
design = "region", grouping = "hid",
size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|