2
$\begingroup$

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

enter image description here

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:

enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ I don't think they are too bad actually. There looks to be just 2 influential points that are messing up these diagnostics a little. I'm not saying you should remove them from your final model, but could we also see the diagnostics without those points (3 and 5 by the look of things) ? $\endgroup$ May 23, 2021 at 11:24
  • $\begingroup$ Just added it in. $\endgroup$
    – Leovar
    May 23, 2021 at 11:52
  • 1
    $\begingroup$ Well, for me, those plots are adequate and I would stick with the model on the full dataset. I guess you could try a gamma or beta glm and see if they have a better fit, or perhaps consider a tranformation. Perhaps someone else will have a different opinion.... $\endgroup$ May 23, 2021 at 12:06
  • $\begingroup$ I tried the glm and indeed, it does look a bit better. Now the question for me remains as to how I can see if there are differences in the effect of the predictor variables on the response between the two castes when analysing the combined data set, since the data exploration would suggest that there's a stronger effect of relatedness in workers compared to soldiers. Thank you again for your continued support, I think after looking at this for days my mind went a bit blank. $\endgroup$
    – Leovar
    May 23, 2021 at 13:40
  • $\begingroup$ You're welcome. I know the feeling :) I'll convert this to an answer, for completeness. $\endgroup$ May 23, 2021 at 13:49

1 Answer 1

2
$\begingroup$

The residual diagnostics are not perfect but neither are they terrible. The residuals seem to have heavy tails.

So the next approach may be to fit a GLM (beta or gamma).

To assess model fit you might try the usual diagnostics, but also predictive accuracy.

$\endgroup$
0

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.