0
$\begingroup$

I'm looking at nesting differences between 3 species of fish. These fish nest in colonies (all 3 species intermix in the colonies), and measurements were taken at several different colonies throughout the lake. I am wanting to see how continuous variables such as nest depth vary between the 3 species. Depth also varies between colony, but I do not care about this difference. Is there a way I can investigate differences in nest depth between species, while controlling for the underlying differences in nest depth between colonies? Thanks!

$\endgroup$
0

1 Answer 1

1
$\begingroup$

ANOVA, ANCOVA and so on are basically tests based on regression models. So, if you can specify and fit a suitable a regression model, you can get what you describe there. In this case, I'd guess we are talking about a linear regression for depth (or perhaps log(depth), since depth cannot possible be negative, right? Although that then also implies relative depth difference such as a 10% deeper instead of absolute differences like 10 cm deeper), in which you allow a completely different depth for each colony (i.e. it's a categorical factor, that we would use dummy coded on) and then also for species relative to the depth of the colony.

In R syntax that could then look like lm( depth ~ 0 + factor(colony) + factor(species)) or lm( log_depth ~ 0 + factor(colony) + factor(species)). The syntax I used assumes you did not already declare in your dataframe or tibble that colony and species are categorical factors rather than numerical data, in which case you could omit the factor() around the variables. 0+ just means I don't want an intercept, but you could also get any comparisons you want if you had an intercept. Just about any other statistical software should be able to fit such a model, too. You'd be asking how much each species is off from the depth of the colony, you could argue that you're assuming that it's always to the same extent across all colonies or at least that you're asking for an answer as if that were the case (and it made sense to just average while controlling for the colony depth).

You can then look at the coefficients for the different species and/or ask for comparisons (each software will have its own ways of specifying what you want e.g. with the emmeans R package, with the LSMEANS statement in SAS etc.).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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