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

R语言:boot.ci()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:56:56 | 显示全部楼层 |阅读模式
boot.ci(boot)
boot.ci()所属R语言包:boot

                                         Nonparametric Bootstrap Confidence Intervals
                                         非参数Bootstrap置信区间

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

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

This function generates 5 different types of equi-tailed two-sided nonparametric confidence intervals.  These are the first order normal  approximation, the basic bootstrap interval, the studentized bootstrap  interval, the bootstrap percentile interval, and the adjusted bootstrap  percentile (BCa) interval.  All or a subset of these intervals can be  generated.  
此功能生成5等尾双面非参数置信区间的不同类型。这是第一阶近似正常,基本的引导间隔,学生化引导的时间间隔,引导百分间隔,调整引导百分(BCA)间隔。所有这些间隔的子集或可产生。


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


boot.ci(boot.out, conf = 0.95, type = "all",
        index = 1:min(2,length(boot.out$t0)), var.t0 = NULL,
        var.t = NULL, t0 = NULL, t = NULL, L = NULL,
        h = function(t) t, hdot = function(t) rep(1,length(t)),
        hinv = function(t) t, ...)



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

参数:boot.out
An object of class "boot" containing the output of a bootstrap calculation.   
一个对象类"boot"包含一个bootstrap计算输出。


参数:conf
A scalar or vector containing the confidence level(s) of the required interval(s).  
包含的信心水平所需的时间间隔(S)(S)的一个标量或矢量。


参数:type
A vector of character strings representing the type of intervals required. The value should be any subset of the values c("norm","basic", "stud", "perc", "bca") or simply "all" which will compute all five types of intervals.  
代表所需的时间间隔类型的字符串的字符向量。该值应该是任何值子集c("norm","basic", "stud", "perc", "bca")只是"all"这将计算区间的所有五种类型。


参数:index
This should be a vector of length 1 or 2.  The first element of index indicates the position of the variable of interest in boot.out$t0 and the relevant column in boot.out$t.  The second element indicates the position of the variance of the variable of interest.  If both var.t0 and var.t are supplied then the second element of index (if present) is ignored.  The default is that the variable of interest is in position 1 and its variance is in position 2 (as long as there are 2 positions in boot.out$t0).  
这应该是一个长度为1或2的向量。 index的第一个元素表示的boot.out$t0和boot.out$t有关列的兴趣变量的位置。第二个元素表示感兴趣的变量的方差的位置。如果这两个var.t0和var.t提供index(如果存在)的第二个元素将被忽略。默认的是利益的变量是在位置1和其方差是2位置(只要有2boot.out$t0仓)。


参数:var.t0
If supplied, a value to be used as an estimate of the variance of the statistic for the normal approximation and studentized intervals. If it is not supplied and length(index) is 2 then var.t0 defaults to boot.out$t0[index[2]] otherwise var.t0 is undefined.  For studentized intervals var.t0 must be defined. For the normal approximation, if var.t0 is undefined it defaults to var(t).  If a transformation is supplied through the argument h then var.t0 should be the variance of the untransformed statistic.  
如果提供一个值被用来作为一个正常的逼近和学生化区间的统计方差的估计。如果它没有提供length(index)2var.t0默认boot.out$t0[index[2]]否则var.t0是不确定的。对于学生化区间var.t0必须定义。为正常的逼近,如果var.t0是var(t)未定义它默认。如果提供的参数转换是通过h然后var.t0应该是未转换的统计方差。


参数:var.t
This is a vector (of length boot.out$R) of variances of the bootstrap replicates of the variable of interest.  It is used only for studentized intervals.  If it is not supplied and length(index) is 2 then var.t defaults to boot.out$t[,index[2]], otherwise its value is undefined which will cause an error for studentized intervals.  If a transformation is supplied through the argument h then var.t should be the variance of the untransformed bootstrap statistics.  
这是一个引导的差异向量(长度boot.out$R)复制的可变利益。它仅用于学生化区间。如果没有提供length(index)2var.t默认为boot.out$t[,index[2]],否则它的价值是不确定的,这将导致学生化区间的错误。如果提供的参数转换是通过h然后var.t应该是未转化的引导统计方差。


参数:t0
The observed value of the statistic of interest.  The default value is boot.out$t0[index[1]].  Specification of t0 and t allows the user to get intervals for a transformed statistic which may not be in the bootstrap output object.  See the second example below.  An alternative way of achieving this would be to supply the functions h, hdot, and hinv below.  
利益的统计观测值。默认值是boot.out$t0[index[1]]。规范t0和t允许用户得到一个转换的统计,这可能不是在引导输出对象的时间间隔。见下面的第二个例子。实现这一目标的一个替代方式,将提供的功能h,hdot,hinv下面。


参数:t
The bootstrap replicates of the statistic of interest.  It must be a vector of length boot.out$R.  It is an error to supply one of t0 or t but not the other.  Also if studentized intervals are required and t0 and t are supplied then so should be var.t0 and var.t.  The default value is boot.out$t[,index].  
引导重复统计的兴趣。它必须是一个长度boot.out$R向量。这是一个错误,提供t0或t而不是其他之一。另外,如果学生化的时间间隔是必需的,t0和t提供那么应该是var.t0和var.t。默认值是boot.out$t[,index]。


参数:L
The empirical influence values of the statistic of interest for the observed data.  These are used only for BCa intervals.  If a transformation is supplied through the parameter h then L should be the influence values for t; the values for h(t) are derived from these and hdot within the function. If L is not supplied then the values are calculated using empinf if they are needed.  
影响利益的统计经验值的观测数据。这些仅用于为BCA间隔。如果转型提供通过参数h然后L应该是影响值th(t)这些hdot内派生值功能。 L如果没有提供,则计算值使用empinf,“如果他们是必要的。


参数:h
A function defining a transformation.  The intervals are calculated on the scale of h(t) and the inverse function hinv applied to the resulting intervals.  It must be a function of one variable only and for a vector argument, it must return a vector of the same length, i.e. h(c(t1,t2,t3)) should return c(h(t1),h(t2),h(t3)). The default is the identity function.  
函数定义转换。间隔计算规模h(t)和反函数hinv应用所产生的间隔。它必须是一个变量和矢量参数的功能,它必须返回一个相同长度的向量,即h(c(t1,t2,t3))应该返回c(h(t1),h(t2),h(t3))。默认是身份的功能。


参数:hdot
A function of one argument returning the derivative of h.  It is a required argument if h is supplied and normal, studentized or BCa intervals are required.  The function is used for approximating the variances of h(t0) and h(t) using the delta method, and also for finding the empirical influence values for BCa intervals.  Like h it should be able to take a vector argument and return a vector of the same length.  The default is the constant function 1.  
一个一个参数返回h衍生功能。如果h供应正常,学生化或BCA区间的是,这是一个必要的参数。函数逼近方差h(t0)和h(t)使用增量方法,也为为BCA间隔寻找经验的影响值。像h它应该能够采取的向量参数,并返回一个相同长度的向量。默认是恒定的功能1。


参数:hinv
A function, like h, which returns the inverse of h. It is used to transform the intervals calculated on the scale of h(t) back to the original scale. The default is the identity function.  If h is supplied but hinv is not, then the intervals returned will be on the transformed scale.  
一个函数,返回像h,逆h。它使用转换h(t)回原有规模的规模计算的时间间隔。默认是身份的功能。 h如果提供,但hinv是不是,那么返回的时间间隔将规模转化。


参数:...
Any extra arguments that boot.out$statistic is expecting. These arguments are needed only if BCa intervals are required and L is not supplied since in that case L is calculated through a call to empinf which calls boot.out$statistic.  
任何额外的参数,boot.out$statistic期待。这些参数是必需的,只有当BCA的时间间隔是必需的,L不提供在这种情况下L是通过调用计算empinf要求boot.out$statistic自。


Details

详情----------Details----------

The formulae on which the calculations are based can be found in Chapter 5 of Davison and Hinkley (1997).  Function boot must be run prior to running this function to create the object to be passed as boot.out.
戴维森和欣克利(1997)第5章的基础上计算公式,可以发现。功能boot必须运行之前运行这个函数来创建对象,通过boot.out。

Variance estimates are required for studentized intervals.  The variance of the observed statistic is optional for normal theory intervals.  If it is not supplied then the bootstrap estimate of variance is used.  The normal intervals also use the bootstrap bias correction.
要求学生化区间方差估计。观测统计的差异是正常的理论间隔可选。如果它没有提供,则用于引导估计方差。在正常的时间间隔,还可以使用自举偏置校正。

Interpolation on the normal quantile scale is used when a non-integer order statistic is required.  If the order statistic used is the smallest or largest of the R values in boot.out a warning is generated and such intervals should not be considered reliable.  
非整数阶统计需要时使用正常的分量规模插值。如果使用的次序统计量是最小或最大的R值在boot.out警告产生的时间间隔不应被视为可靠的。


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

An object of type "bootci" which contains the intervals. It has components
一个对象的类型"bootci"其中包含的时间间隔。它具有组件


参数:R
The number of bootstrap replicates on which the intervals were based.  
上复制的时间间隔为基础的引导。


参数:t0
The observed value of the statistic on the same scale as the intervals.  
观测值的统计上同等规模的时间间隔。


参数:call
The call to boot.ci which generated the object.  It will also contain one or more of the following components depending on the value of type used in the call to bootci.  
boot.ci这调用生成的对象。它还将包含一个或多个上type调用bootci在使用值取决于以下几部分组成。


参数:normal
A matrix of intervals calculated using the normal approximation.  It will have 3 columns, the first being the level and the other two being the upper and lower endpoints of the intervals.  
使用正常的近似计算的时间间隔矩阵。这将有3列,第一水平和其他两个间隔的上限和下限的端点。


参数:basic
The intervals calculated using the basic bootstrap method.  
间隔使用基本的引导方法计算。


参数:student
The intervals calculated using the studentized bootstrap method.  
的时间间隔计算使用的学生化的引导方法。


参数:percent
The intervals calculated using the bootstrap percentile method.  
间隔使用引导百分方法计算。


参数:bca
The intervals calculated using the adjusted bootstrap percentile (BCa) method.  These latter four components will be matrices with 5 columns,  the first column containing the level, the next two containing the indices of the order statistics used in the calculations and the final two the calculated endpoints themselves.   
间隔调整引导百分(BCA)法计算。这后者的四个组成部分,将有5列,第一列包含的水平,接下来的两个包含用于计算和最后两个计算端点本身的次序统计量的指数矩阵。


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

Bootstrap Methods and Their Application, Chapter 5. Cambridge University Press.
Discussion). Statistical Science, 11, 189–228.
Journal of the American Statistical Association, 82, 171–200.

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

abc.ci, boot, empinf, norm.ci
abc.ci,boot,empinf,norm.ci


举例----------Examples----------


# confidence intervals for the city data[城市数据的置信区间]
ratio <- function(d, w) sum(d$x * w)/sum(d$u * w)
city.boot <- boot(city, ratio, R = 999, stype = "w", sim = "ordinary")
boot.ci(city.boot, conf = c(0.90, 0.95),
        type = c("norm", "basic", "perc", "bca"))

# studentized confidence interval for the two sample [两个样本学生化置信区间]
# difference of means problem using the final two series[使用最后两个系列的手段问题的差异]
# of the gravity data. [重力数据。]
diff.means <- function(d, f)
{    n <- nrow(d)
     gp1 <- 1:table(as.numeric(d$series))[1]
     m1 <- sum(d[gp1,1] * f[gp1])/sum(f[gp1])
     m2 <- sum(d[-gp1,1] * f[-gp1])/sum(f[-gp1])
     ss1 <- sum(d[gp1,1]^2 * f[gp1]) - (m1 *  m1 * sum(f[gp1]))
     ss2 <- sum(d[-gp1,1]^2 * f[-gp1]) - (m2 *  m2 * sum(f[-gp1]))
     c(m1 - m2, (ss1 + ss2)/(sum(f) - 2))
}
grav1 <- gravity[as.numeric(gravity[,2]) >= 7, ]
grav1.boot <- boot(grav1, diff.means, R = 999, stype = "f",
                   strata = grav1[ ,2])
boot.ci(grav1.boot, type = c("stud", "norm"))

# Nonparametric confidence intervals for mean failure time [平均故障间隔时间的非参数的置信区间]
# of the air-conditioning data as in Example 5.4 of Davison[戴维森5.4为例,空调数据]
# and Hinkley (1997)[欣克利(1997)]
mean.fun <- function(d, i)
{    m <- mean(d$hours[i])
     n <- length(i)
     v <- (n-1)*var(d$hours[i])/n^2
     c(m, v)
}
air.boot <- boot(aircondit, mean.fun, R = 999)
boot.ci(air.boot, type = c("norm", "basic", "perc", "stud"))

# Now using the log transformation[现在使用的日志改造]
# There are two ways of doing this and they both give the[有两个这样的方式,他们都给予]
# same intervals.[相同的时间间隔。]

# Method 1[方法1]
boot.ci(air.boot, type = c("norm", "basic", "perc", "stud"),
        h = log, hdot = function(x) 1/x)

# Method 2[方法2]
vt0 <- air.boot$t0[2]/air.boot$t0[1]^2
vt <- air.boot$t[, 2]/air.boot$t[ ,1]^2
boot.ci(air.boot, type = c("norm", "basic", "perc", "stud"),
        t0 = log(air.boot$t0[1]), t = log(air.boot$t[,1]),
        var.t0 = vt0, var.t = vt)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-4 23:37 , Processed in 0.022419 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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