1
$\begingroup$

I am getting acquainted with statistics and R and got stuck with my model. I am hoping someone could give me some insight on how to overcome overdispersion in generalized linear mixed models (GLMMs).

So, my model is trying to explain the variance in fungus infection in frogs using population density, air moisture (VPD), and track density around collection points. Because data was collected in different National Parks, I am assuming data is clustered and I added NP as random effect. There are 3 different spp and I am analyzing them individually, so that's why I have filtered the data.

Initially, this was my model:

Complete_Data_glmer1 <- glmer(cbind(n_infected, 
    Healthy) ~ track_density + VPD + 
           pop_density * species + 
           (1 | NP), family = "binomial", 
           data = Complete_Data)

I thought I should have species interacting with the predictors because the number of infected frogs varies according to species. It makes a lot of sense, but the overdispersion was huge, with residual variance around $600$ and degrees of freedom equal to $200$. So I decided to analyze the species separately. Now, this is my model:

Complete_Data_glmer1 <- glmer(cbind(n_infected, 
    Healthy) ~ track_density + VPD + pop_density + 
    (1 | NP), family = "binomial", 
    data = Complete_Data %>%                                              
    filter(species == "Taudactylus acutirostris"))

It works very well for one species, more or less for the second and not at all for the third. How can I fix this? Can I use a different model for each species? It doesn't make sense in my head.

Edit. at this point I think there is something wrong with the predictors I chose, so I created a matrix in R using the pairs() function. I am interested in analysing how the predictors affect the n_infected, but I don't really know how to interpret this matrix.

enter image description here

$\endgroup$
5
  • $\begingroup$ What is spp here? $\endgroup$ Commented Nov 2, 2023 at 0:53
  • $\begingroup$ oh, sorry Shawn. spp=species I am thinking that maybe I chose the wrong predictors, because the model seems to be right based on everything I have been researching and reading. Or maybe I am missing an interaction between the predictors but I also don't know how to check for that. I've created this in R but I am having trouble interpreting. It is the pairs functions with a smoother line. $\endgroup$
    – Denise
    Commented Nov 2, 2023 at 3:19
  • $\begingroup$ Thanks for clarifying. Please edit your plot into the question. $\endgroup$ Commented Nov 2, 2023 at 3:37
  • $\begingroup$ maybe of interest to you: stats.stackexchange.com/questions/160941/… An approach might be checking different models for each species and then comparing them using LRT and using that to justify that there are different behaviors among species $\endgroup$ Commented Nov 9, 2023 at 12:18
  • $\begingroup$ This question is hard to answer without the data. How do you check the goodness of fit of the species specific models? I think it's reasonable to start by splitting the data by species because what's the purpose of a badly fitting model for the three species together? Some of your predictors are numeric which means that you could try to relax the linearity assumption (using splines for example). $\endgroup$
    – dipetkov
    Commented Nov 12, 2023 at 14:51

0

Your Answer

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