Reputation: 1
I Want to use the dependent variable "Herps" (count data) to understand what response variables are important influencing herpetofauna species richness. The response variables include Total_Saplings, Total_Understorey_Vegetation, Mean_Leaf_Litter_Depth, Mean_Canopy_Openess, Tree_Species_Richness, Mean_DBH, Large_Trees, Total_Basal_Area, Aguada_Distance_Category, and I want to include "Year" as a random variable.
I've not used R before, and this is a steep learning curve for myself. I appreciate any help offered. Thanks
Hi. So I've tried using a couple of codes myself but I don't seem to be getting anywhere, some of these codes include:
1)
AllHerpsRichness <- glmulti(Rich_All_Herps ~ Total_Saplings * Total_Understorey_Vegetation * Tree_Species_Richness +
Mean_DBH * Total_Basal_Area * Mean_Canopy_Openess *
Mean_Leaf_Litter_Depth * Aguada_Distance_Category *
Camp * (1|Year), data=Habitat,
level=1, fitfunction=glm, crit="aicc",
confsetsize=256, family="poisson")
but I get the error
Error in Total_Saplings + Total_Understorey_Vegetation + Tree_Species_Richness + :
non-numeric argument to binary operator
AllHerpsRichness <- lmer(Rich_All_Herps ~ Total_Saplings * Total_Understorey_Vegetation *
Tree_Species_Richness * Mean_DBH +
Total_Basal_Area * Mean_Canopy_Openess *
Mean_Leaf_Litter_Depth * Aguada_Distance_Category * Camp *
(1|Year),
data=Habitat)
but I receive the error
boundary (singular) fit: see help('isSingular')
AllHerpsRichness <- lmer(Rich_All_Herps ~ Total_Saplings * Total_Understorey_Vegetation *
Tree_Species_Richness * Mean_DBH +
Total_Basal_Area * Mean_Canopy_Openess *
Mean_Leaf_Litter_Depth * Aguada_Distance_Category *
Camp * (1|Year),
data=Habitat)
but the error
boundary (singular) fit: see help('isSingular')
Warning message:
In glmer(Rich_All_Herps ~ Total_Saplings * Total_Understorey_Vegetation * :
calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is deprecated; please call lmer() directly
I'm not sure if either one of these codes I've already tried is right, but does anyone know how I can fix one of them to try and get some outputs.
Upvotes: 0
Views: 726
Reputation: 226732
glmulti
handles random effects, and 'multiplying' (*) by (1|Year)
would break things anyway.?lme4::isSingular
, or the relevant section in the GLMM FAQ.family = gaussian
?We would need more details to give you more advice, and the question might be better suited for CrossValidated, but I would suggest:
glmer(Rich_All_Herps ~ Total_Saplings + Total_Understorey_Vegetation +
<... more covariates ... > + Camp + (1|Year),
data=Habitat,
family = poisson)
as a start, because:
lme4::glmer.nb
or switch to glmmTMB
)(1|Year)
are always added, not multiplied by, other covariates in the formulan
covariates requires 2^n
parameters)choose(n, 2) + n + 1
parameters)Harrison, Xavier A. 2014. “Using Observation-Level Random Effects to Model Overdispersion in Count Data in Ecology and Evolution.” PeerJ 2 (October): e616. https://doi.org/10.7717/peerj.616.
Upvotes: 2