Dear useRs,

How could I obtain the confidence intervals for the means of my treatments, 
when my data was fitted to a GLM?
I need the CI's for the Poisson and Negative Binomial distributions.

Here's what I have:

mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1))
model1 <- glm(value ~ treatments, data=mydata1, family=poisson)
means1 <- with(mydata1, tapply(value, treatments, mean))

now I need the confidence intervals for the means

And then again for a negative binomial GLM

require(MASS)
mydata2 <- data.frame('treatments'=gl(4, 4, 64, LETTERS[1:4]), 'species'=gl(4, 
1, 64, letters[1:4]), 'value'=rnegbin(64,1,1))
model2 <- glm.nb(value ~ treatments*species, data=mydata2)
means2 <- with(cbind('x'=gl(16,4),mydata2), tapply(value, x, mean))

Can I get the confidence intervals for each mean in means1 and means2, 
according to the family used?

Thanks in advance, all the best!
Rafael.


      
____________________________________________________________________________________
[[elided Yahoo spam]]

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to