From jfox at mcmaster.ca  Fri Feb 11 19:53:32 2011
From: jfox at mcmaster.ca (John Fox)
Date: Fri, 11 Feb 2011 13:53:32 -0500
Subject: [Rd] Problem with confint function
In-Reply-To: <AANLkTinUeFk0Mr+Vd0bCMD0NB35pc_ryiGJF-Aa=CCzo@mail.gmail.com>
References: <AANLkTinUeFk0Mr+Vd0bCMD0NB35pc_ryiGJF-Aa=CCzo@mail.gmail.com>
Message-ID: <006401cbca1c$fbcaad50$f36007f0$@mcmaster.ca>

Dear Kino,

The confidence intervals that you've computed yourself are based on the Wald
statistic, while confint() computes confidence intervals based on the
likelihood-ratio statistic, by profiling the likelihood (see ?confint and
click on the link for confint.glm). Basing confidence intervals on the
likelihood is more computationally intensive but should be more accurate.

I hope this helps,
 John

--------------------------------
John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox




> -----Original Message-----
> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-
> project.org] On Behalf Of Kino Aguilar
> Sent: February-11-11 1:26 PM
> To: R-devel at r-project.org
> Subject: [Rd] Problem with confint function
> 
> Hi,
> 
> I am currently doing logistic regression analyses and I am trying to get
> confidence intervals for my partial logistic regression coefficients.
> Supposing I am right in assuming that the formula to estimate a 95% CI
> for a log odds coefficient is the following:
> 
> log odds - 1.96*SE to log odds + 1.96*SE
> 
> then I am not getting the right CI.
> 
> For instance, this is a summary of my model:
>             Estimate Std. Error z value Pr(>|z|)
> (Intercept) -0.06106    0.29808  -0.205   0.8377
> pSusSD       0.21184    0.36886   0.574   0.5658
> pBenSD       1.20255    0.52271   2.301   0.0214 *
> pBarSD      -0.08654    0.48749  -0.178   0.8591
> pSevSD       0.99759    0.44795   2.227   0.0259 *
> 
> And this is are the corresponding CI when I call the confint function:
>                  2.5 %    97.5 %
> (Intercept) -0.6548023 0.5264357
> pSusSD      -0.4980888 0.9733975
> pBenSD       0.2665235 2.3495259
> pBarSD      -1.0695945 0.8740359
> pSevSD       0.1877044 1.9747499
> 
> Utilizing the formula I mentioned above, the correct CI for pSusSD would
> actually be:
> > .21184-1.96*.36886
> [1] -0.5111256
> > .21184+1.96*.36886
> [1] 0.9348056
> 
> That is:
>                  2.5 %    97.5 %
> pSusSD      -0.5111256 0.9348056
> 
> I am wondering if there is a bug in the code or if there is another way
> to calculate a 95% CI for a logistic regression coefficient that I am
> not aware of?
> 
> Thanks!
> 
> --
> All the best!,
> ~Joaquin A. Aguilar A. - aka Kino
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Problem with confint function
John Fox