我目前正在做一个简单的重新抽样研究,比较不同的方法来生成线性回归模型的置信区间。我正在尝试跟随伯顿等人。al's (2006) 的建议,我最感兴趣的是置信区间如何覆盖原始样本的真实值(覆盖率)。
由于一些置信区间是基于我认为的引导程序,基于这个 CV-question,因此使用引导程序重新采样是不公平的,其中一个分类变量的类别少于 8 个人。因此,如果我得到一个包含该标准的样本,我会重新取样。我与之合作的一位统计学家告诉我,这个过程违反了分布假设,这是一种不好的做法。不幸的是,他的论点并没有说服我,因此我希望这里有人可以帮助解释我的逻辑缺陷。
在我看来,我永远不会对只有 2 名女性和 23 名男性的样本使用自举,因为这两名女性的贡献不足以从自举过程中产生合理的随机性。我知道我不能对我丢弃的样本说任何话,但是为什么对满足标准的样本说些什么是错误的呢?
小更新
在比尔有趣的回答之后,我只想澄清一点。原始样本在每个类别中都有“足够”,以允许抽取的样本在每个类别中包含至少 8 个人。boostrap stat-function 总是相同的(我使用 Rboot
包):
#' Gets the coefficients for the bootstrap function
#'
#' This function also catches errors that may
#' occur in the lm() call and then returns a NA vector.
#' As I lack controle over the data this is necessary
#' since there can be unexpected problems with the
#' lm() call.
#'
#' @param formula The lm() formula
#' @param data The data set that is to be bootstrapped
#' @param indices The indices that the bootstrap
#' provides the function see the library boot()
#' function for details. If the function is used for
#' the asymptotic confidence interval then the indices
#' should be provided as a simple sequence - 1:nrow(data)
#' @param true_vals The true values. Only used so that
#' the function can return a result that contains the
#' same number of estimates even if some coefficients
#' were missing for this bootstrapped data set
#' @return vector Returns the coefficients as a
#' vector, in case of missing those are marked as NA
#' at the apropriate positions.
bootstrap_lm <- function(data, indices, formula, true_vals) {
d <- data[indices,]
fit <- try(lm(formula, data=d), silent=TRUE)
if ("try-error" %in% class(fit))
return(rep(NA, times=length(true_vals)))
ret <- coef(fit)
# Sometimes not all options get an estimate
# as the bootstrap might be without those variables
# therefore we need to generate empty values
if (length(true_vals) > length(ret)){
empty <- rep(NA, times=length(true_vals))
names(empty) <- names(true_vals)
empty[which(names(empty) %in% names(ret))] <- ret
ret <- empty
}
return(ret)
}
正如@jbowman 在他的回答中评论的那样 - 比较其中一个置信区间根据定义不起作用的情况是没有意义的。我正在比较常规、稳健和自举的置信区间,我希望比较尽可能公平。在我看来,比较一个类别中小于 8 的样本应该会导致偏向于常规和稳健的置信区间。
我想我将不得不采用传统的方法并跳过这个标准,否则我不会发表 - 似乎如果是这种情况,那么统计界将会有文章偏向于自举(在像我这样的比较研究中) . 如果有人有一篇好论文可以支持我的方法,我将不胜感激。