I am trying to run a model that incorporates both environmental variables
and taxonomic relationships, and I am unsure if I am 1) specifying the
error term correctly, and 2) accounting for unbalanced data correctly. I
would appreciate any guidance you can provide.

As a simplified example, I want to ask if a bird is more likely to be
carrying ticks based on the habitat it was caught in, and what kind of bird
it is (my actual model has many more environmental variables). We have many
related species in multiple genera in multiple families, but all in the
same order. Species is nested within genus, and genus is nested within
family. I want to estimate a fixed effect for both habitat and species,
while accounting for the nestedness of the relationships of the birds, and
I also want to account for the fact that we caught more of certain species
than others.

My simplified model looks like this:

M1 <- lmer(y ~ HABITAT + SPECIES + (1|FAMILY/GENUS/SPECIES),
family=binomial(link="logit"))

where y is a column vector of (tick presence, tick absence)


So my questions are: is this the correct "grammar" for the nested error?
and does the nested error structure by itself take into account the
unbalanced data structure?

Thank you in advance for your time.

Sincerely,

Erica Newman

	[[alternative HTML version deleted]]

