[Rd] Problem with confint function

peter dalgaard pdalgd at gmail.com
Fri Feb 11 20:04:08 CET 2011


On Feb 11, 2011, at 19:25 , Kino Aguilar wrote:

> 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?
> 

confint.glm computes using likelihood profiling (i.e., it inverts the likelihood ratio test criterion for a parameter). This is considered somewhat more accurate than the Wald approximation implied by +/- 1.96*SE. If you insist on the latter, try confint.default. (This *is* all on the help page for confint()!). 

> 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

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-devel mailing list