plot.boot(boot)
plot.boot()所属R语言包:boot
Plots of the Output of a Bootstrap Simulation
图的Bootstrap仿真的输出
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This takes a bootstrap object and produces plots for the bootstrap replicates of the variable of interest.
这需要一个引导对象和生产,引导感兴趣的变量复制的图。
用法----------Usage----------
## S3 method for class 'boot'
plot(x, index = 1, t0 = NULL, t = NULL, jack = FALSE,
qdist = "norm", nclass = NULL, df, ...)
参数----------Arguments----------
参数:x
An object of class "boot" returned from one of the bootstrap generation functions.
一个类的对象"boot"返回引导新一代功能之一。
参数:index
The index of the variable of interest within the output of boot.out. This is ignored if t and t0 are supplied.
利益内boot.out输出变量的指数。如果t和t0提供这被忽略。
参数:t0
The original value of the statistic. This defaults to boot.out$t0[index] unless t is supplied when it defaults to NULL. In that case no vertical line is drawn on the histogram.
统计的原始值。这默认为boot.out$t0[index]除非t提供时,它默认为NULL。在这种情况下,没有垂直线的绘制直方图。
参数:t
The bootstrap replicates of the statistic. Usually this will take on its default value of boot.out$t[,index], however it may be useful sometimes to supply a different set of values which are a function of boot.out$t.
引导重复统计。通常将其默认值boot.out$t[,index],但它可能是有用的,有时提供一套不同的价值观,这是一个boot.out$t功能。
参数:jack
A logical value indicating whether a jackknife-after-bootstrap plot is required. The default is not to produce such a plot.
一个逻辑值,指明是否折刀后,引导图需要。默认情况下是不会产生这样一个图。
参数:qdist
The distribution against which the Q-Q plot should be drawn. At present "norm" (normal distribution - the default) and "chisq" (chi-squared distribution) are the only possible values.
应制定对分配的QQ图。目前"norm"(正态分布 - 默认)和"chisq"(卡方分布)是唯一可能的值。
参数:nclass
An integer giving the number of classes to be used in the bootstrap histogram. The default is the integer between 10 and 100 closest to ceiling(length(t)/25).
一个整数,要引导直方图的班级数目。默认是最接近ceiling(length(t)/25)10和100之间的整数。
参数:df
If qdist is "chisq" then this is the degrees of freedom for the chi-squared distribution to be used. It is a required argument in that case.
如果qdist是"chisq"那么这就是要使用卡方分布的自由程度。在这种情况下它是一个必需的参数。
参数:...
When jack is TRUE additional parameters to jack.after.boot can be supplied. See the help file for jack.after.boot for details of the possible parameters.
当jack是TRUEjack.after.boot额外的参数可以提供。请参阅帮助文件jack.after.boot可能的参数的详细信息。
Details
详情----------Details----------
This function will generally produce two side-by-side plots. The left plot will be a histogram of the bootstrap replicates. Usually the breaks of the histogram will be chosen so that t0 is at a breakpoint and all intervals are of equal length. A vertical dotted line indicates the position of t0. This cannot be done if t is supplied but t0 is not and so, in that case, the breakpoints are computed by hist using the nclass argument and no vertical line is drawn.
此功能一般会产生两个边侧图。左边的图将是一个引导直方图复制。一般将选择直方图的截断,使t0是在一个断点,所有的时间间隔长度相等。一个垂直的虚线表示位置t0。这不能做t如果提供,但t0不等,在这种情况下,断点hist使用nclass论点,并没有垂直线是计算绘制。
The second plot is a Q-Q plot of the bootstrap replicates. The order statistics of the replicates can be plotted against normal or chi-squared quantiles. In either case the expected line is also plotted. For the normal, this will have intercept mean(t) and slope sqrt(var(t)) while for the chi-squared it has intercept 0 and slope 1.
第二个图是一个引导复制的QQ图。复制的订单统计数据,可以绘制对正常或卡方位数。在两种情况下,预计线也绘制。为正常,这将有拦截mean(t)和斜坡sqrt(var(t))而卡方拦截1 0和斜坡。
If jack is TRUE a third plot is produced beneath these two. That plot is the jackknife-after-bootstrap plot. This plot may only be requested when nonparametric simulation has been used. See jack.after.boot for further details of this plot.
如果jack是TRUE第三个图是下面这两个。这一图是折刀后,引导图。此图只可要求时,已被用于非参数模拟。看到jack.after.boot这个图的进一步细节。
值----------Value----------
boot.out is returned invisibly.
boot.out返回无形。
副作用----------Side Effects----------
All screens are closed and cleared and a number of plots are produced on the current graphics device. Screens are closed but not cleared at termination of this function.
关闭所有屏幕和清除当前图形设备上产生的一些图。屏幕关闭,但不会清零,终止此功能。
参见----------See Also----------
boot, jack.after.boot, print.boot
boot,jack.after.boot,print.boot
举例----------Examples----------
# We fit an exponential model to the air-conditioning data and use[我们适合指数模型的空调数据,并使用]
# that for a parametric bootstrap. Then we look at plots of the[这对于一个参数化的引导。然后,我们期待的图]
# resampled means.[重采样方法。]
air.rg <- function(data, mle) rexp(length(data), 1/mle)
air.boot <- boot(aircondit$hours, mean, R = 999, sim = "parametric",
ran.gen = air.rg, mle = mean(aircondit$hours))
plot(air.boot)
# In the difference of means example for the last two series of the [在手段例如在过去的两个系列的区别]
# gravity data[重力数据]
grav1 <- gravity[as.numeric(gravity[, 2]) >= 7, ]
grav.fun <- function(dat, w) {
strata <- tapply(dat[, 2], as.numeric(dat[, 2]))
d <- dat[, 1]
ns <- tabulate(strata)
w <- w/tapply(w, strata, sum)[strata]
mns <- as.vector(tapply(d * w, strata, sum)) # drop names[下降的名字]
mn2 <- tapply(d * d * w, strata, sum)
s2hat <- sum((mn2 - mns^2)/ns)
c(mns[2] - mns[1], s2hat)
}
grav.boot <- boot(grav1, grav.fun, R = 499, stype = "w", strata = grav1[, 2])
plot(grav.boot)
# now suppose we want to look at the studentized differences.[现在假设我们想看看在学生化差异。]
grav.z <- (grav.boot$t[, 1]-grav.boot$t0[1])/sqrt(grav.boot$t[, 2])
plot(grav.boot, t = grav.z, t0 = 0)
# In this example we look at the one of the partial correlations for the[在这个例子中,我们期待在为部分相关]
# head dimensions in the dataset frets.[DataSet中的苦恼头尺寸。]
frets.fun <- function(data, i) {
pcorr <- function(x) {
# Function to find the correlations and partial correlations between[函数来查找相关和部分相关关系]
# the four measurements.[四个测量。]
v <- cor(x)
v.d <- diag(var(x))
iv <- solve(v)
iv.d <- sqrt(diag(iv))
iv <- - diag(1/iv.d) %*% iv %*% diag(1/iv.d)
q <- NULL
n <- nrow(v)
for (i in 1n-1))
q <- rbind( q, c(v[i, 1:i], iv[i,(i+1):n]) )
q <- rbind( q, v[n, ] )
diag(q) <- round(diag(q))
q
}
d <- data[i, ]
v <- pcorr(d)
c(v[1,], v[2,], v[3,], v[4,])
}
frets.boot <- boot(log(as.matrix(frets)), frets.fun, R = 999)
plot(frets.boot, index = 7, jack = TRUE, stinf = FALSE, useJ = FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|