【问题标题】:What is the difference between "confint" and "confint.default" when calculating confidence intervals for a logit model in R?在 R 中计算 logit 模型的置信区间时,“confint”和“confint.default”有什么区别?
【发布时间】:2020-11-19 22:04:52
【问题描述】:

我想计算 R 中 logit 模型的某些参数的置信区间。我已经阅读了 confintconfint.default 的文档,但我没有能够理解有关何时适合应用每个功能的信息。有人可以向我解释一下吗?

【问题讨论】:

    标签: r confidence-interval


    【解决方案1】:

    您只需致电confintconfint 是一个“通用”函数。它根据您作为参数提供的模型对象的类型“调度”适当的“方法”函数。

    如果您向confint 提供使用glm 函数创建的模型,confint 将调度函数confint.glm。 (如果您运行class(x),其中x 是模型对象的名称,您会看到它的类是glm,这就是告诉confint 要调度哪个方法的原因。)调用confint.default 将强制使用“默认”方法。 confint 的帮助解释说“默认方法假定正态性”,因此在逻辑回归模型上使用时可能会给出不正确的结果。

    您可以通过运行methods(confint) 查看confint 拥有的所有模型类型,您会看到其中之一是confint.glm

    这都与 R 中面向对象编程的工作方式有关。例如,请参阅here 了解详细信息。

    【讨论】:

      猜你喜欢
      • 2020-10-18
      • 1970-01-01
      • 2022-01-07
      • 2019-03-19
      • 1970-01-01
      • 2010-11-26
      • 2015-08-14
      • 2010-10-08
      • 1970-01-01
      相关资源
      最近更新 更多