I'm trying to fit a model to ecological data for a behavioural study on termites, but encountered some problems. I did 79 experiments split between two castes (soldiers and workers) from 8 colonies across four sampling sites, investigating how aggression between different colonies might be linked to relatedness, their mating system and membership of a certain caste
I was thinking about fitting a Gamma GLMM with some complications, as outlined in the question here. @Robert Lang suggested I would try out a basic lm approach, which looks like this:
lm1 <- lm(rAi ~ meanW*Pairing + meanW*Costructure + Caste + YF , data = combdat)
rAi
as the response variable is a relative aggression index calculated by dividing the sum of different observed behaviours by the total amount of observations within each experiment. Pairing
is coded as is a two level factor, where 0 indicates tests between nestmates and 1 tests between non-nestmates. meanW is a numeric measurement of relatedness, Costructure
a factor of two levels, indicating whether a colony is polygamous or monogamous, and Caste
a factor of two levels, worker and soldier. YF represents the sampling site. meanW
is expected to vary within levels of Pairing, since one would expect members of one colony to be closer related to each other than to non-nestmates. The same is true for
Costructure`, since individuals of a polygamous colony should be less related to each other than members from a monogamous colony.
Call:
lm(formula = rAi ~ meanW * Pairing + meanW * Costructure + Caste +
YF, data = combdat)
Coefficients:
(Intercept) meanW Pairing1 Costructure1 Casteworkers YF8
0.06008 0.11531 0.01568 0.21814 0.04217 -0.03716
YF9 YF10 meanW:Pairing1 meanW:Costructure1
-0.02347 -0.07924 -0.39440 -0.39742```
Call:
lm(formula = rAi ~ meanW * Pairing + meanW * Costructure + Caste +
YF, data = combdat)
Residuals:
Min 1Q Median 3Q Max
-0.162777 -0.008750 -0.002083 0.012246 0.214506
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.060083 0.110546 0.544 0.58853
meanW 0.115310 0.264822 0.435 0.66461
Pairing1 0.015677 0.073618 0.213 0.83199
Costructure1 0.218142 0.095565 2.283 0.02554 *
Casteworkers 0.042170 0.009618 4.384 4.07e-05 ***
YF8 -0.037155 0.077335 -0.480 0.63243
YF9 -0.023466 0.075047 -0.313 0.75547
YF10 -0.079244 0.029907 -2.650 0.00998 **
meanW:Pairing1 -0.394404 0.698592 -0.565 0.57420
meanW:Costructure1 -0.397418 0.233490 -1.702 0.09324 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.04196 on 69 degrees of freedom
Multiple R-squared: 0.4612, Adjusted R-squared: 0.3909
F-statistic: 6.561 on 9 and 69 DF, p-value: 1.053e-06
Linearity and homoscedasticity assumptions could apparently not be met.
I tried transforming the response variable as well as meanW
with a variety of methods, but none seemed to improve the fit much
When looking at some explorative plots we see a trend of decreasing aggression with increasing relatedness especially for workers. This model seems to suggest differently though, or am I misreading it?
In the original question I described how Caste
seems to throw off the previously attempted gamma GLMM. Looking at these lm
results we can see a rather expected effect of workers
. This makes me think now: is there any way to specifically look into how any of these variables might influence aggression differently between the two castes?
Edit: As suggested by @Rober Lang I took out the two extreme values visible in most of the diagnostic plots, without them the diagnostics return like this: