0
$\begingroup$

Someone reccomended me to use GLMM instead of GLM for the data I used for the manuscript.

My data corresponds to transects in which I have counts of individuals of a species in several points along those transects and i wanted to relate those counts to environmental variables. They reccommended me to use the total number of individuals of the transect as a random effect. Something similar to this: glmer(Number of individuals in one plot ~ elevation + aspect +(1 | Number of individuals of the whole transect), family = poisson, data=data).

The problem is that if I use the Number of individuals of the whole transect as a continuous variable, R studio says in its summary that there are 36 groups. If I correctly understood, these means that the data contains for that variable 36 possible different numbers. I'm not sure if the program is considering it as a categorical variable.

That is why I thought in transforming the variable to categorical. I divided the maximum number of individuals of the whole transect (111) by three, to obtain three categories, Low, Medium and High, if the values were under 37, between 37 and 74 or >74 respectively. In this case, the summary says there are only 3 groups.

The question is: can I just use the continuous data despite the summary says there are 36 groups? Is it not considering it as categorical variable in that case? If so, Is the conversion I did to a categorical variable correct?

Thanks

$\endgroup$
5
  • $\begingroup$ It's helpful to provide your code. It sounds like what was really recommended to you was using transect as a random effect, not the number of individuals in that transect. This would make much more sense, because what a random effect for transect would do is basically exactly what you want: estimate a mean for each transect and then only model the variation around that mean with the environmental covariates. $\endgroup$
    – stefgehrig
    Commented May 28, 2020 at 16:09
  • $\begingroup$ Thanks for your answer! What do you mean exactly with "transect"? The name of each transect as categorical variable? $\endgroup$
    – BAdm
    Commented May 28, 2020 at 16:19
  • $\begingroup$ First I just performed Spearmen correlations between number of individuals and environmental variables. Then they suggested me that number of individuals in each plot was probably not independent from the rest of the individuals of the transect. Then, they reccomended me to perform GLMMs using the "plot nested within transect as a random effect". I'm not sure what exactly that means, and I thought it was refering to the total number of individuals along the transect. $\endgroup$
    – BAdm
    Commented May 28, 2020 at 16:25
  • $\begingroup$ If you have a nested design with multiple measurements within multiple plots within multiple transects, than the nested random effect can be a reasonable choice (if your dataset is large enough to estimate them more or less reliably). Yes, indeed you would use plot ID and transect ID as categorical variables in your model. I recommended this resource as an introduction to random effect models for use cases in ecology: peerj.com/articles/4794 $\endgroup$
    – stefgehrig
    Commented May 28, 2020 at 16:34
  • $\begingroup$ Thanks for your help! Very interesting article $\endgroup$
    – BAdm
    Commented May 28, 2020 at 16:46

0

Your Answer

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

Browse other questions tagged or ask your own question.