Given the following data:
Treatment <- as.factor(c(rep("Ploughed",8),rep("Mowed",8), rep("Ploughed",9),rep("Mowed",10))) Strata <- as.factor(c(rep("Canopy",16), rep("Ground",19))) Herbivores <- as.integer(c(4,3,39,15,22,10,61,11,3,3,1,6,7,3,3,4,10,37,44,6, 77,222,49,101,74,112,23,47,86,42,104,203,111,310,41)) data <- data.frame(Treatment,Strata,Herbivores)
I am trying to fit a Negative Binomial generalized linear model, to see if Treatment affects the number of Herbivores, while controlling for strata. The data is overdispersed because we sampled two very different strata (canopy and ground cover).
First, I use this, to get the "theta" parameter:
library(MASS) m1 <- glm.nb(formula=Herbivores~Treatment+Strata,link=log, data=data) summary(m1)
Then, I use this to fit the final model:
m2 <- glm(formula=Herbivores~Treatment+Strata, family=negative.binomial (theta=m1$theta, link=log),data=data) summary(m2)
Why am I getting different outputs when using these models (
m1gives a $z$-value,
m2gives a $t$-value)? As far as I know they should do the same.
Why don't the results show the differences in abundance when there is quite a big difference? Am I using a wrong model? I see very different abundances using this code:
aggregate(data$Herbivores, by=list(Category=data$Treatment), FUN=sum)
Why is the $t$-value higher (positive) for Ploughed treatment than for Mowed treatment (negative $t$-value) when ploughed treatment has less abundance of Herbivores?