I have a set of data that contain two separate species placed in 4 habitat types. One of the species has 10 less organisms than the other for a particular habitat and I was hoping to account for the unequal sizes by using an offset() code. However, I am having trouble determining which data to input within the offset() to account for the difference.
The data is arranged by cages with 10 specimens in each and labeled with a coordinating letter for habitat and number for cage/species ID (odds are species 1 and evens are species 2). nStart is the initial amount of specimen/cage and is linked to each habitat and cage. Am I wrong in thinking that "+ offset(nStart)" will account for the missing cage? Also, does "+ offset(log(nStart))" only work for negative binomials? Thanks! Any input is appreciated
| Habitat | Cage || nStart | | I | 6 || 10 | I | 7 || 10 | L | 6 || 10 | O | 7 || 10 | O | 8 || 10
Model survival code:
Model <- glmer(cbind(nAlive,nDead) ~ Species*Habitat+ (1|Cage), data=CleanData, family="binomial")
I have tried this
Model <- glmer(cbind(nAlive, nDead) ~ Species*Habitat + offset(nStart) + (1|Cage), data=CleanData, family="binomial")
Model Infestation Code:
Model1 <- glmer(Lice01 ~ Species*Habitat+(1|Cage), data = JulyData, family="binomial") `` and I have tried this:
Model1 <- glmer(Lice01 ~ Species*Habitat+ offset(nStart) + (1|Cage), data = JulyData, family="binomial")
but still not convinced.