5

I want to calculate confidence intervals for some parameters of a logit model in R. I have read the documentation of both confint and confint.default but I haven't been able to understand the information about when it is appropriate to apply each function. Could someone explain this to me?

Phil
  • 7,287
  • 3
  • 36
  • 66

1 Answers1

6

You just need to call confint. confint is a "generic" function. It "dispatches" the appropriate "method" function based on the type of model object you provide as an argument.

If you provide confint with a model created with the glm function, confint dispatches the function confint.glm. (If you run class(x), where x is the name of your model object, you'll see its class is glm, and this is what tells confint which method to dispatch.) Calling confint.default will force the use of the "default" method. The help for confint explains that "the default method assumes normality", so it will likely give incorrect results when used on a logistic regression model.

You can see all of the types of models that confint has methods for by running methods(confint) and you'll see that one of them is confint.glm.

This is all related to how object oriented programming works in R. See, for example, here for details.

eipi10
  • 91,525
  • 24
  • 209
  • 285