[R] confint for glm (general linear model)

David Winsemius dwinsemius at comcast.net
Sun Dec 13 05:43:05 CET 2009


On Dec 12, 2009, at 8:19 PM, casperyc wrote:

>
> for an example,
>
>
> counts <- c(18,17,15,20,10,20,25,13,12)
> outcome <- gl(3,1,9); treatment <- gl(3,3)
> glm.D93 <- glm(counts ~ outcome + treatment, family=poisson())
> confint(glm.D93)
> confint.default(glm.D93)  # based on asymptotic normality
>
> to verify the confidence interval (confint.default(glm.D93))  for  
> outcome2
>
> -4.542553e-01 + c(-1,1) * 0.2021708 * qt(0.975,df=4)
> -1.0155714  0.1070608
>
> does not give me
> outcome2    -0.8505027 -0.05800787
> as in confint.default(glm.D93)

But this does (up to rounding anyway):

 > coef(summary(glm.D93))[2,1] + c(-1,1) * coef(summary(glm.D93)) 
[2,2]*qnorm(0.975)
[1] -0.85050267 -0.05800787

I can understand thinking that the CI's might be t-distributed but the  
usual formulation is that they are normally distributed.

>
-- 

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list