rhg(sampling)
rhg()所属R语言包:sampling
Response homogeneity groups
响应同质组
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the response homogeneity groups and the response probability for each unit in these groups.
计算的反应的同质性基团和这些基团中的每个单元的响应概率。
用法----------Usage----------
rhg(X,selection)
参数----------Arguments----------
参数:X
sample data frame; it should contain the columns 'ID_unit' and 'status'; 'ID_unit' denotes the unit identifier (a number); 'status' is a 1/0 variable denoting the response/non-response of a unit.
样本数据框,它应该包含列的ID_unit的“和”状态“;的”ID_unit“表示单位识别码(数字)的”状态“1/0变量表示响应/无响应的一个单位。
参数:selection
vector of variable names in X used to construct the groups.
X中的变量名的矢量用于构造的基团。
Details
详细信息----------Details----------
Into a response homogeneity group, the reponse probability is the same for all units. Data are missing at random within groups, conditionally on the selected sample.
到响应均匀性的基团,该响应的概率是相同的所有单元。数据组内随机缺失,有条件所选样本。
值----------Value----------
The initial sample data frame and also the following components:
最初的样本数据框和以下组件:
参数:rhgroup
the response homogeneity group for each unit.
每个单元的响应均匀性组。
参数:prob_response
the response probability for each unit; for the units with status=0, this probability is 0.
每个单元;状态= 0的单位的响应概率,该概率是0。
参考文献----------References----------
参见----------See Also----------
rhg_strata, calib
rhg_strata,calib
实例----------Examples----------
# defines the inclusion probabilities for the population[定义包含概率的人口]
pik=c(0.2,0.7,0.8,0.5,0.4,0.4)
# X is the population data frame[X是人口数据框]
X=cbind.data.frame(pik,c("A","B","A","A","C","B"))
names(X)=c("Prob","town")
# selects a sample using systematic sampling[选择一个样本,采用系统抽样]
s=UPsystematic(pik)
# Xs is the sample data frame[XS是样本数据框]
Xs=getdata(X,s)
# adds the status column to Xs (1 - sample respondent, 0 otherwise)[增加了状态栏XS(1 - 样品答辩,否则为0)]
Xs=cbind.data.frame(Xs,status=c(1,0,1))
# creates the response homogeneity groups using the 'town' variable[创建响应均匀性,使用镇变量]
rhg(Xs,selection="town")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|