Hajekstrata(sampling)
Hajekstrata()所属R语言包:sampling
The Hajek estimator for a stratified design
哈耶克估计的分层设计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the H谩jek estimator of the population total or population mean for a stratified design.
哈耶克估计的总人口或人口平均计算的分层设计。
用法----------Usage----------
Hajekstrata(y,pik,strata,N=NULL,type=c("total","mean"),description=FALSE)
参数----------Arguments----------
参数:y
vector of the variable of interest; its length is equal to n, the sample size.
感兴趣的变量的矢量,其长度为n,样本大小是相等的。
参数:pik
vector of the first-order inclusion probabilities for the sampled units; its length is equal to n, the sample size.
矢量的一阶夹杂物采样单元的概率,其长度是等于到n,样本大小。
参数:strata
vector of size n, with elements indicating the unit stratum.
矢量的大小为n,表示单位阶层的元素。
参数:N
vector of population sizes of strata; N is only used for the total estimator; for the mean estimator its value is NULL.
向量的人口规模的地层,N仅用于总估计,其平均估计值是NULL。
参数:type
the estimator type: total or mean.
估计类型:总或平均。
参数:description
if TRUE, the estimator is printed for each stratum; by default, FALSE.
如果为true,估计是印刷各阶层,默认情况下,FALSE。
参见----------See Also----------
HTstrata
HTstrata
实例----------Examples----------
# Swiss municipalities data base[瑞士直辖市数据库]
data(swissmunicipalities)
# the variable 'REG' has 7 categories in the population [变量的REG“在人群中,有7个类别,]
# it is used as stratification variable[它是用来作为分层变量]
# computes the population stratum sizes[计算人口阶层大小]
table(swissmunicipalities$REG)
# do not run[不运行]
# 1 2 3 4 5 6 7[1 2 3 4 5 6 7]
# 589 913 321 171 471 186 245[589 913 321 171 471 186 245]
# the sample stratum sizes are given by size=c(30,20,45,15,20,11,44)[样品层尺寸大小= C(30,20,45,15,20,11,44)]
# the method is simple random sampling without replacement [方法很简单随机抽样,无需更换]
# (equal probability, without replacement)[(概率相等,无需更换)]
st=strata(swissmunicipalities,stratanames=c("REG"),size=c(30,20,45,15,20,11,44),
method="srswor")
# extracts the observed data[提取所观察到的数据]
# the order of the columns is different from the order in the swsissmunicipalities database[列的顺序是不同的顺序在swsissmunicipalities数据库]
x=getdata(swissmunicipalities, st)
# computes the population sizes of strata[计算人口规模的地层]
N=table(swissmunicipalities$REG)
N=N[unique(x$REG)]
# computes the Hajek estimator of the variable Pop020 [计算哈耶克估计的变量Pop020]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|