calibev(sampling)
calibev()所属R语言包:sampling
Calibration estimator and its variance estimation
校准估计及其方差估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the calibration estimator of the population total and its variance estimation using the residuals' method.
计算校准的人口总数估计及其方差估计的残差“的方法。
用法----------Usage----------
calibev(Ys,Xs,total,pikl,d,g,q=rep(1,length(d)),with=FALSE,EPS=1e-6)
参数----------Arguments----------
参数:Ys
vector of interest variable; its size is n, the sample size.
利益变量的向量,其大小为n,样本大小。
参数:Xs
matrix of sample calibration variables.
样品的标定变量的矩阵。
参数:total
vector of population totals for calibration.
人口总数的校准矢量。
参数:pikl
matrix of joint inclusion probabilities of the sample units.
样本单位的联合包含概率矩阵。
参数:d
vector of initial weights of the sample units.
向量的初始权重的样本单位。
参数:g
vector of g-weights; its size is n, the sample size.
G的权重向量,其大小为n,样本大小。
参数:q
vector of positive values accounting for heteroscedasticity; its size is n, the sample size.
向量的正面价值会计的异方差性,其大小为n,样本大小。
参数:with
if TRUE, the variance estimation takes into account the initial weights d; otherwise, the final weights w=g*d are taken into account; by default, its value is FALSE.
如果为TRUE,方差估计考虑到初始权值,D,否则,最终的权重W = G * d的考虑,默认情况下,它的值是FALSE。
参数:EPS
the tolerance in checking the calibration; by default, its value is 1e-6.
的公差检查校准,默认情况下,它的值是1e-6。
Details
详细信息----------Details----------
If with is TRUE, the following formula is used
如果与是TRUE,使用下面的公式
else
其他
where e_k denotes the residual of unit k.
e_k表示剩余的单元k。
值----------Value----------
The function returns two values:
该函数返回两个值:
参数:cest
the calibration estimator,
校准估计,
参数:evar
its estimated variance.
它的估计方差。
参考文献----------References----------
Deville, J.-C., S盲rndal, C.-E., and Sautory, O. (1993). Generalized raking procedure in survey sampling. Journal of the American Statistical Association, 88:1013–1020.<br>
参见----------See Also----------
calib
calib
实例----------Examples----------
############[###########]
## Example[#示例]
############[###########]
# Example of g-weights (linear, raking, truncated, logit),[示例G-重量(线性,耙,截断,罗吉特),]
# with the data of Belgian municipalities as population.[比利时直辖市人口的数据。]
# Firstly, a sample is selected by means of Poisson sampling.[首先,将样品通过泊松抽样选择。]
# Secondly, the g-weights are calculated.[其次,对于g的权重计算。]
data(belgianmunicipalities)
attach(belgianmunicipalities)
# matrix of calibration variables for the population[人口校准变量矩阵]
X=cbind(
Men03/mean(Men03),
Women03/mean(Women03),
Diffmen,
Diffwom,
TaxableIncome/mean(TaxableIncome),
Totaltaxation/mean(Totaltaxation),
averageincome/mean(averageincome),
medianincome/mean(medianincome))
# selection of a sample with expected size equal to 200[选择与预期大小等于200的试样]
# by means of Poisson sampling[通过泊松抽样]
# the inclusion probabilities are proportional to the average income [包含概率是成正比的平均收入]
pik=inclusionprobabilities(averageincome,200)
N=length(pik) # population size[人口规模]
s=UPsystematic(pik) # draws a sample s using systematic sampling [绘制一个样品使用系统抽样]
Xs=X[s==1,] # matrix of sample calibration variables[基质样品的标定变量]
piks=pik[s==1] # sample inclusion probabilities[样本包含概率]
n=length(piks) # sample size[样本量]
# vector of population totals of the calibration variables[校准变量矢量的人口总数]
total=c(t(rep(1,times=N))%*%X)
g1=calib(Xs,d=1/piks,total,method="linear") # computes the g-weights[计算的克重量]
pikl=UPsystematicpi2(pik) # computes the matrix of the joint inclusion probabilities [计算的矩阵的联合包含概率]
pikls=pikl[s==1,s==1] # the same matrix for the units in s[在s为单位的相同的矩阵]
Ys=Tot04[s==1] # the variable of interest is Tot04 (for the units in s)[感兴趣的变量是单位在s Tot04(不承担任何保证责任。)]
calibev(Ys,Xs,total,pikls,d=1/piks,g1,with=FALSE,EPS=1e-6)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|