[R] posting for r-help

Ben Bolker bbolker at gmail.com
Thu Jan 12 19:59:41 CET 2012


 <rbuxton <at> mun.ca> writes:
 
> I have a post I would like to put on the "95% confidence intercal with glm"
> thread.  Thank-you so much!

  Sending it where you did and titling it "Re: 95% confidence interval
with glm" might add it to the same thread, but even if not it will
be in roughly the right place.

> I am wondering first of all if anyone knows how to calculate confidence
> intervals for a GLMM?  I use the lme4 library.

  This is a bit of a thorny problem, and you should probably
(a) post the question to r-sig-mixed-models at r-project.org (again
with an informative title) and (b) see <http://glmm.wikidot.com/faq>
(search for "prediction"). 
> 
> Also, I am wondering how to predict a model mean and 
> confidence intervals for a
> particular independent variable?
> 
> For example in the following example:
> >> counts <- c(18,17,15,20,10,20,25,13,12)
> >> outcome <- gl(3,1,9)
> >> treatment <- gl(3,3)
> >> d.AD <- data.frame(treatment, outcome, counts)
> >> glm.D93 <- glm(counts ~ outcome + treatment, family=poisson,
> >>             data=d.AD)
> 
> How would one calculate the confidence intervals for the
>  "treatment" variable?
> Is there something that can come after the 'se.fit=TRUE' command?

  confint(glm.D93) is as close as you can come.  The treatment variable
is actually represented by two different parameters (contrasts between
levels 1 and 2 and between levels 1 and 3, by default, but you can
change this: see ?contrasts ).

  Ben Bolker



More information about the R-help mailing list