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

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

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

                                        Model Based Estimation
                                         基于模型的估计

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

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

mbes is used for model based estimation of population means using auxiliary variables. Difference, ratio and regression estimates are available.
MBES使用基于模型的估计的人口是指使用辅助变量。差异,比率和回归估计。


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


mbes(formula, data, aux, N = Inf, method = 'all', level = 0.95, ...)



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

参数:formula
object of class formula (or one that can be coerced to that class): symbolic description for connection between primary and secondary information
类的对象formula(或一个可以强制转换为该类):象征性的描述初级和次级之间的信息连接


参数:data
data frame containing variables in the model
数据框包含在模型中的变量


参数:aux
known mean of auxiliary variable, which provides secondary information
平均的辅助变量,它提供的辅助信息


参数:N
positive integer for population size. Default is N=Inf, which means that calculations are carried out without finite population correction.
人口规模的正整数。默认值是N=Inf,这意味着计算的情况下进行有限的人口修正。


参数:method
estimation method. Options are 'simple','diff','ratio','regr','all'. Default is method='all'.
估计方法。选项是'simple','diff','ratio','regr','all'。默认是method='all'。


参数:level
coverage probability for confidence intervals. Default is level=0.95.
置信区间的覆盖概率。默认是level=0.95。


参数:...
further options for linear regression model
线性回归模型的进一步选项


Details

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

The option method='simple' calculates the simple sample estimation without using the auxiliary variable.  The option method='diff' calculates the difference estimate, method='ratio' the ratio estimate, and method='regr' the regression estimate which is based on the selected model. The option method='all' calculates the simple and all model based estimates.  For methods 'diff', 'ratio' and 'all' the formula has to be y~x with y primary and x secondary information.  For method 'regr', it is the symbolic description of the linear regression model. In this case, it can be used more than one auxiliary variable. Thus, aux has to be a vector of the same length as the number of auxiliary variables in order as specified in the formula.
选项“method='simple'计算简单的示例,而无需使用辅助变量的估计。选项“method='diff'计算差异的估计,method='ratio'的比例估计,和method='regr'的回归估计,是基于所选的型号。选项“method='all'计算简单,基于模型的估计。对于方法'diff','ratio'和'all'公式是y~x与y小学和x次要信息的。方法'regr',它是象征性的线性回归模型的描述。在这种情况下,它可以使用一个以上的辅助变量。因此,aux具有作为辅助变量的数目,以便具有相同的长度,如在式指定是一个向量。


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

The function mbes returns an object, which is a list consisting of the components
的功能mbes返回一个对象,这是由组件组成的一个列表


参数:call
is a list of call components: formula formula, data data frame, aux given value for mean of auxiliary variable, N population size, type type of model based estimation and level coverage probability for confidence intervals
formula公式,data数据框,aux给定值平均的辅助变量,N人口规模,type型的调用组件的列表:基于模型的估计和level覆盖概率为置信区间


参数:info
is a list of further information components: N population size, n sample size, p number of auxiliary variables, aux true mean of auxiliary variables in population and x.mean sample means of auxiliary variables
是进一步的信息组件的列表:N人口规模,n样本大小,p辅助变量,aux真实意思的辅助变量,人口和<X >辅助变量的样本均值


参数:simple
is a list of result components, if method='simple' or method='all' is selected: mean mean estimate of population mean for primary information, se standard error of the mean estimate, and ci vector of confidence interval boundaries  
结果组件的列表,如果method='simple'或method='all'选择:mean的意思的人口估计平均为主要信息,se标准误差的均值估计,和 ci向量的置信区间边界


参数:diff
is a list of result components, if method='diff' or method='all' is selected: mean mean estimate of population mean for primary information, se standard error of the mean estimate, and ci vector of confidence interval boundaries  
结果组件的列表,如果method='diff'或method='all'选择:mean的意思的人口估计平均为主要信息,se标准误差的均值估计,和 ci向量的置信区间边界


参数:ratio
is a list of result components, if method='ratio' or method='all' is selected: mean mean estimate of population mean for primary information, se standard error of the mean estimate, and ci vector of confidence interval boundaries  
结果组件的列表,如果method='ratio'或method='all'选择:mean的意思的人口估计平均为主要信息,se标准误差的均值估计,和 ci向量的置信区间边界


参数:regr
is a list of result components, if type='regr' or type='all' is selected: mean mean estimate of population mean for primary information, se standard error of mean estimate, ci vector of confidence interval boundaries, and model underlying linear regression model
结果组件的列表,如果type='regr'或type='all'选择:mean的意思的人口估计平均为主要信息,se平均估计标准误差,<X >向量的置信区间边界,ci基本线性回归模型


(作者)----------Author(s)----------


Juliane Manitz



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



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

Smean, Sprop
Smean,Sprop


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


## 1) simple suppositious example[#1)简单suppositious的例子]
data(pop)
# Draw a random sample of size=3[绘制一个随机的样本大小= 3]
set.seed(802016)
data <- pop[sample(1:5, size=3),]
names(data) <- c('id','x','y')
# difference estimator[差异估计]
mbes(formula=y~x, data=data, aux=15, N=5, method='diff', level=0.95)
# ratio estimator[比率估计]
mbes(formula=y~x, data=data, aux=15, N=5, method='ratio', level=0.95)
# regression estimator[回归估计]
mbes(formula=y~x, data=data, aux=15, N=5, method='regr', level=0.95)

## 2) Bundestag election[#2)联邦议院选举]
data(election)
# draw sample of size n = 20[选取样本大小n = 20]
N <- nrow(election)
set.seed(67396)
sample <- election[sort(sample(1:N, size=20)),]
# secondary information SPD in 2002[在2002年的次要信息SPD]
X.mean <- mean(election$SPD_02)
# forecast proportion of SPD in election of 2005[在2005年的选举比例的SPD预测]
mbes(SPD_05 ~ SPD_02, data=sample, aux=X.mean, N=N, method='all')
# true value[真值]
Y.mean <- mean(election$SPD_05)
Y.mean
# Use a second predictor variable[使用第二个预测变量]
X.mean2 <- c(mean(election$SPD_02),mean(election$GREEN_02))
# forecast proportion of SPD in election of 2005 with two predictors[SPD在2005年大选的两个预测预测比例]
mbes(SPD_05 ~ SPD_02+GREEN_02, data=sample, aux=X.mean2, N=N, method= 'regr')

## 3) money sample[#3)钱样品]
data(money)
mu.X <-  mean(money$X)
x <- money$X[which(!is.na(money$y))]
y <- na.omit(money$y)
# estimation[预算]
mbes(y~x, aux=mu.X, N=13, method='all')

## 4) model based two-phase sampling with mbes() [#4)基于模型的两阶段抽样与少数族裔企业()]
id <- 1:1000
x <- rep(c(1,0,1,0),times=c(10,90,70,830))
y <- rep(c(1,0,NA),times=c(15,85,900))
phase <- rep(c(2,1), times=c(100,900))
data <- data.frame(id,x,y,phase)
# mean of x out of first phase[意思是x的第一阶段]
mean.x <- mean(data$x)
mean.x
N1 <- length(data$x)
# calculation of estimation for y [计算估计为y]
est.y <- mbes(y~x, data=data, aux=mean.x, N=N1, method='ratio')
est.y
# correction of standard error with uncertaincy in first phase[在第一阶段校正标准错误uncertaincy]
v.y <- var(data$y, na.rm=TRUE)
se.y <- sqrt(est.y$ratio$se^2 + v.y/N1)
se.y
# corrected confidence interval[修正的置信区间]
lower <- est.y$ratio$mean - qnorm(0.975)*se.y
upper <- est.y$ratio$mean + qnorm(0.975)*se.y
c(lower, upper)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 06:31 , Processed in 0.029285 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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