找回密码
 注册
查看: 290|回复: 0

R语言 sampling包 gencalib()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 21:47:57 | 显示全部楼层 |阅读模式
gencalib(sampling)
gencalib()所属R语言包:sampling

                                        g-weights of the generalized calibration estimator
                                         克重量的广义校正估计

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Computes the g-weights of the generalized calibration estimator. The g-weights should lie in the specified bounds for the  truncated and logit methods.
计算克重量的广义校正估计。 G-权重应该在于截断和logit方法在指定的范围内。


用法----------Usage----------





参数----------Arguments----------

参数:Xs
matrix of calibration variables.
矩阵的标定变量。


参数:Zs
matrix of instrumental variables with same dimension as Xs.
矩阵的工具变量X的尺寸相同。


参数:d
vector of initial weights.
的初始权重向量。


参数:total
vector of population totals.
向量的人口总数。


参数:q
vector of positive values accounting for heteroscedasticity; the variation of the g-weights is reduced for small values of q.
小Q值降低的正面价值会计的异方差性,变异的g权重向量。


参数:method
calibration method (linear, raking, logit, truncated).
校准方法(线性,耙,对数,截断)。


参数:bounds
vector of bounds for the g-weights used in the truncated and logit methods;  'low' is the smallest value and 'upp' is the largest value.
矢量界为G用权重的截断和logit的方法;“低”是最小值,UPP的是世界上最大的价值。


参数:description
if description=TRUE, summary of initial and final weights are printed,  and their boxplots and histograms are drawn; by default, its value is FALSE.
如果描述= TRUE,总结的最初和最终的权重的印刷,箱线图和柱状图绘制,默认情况下,它的值是FALSE。


参数:max_iter
maximum number of iterations in the Newton's method.  
牛顿法的迭代的最大数量。


参数:C
value of the centering constant, by default equals 1.
的中心不变,默认情况下的值等于1。


Details

详细信息----------Details----------

The generalized calibration or the instrument vector method computes the g-weights  g_k=F(&lambda;'z_k), where z_k is a vector with values defined for k\in s (or k\in r where r is the set of respondents) and sharing the dimension of the specified auxiliary vector  x_k. The vectors z_k and x_k have to be stronlgy correlated. The vector &lambda; is determined from the calibration equation &sum;_{k\in s} d_kg_k x_k=&sum;_{k\in U} x_k or &sum;_{k\in r} d_kg_k x_k=&sum;_{k\in U} x_k.  The function F plays the same role as in the calibration method (see calib). If Xs=Zs the calibration method is obtain. If the method is "logit" the g-weights will be centered around the constant C, with low<C<upp. In the calibration method C=1 (see calib).
广义校准或仪器向量的方法计算权重的G g_k=F(&lambda;'z_k),z_k是k\in s(k\in rr是一个向量,其定义的值组的受访者)和指定的辅助矢量x_k分享维度。的矢量z_k和x_k有,到被stronlgy相关。向量&lambda;确定自校准方程&sum;_{k\in s} d_kg_k x_k=&sum;_{k\in U} x_k或&sum;_{k\in r} d_kg_k x_k=&sum;_{k\in U} x_k。 F的功能的校准方法(见calib)起着同样的作用。如果XS = ZS的校准方法获得。如果该方法是“罗吉特”克权重将围绕常数C,低<C <UPP。在校准法中C = 1(见calib)。


值----------Value----------

The function returns the vector of g-weights.
该函数返回G的权重向量。


参考文献----------References----------

Deville, J.-C. (2000). Generalized calibration and application for weighting for non-response, COMPSTAT 2000: proceedings in computational statistics, p. 65&ndash;76.<br> Estevao, V.M., and S盲rndal, C.E. (2000). A functional form approach to calibration. Journal of Official Statistics, 16, 379&ndash;399.<br> Kott, P.S. (2006). Using calibration weighting to adjust for nonresponse and coverage errors. Survey Methodology, 32, 133&ndash;142.<br>

参见----------See Also----------

checkcalibration, calib
checkcalibration,calib


实例----------Examples----------


############[###########]
## Example 1[#示例1]
############[###########]
# matrix of sample calibration variables [基质样品的标定变量]
Xs=cbind(
c(1,1,1,1,1,0,0,0,0,0),
c(0,0,0,0,0,1,1,1,1,1),
c(1,2,3,4,5,6,7,8,9,10))
# inclusion probabilities[包含概率]
piks=rep(0.2,times=10)
# vector of population totals[向量的人口总数]
total=c(24,26,290)
# matrix of instrumental variables[工具变量矩阵]
Zs=Xs+matrix(runif(nrow(Xs)*ncol(Xs)),nrow(Xs),ncol(Xs))
# the g-weights using the truncated method[克的重量,使用截短的方法]
g=gencalib(Xs,Zs,d=1/piks,total,method="truncated",bounds=c(0.5,1.5))
# the calibration estimator of X is equal to the 'total' vector[X的估计是平等的“总”矢量校准]
t(g/piks)%*%Xs
# the g-weights are between lower and upper bounds[克重量的上界和下界之间的]
summary(g)
############[###########]
## Example 2[#示例2]
############[###########]
# Example of generalized 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(Totaltaxation/mean(Totaltaxation),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=UPpoisson(pik)            # sample[样品]
Xs=X[s==1,]                 # sample calibration variable matrix [样品校准变量矩阵]
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)  
# the population total[人口总数]
total
Z=cbind(TaxableIncome/mean(TaxableIncome),averageincome/mean(averageincome))
# defines the instrumental variables[定义的工具变量]
Zs=Z[s==1,]
# computation of the generalized g-weights[的广义g权重计算]
# by means of different generalized calibration methods[由不同的广义的校准方法的装置]
g1=gencalib(Xs,Zs,d=1/piks,total,method="linear")
g2=gencalib(Xs,Zs,d=1/piks,total,method="raking")
g3=gencalib(Xs,Zs,d=1/piks,total,method="truncated",bounds=c(0.5,8))
g4=gencalib(Xs,Zs,d=1/piks,total,method="logit",bounds=c(0.5,1.5))
# In some cases, the calibration does not exist[在某些情况下,不存在校准]
# particularly when bounds are used.[特别是当使用界限。]
# if the calibration is possible, the calibration estimator of Xs is printed[如果校准是可能的,打印时,X的校准估计]
if(checkcalibration(Xs,d=1/piks,total,g1)$result) print(c((g1/piks)%*% Xs)) else print("error")
if(!is.null(g2))
if(checkcalibration(Xs,d=1/piks,total,g2)$result) print(c((g2/piks)%*% Xs)) else print("error")
if(!is.null(g3))
if(checkcalibration(Xs,d=1/piks,total,g3)$result) print(c((g3/piks)%*% Xs)) else print("error")
if(!is.null(g4))
if(checkcalibration(Xs,d=1/piks,total,g4)$result) print(c((g4/piks)%*% Xs)) else print("error")
############[###########]
## Example 3[#示例3]
############[###########]
# Example of generalized calibration and adjustment for unit nonresponse in the 'calibration' vignette[在“校准”小插曲广义校准和调整的单元无应答的例子]
vignette("calibration", package="sampling")

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-29 04:36 , Processed in 0.020335 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表