summary.eRm confint:当使用summary(rasch.model)时,95%置信区间或97.5%。

问题描述 投票:0回答:1

我刚刚用包eRm在R中挖了一下,想知道confint是如何计算Rasch模型的置信区间的。使用

getAnywhere(summary.eRm)

我发现实际使用confint的代码是这样的。

function (object, ...) 
{
    cat("\n")
    cat("Results of", object$model, "estimation: \n")
    cat("\n")
    cat("Call: ", deparse(object$call), "\n")
    cat("\n")
    cat("Conditional log-likelihood:", object$loglik, "\n")
    cat("Number of iterations:", object$iter, "\n")
    cat("Number of parameters:", object$npar, "\n")
    cat("\n")
    X <- object$X
    X01 <- object$X01
    mt_vek <- apply(X, 2, max, na.rm = TRUE)
    **ci <- confint(object, "eta")**
    if (object$model %in% c("RM", "RSM", "PCM")) 
        if (is.null(object$call$W)) {
            cat("Item (Category) Difficulty Parameters (eta):")
        }
        else {
            cat("Item (Category) Parameters (eta):\nBased on design matrix W =", 
                deparse(object$call$W))
        }
    else cat("Basic Parameters eta")
    cat(" with 0.95 CI:\n")
    coeftable <- as.data.frame(cbind(round(object$etapar, 3), 
        round(object$se.eta, 3), round(ci, 3)))
    colnames(coeftable) <- c("Estimate", "Std. Error", "lower CI", 
        "upper CI")
    rownames(coeftable) <- names(object$etapar)
    print(coeftable)
    **ci <- confint(object, "beta")**
    cat("\nItem Easiness Parameters (beta) with 0.95 CI:\n")
    coeftable <- cbind(round(object$betapar, 3), round(object$se.beta, 
        3), round(ci, 3))
    colnames(coeftable) <- c("Estimate", "Std. Error", "lower CI", 
        "upper CI")
    rownames(coeftable) <- names(object$betapar)
    print(coeftable)
    cat("\n")
}

现在看了一下 ?confint 菜单,我发现如果没有指定其他内容,它默认为97.5%的CI。这是否意味着,计算出的CI被错误地命名为CI 95%?

r data-science modeling
1个回答
0
投票

95%的置信区间意味着区间外的总面积为5%。这被分摊到置信度下限以下2.5%,置信度上限以上2.5%。区间的上端在97.5%-ile,区间的下端在2.5%-ile。

例如:15名男性样本产生的平均脑容量为1210cc,标准差为37cc。对于这个人群,我们可以计算出95%的置信区间,如下所示。

1210 + c(-1,1) * (37/sqrt(15))*qt(.975,15)

...和输出。

> 1210 + c(-1,1) * (37/sqrt(15))*qt(.975,15)
[1] 1189.637 1230.363
>

注意,我们使用 qt(.975,15) 来计算区间,而不是 qt(.95,15).

此外,帮助 confint() 证实了这一点。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.