1
$\begingroup$

Let's say I'm measuring the occurrence of yellow or blue beetles at 8 sites in a study area, and I selected these sites such that 4 are on the edges of lakes, and 4 are in meadows. I'm testing to see if there is a difference between lakes and meadows for dominant beetle colour.

So, I can approach this like a normal chi-squared test: come up with the frequency of blue beetles near lakes and in meadows, then compare to see if there's a meaningful difference between these two.

But, what if it turns out there are other properties of the sites that could predict whether beetles are more likely to be blue or yellow, other than the site's location in a meadow or on a lake edge. How do I test for independence between sites while also testing for independence between treatments (lake vs meadow)? In other words, how can I control for possible (real) differences between sites while also testing for differences between lakes & meadows?

I can't find a good way to do this without doing two consecutive tests - and therefore having to risk an increased chance of a false positive.

$\endgroup$

1 Answer 1

1
$\begingroup$

I think you're looking for a multilevel logistic regression.

Multilevel = nested data Logistic = meaning dependent variable is binomial either 0 or 1. In your case blue or yellow.

R's lme4 package can do this for you for free. Learning how to interpret/ set it up is another story.

I found some good resources from some universities' stats department online.

The output of this model will be able to tell you the overall effect of the nesting variables (lake etc).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.