I have a question about how to analyse my dataset and would really appreciate your advice.
My data consist of observations of a set of target plant species collected during field surveys. The surveys were not strictly standardized: observers walked through the study area and recorded species when encountered. Therefore, the dataset mainly contains presence records.
In terms of structure, the dataset includes:
- SPECIESCODE: species identity
- Code: sampling unit (there are only two distinct codes, corresponding to two survey areas)
- Management intensity: Extensive, No management, Moderately intensive, Intensive
- R10: raster cell (10 m × 10 m grid) in which the observation was located
- Abundance: number of individuals recorded per observation (if two of the same species were present in the same R10, then the max abundance was taken)
Each row corresponds to a species observation within a given sampling unit, management type, and raster cell.
The goal is to estimate the preference per species per management intensity. That is why I transformed my data into a presence–absence format by assuming that if a species was not recorded within a given sampling unit (Code + management), it was absent.
data_full_heide <- data_full_heide %>%
mutate(presence = 1) %>%
complete(
SOORTCODE,
nesting(Code, management), #nesting met R10 needed?
fill = list(presence = 0)
)
Then I performed a logistic regression, with code as fixed variable instead of a random variable because it consists of only two categories.
model <- glmer(
presence ~ management + Code + (1 | SOORTCODE),
family = binomial,
data = data_full_heide
)
But how can I now test the individual preference per species? Do I conduct a GLM per species? But this gives very high standard errors and many p-values are not significant.
glm_per_species <- data_full_heide %>%
group_by(SOORTCODE) %>%
group_modify(~ {
mod <- glm(
presence ~ management,
family = binomial,
data = .x
)
broom::tidy(mod)
})
Let me know if you need additional information!
SOORTCODE | Code | management | R10 | abundance:
carexpan | A | mid | 105 | 12
carexpan | A | mid | 106 | 8
carexpan | B | extensive | 210 | 3
carexnig | A | mid | 107 | 5
carexnig | B | no management | 305 | 2