S.STPPS(TeachingSampling)
S.STPPS()所属R语言包:TeachingSampling
Stratified Sampling Appliying PPS Design in all Strata
在所有Strata设计的分层抽样Appliying的PPS
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Draws a probability proportional to size simple random sample with
绘制的概率规模成比例的简单随机抽样
用法----------Usage----------
S.STPPS(S,x,mh)
参数----------Arguments----------
参数:S
Vector identifying the membership to the strata of each unit in the population
矢量确定会员资格的阶层,各单位在人口
参数:x
Vector of auxiliary information for each unit in the population
人口的辅助信息中的每个单元的向量
参数:mh
Vector of sample size in each stratum
在各阶层向量的样本量
Details
详细信息----------Details----------
The selected sample is drawn acording to the cumulative total method (sequential-list procedure) in each stratum
所选取的样本绘制该院在各阶层的累积总数方法(顺序列表程序)
值----------Value----------
The function returns a matrix of m=m_1+\cdots+m_h rows and two columns. Each element of the first column indicates the unit that
该函数返回一个m=m_1+\cdots+m_h行两列的矩阵。的第一列的每一个元素表示的单元,其
(作者)----------Author(s)----------
Hugo Andr茅s Guti茅rrez Rojas <a href="mailto:hugogutierrez@usantotomas.edu.co">hugogutierrez@usantotomas.edu.co</a>
参考文献----------References----------
S盲rndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer. <br> Guti茅rrez, H. A. (2009), Estrategias de muestreo: Dise帽o de encuestas y estimaci贸n de par谩metros. Editorial Universidad Santo Tom谩s.
参见----------See Also----------
E.STPPS
E.STPPS
实例----------Examples----------
############[###########]
## Example 1[#示例1]
############[###########]
# Vector U contains the label of a population of size N=5[向量u包含标签的大小为N = 5的人口]
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
# The auxiliary information[的辅助信息]
x <- c(52, 60, 75, 100, 50)
# Vector Strata contains an indicator variable of stratum membership [矢量地层包含的指标阶层的成员变量]
Strata <- c("A", "A", "A", "B", "B")
# Then sample size in each stratum[在各阶层的样本量]
mh <- c(2,2)
# Draws a stratified PPS sample with replacement of size n=4[绘制分层PPS样本大小为n = 4的更换]
res <- S.STPPS(Strata, x, mh)
# The selected sample[所选样本]
sam <- res[,1]
U[sam]
# The selection probability of each unit selected to be in the sample[每个单元的选择概率选择样品中]
pk <- res[,2]
pk
############[###########]
## Example 2[#示例2]
############[###########]
# Uses the Marco and Lucy data to draw a stratified random sample [Marco和露西的数据来得出一个分层随机抽样]
# according to a PPS design in each stratum[根据各阶层的PPS设计]
data(Marco)
data(Lucy)
attach(Lucy)
# Level is the stratifying variable[级别是分层的变量]
summary(Level)
# Defines the sample size at each stratum[在每一层定义的样本大小]
m1<-14
m2<-123
m3<-263
mh<-c(m1,m2,m3)
# Draws a stratified sample[绘制分层抽样]
res<-S.STPPS(Level, Income, mh)
# The selected sample[所选样本]
sam<-res[,1]
# The information about the units in the sample is stored in an object called data[有关样品中的单位的信息被存储在一个对象被称为数据]
data <- Lucy[sam,]
data
dim(data)
# The selection probability of each unit selected in the sample[样品中选定的每个单元的选择概率]
pk <- res[,2]
pk
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|