samprop(sampfling)
samprop()所属R语言包:sampfling
Random Sampling: the Sampford Algorithm
随机抽样:Sampford算法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
samprop implements a modified version of the Sampford algorithm to obtain a sample without replacement and with unequal probabilities. The probability of the sample is proportional to the product of the
samprop实现了改进的版本的Sampford算法获得的样本,无需更换和不等概率。样品的概率是正比于产品的
用法----------Usage----------
samprop(x, size, prob = NULL)
参数----------Arguments----------
参数:x
Either a (numeric, complex, character or logical) vector of more than one element from which to choose, or a positive integer.
无论是(数字的,复杂的,字符或逻辑)的矢量中的一个以上的元素,可以从中选择,或一个正整数。
参数:size
A positive integer giving the number of items to choose.
一个正整数,给出的数字中选择的项目。
参数:prob
A vector of weights for obtaining the elements of the vector being sampled.
一种向量,用于获得被采样的矢量的元素的权重。
Details
详细信息----------Details----------
If x has length 1, sampling takes place from 1:x.
如果x的长度为1,采样发生1:x。
The prob argument gives a vector of weights for obtaining the elements of the vector being sampled. They need not sum to one, but they should be nonnegative. The number of nonzero weights must be at least size. Each weight cannot exceed a certain quantity, in order to satisfy Sampford algorithm requirements (see sampfle).
prob参数给出了一个用于获得被采样的矢量的元素的权重向量。他们需要总结的一个,但他们应该是非负的。非零的权重的数目必须至少size。每件重量不能超过一定的数量,以满足Sampford算法要求(见sampfle)。
This procedure draws a sample without replacement, which probability is proportional to the product of weights of units contained in the sample.
此过程绘制一个无需更换样品,该概率是成比例的试样中所含的单元的产品的重量。
值----------Value----------
A vector of size size, which contains the sampled units from x, or indices if x is an integer.
一个向量的大小size,其中包含x,或指数的采样单位如果x是一个整数。
(作者)----------Author(s)----------
Carlos Enrique Carleos Artime <a href="mailto:carleos@vodafone.es.">carleos@vodafone.es.</a>
参考文献----------References----------
Cochran, W.G. (1977) Sampling techniques, John Wiley and Sons.
Sampford, M.R. (1967) On sampling without replacement with unequal probabilities of selection, Biometrika 54:499-513.
参见----------See Also----------
sampfle
sampfle
实例----------Examples----------
library(sampfling)
samprop(10, 3, 1:10)
samprop(c("a","b","c"), 2, c(0.3,0.3,0.4))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|