Statistical analyses
Generalized linear mixed-effects models (GLMM’s; Bates et al. 2015) were
used to investigate how the (a) species richness, (b) abundance, (c)
energy flux, and (d) relative energy flux (%) of whole-community and
individual trophic compartments (top-carnivores, mesocarnivores,
omnivores, and detritivores) changed over time (17 years). We nested
season within stream sites (Nuevo Berlín, Fray Bentos, and Las cañas) as
our random structure. We modeled species richness assuming
Poisson-distributed errors as is common in count data. Biomass and
energy flux were modeled assuming a negative.binomial distributed error
to account for data overdispersion.
Linear mixed-effects models were employed to determine the relationship
between energy flux and species richness, including whole-community and
individual trophic compartments (top-carnivore, mesocarnivore, omnivore,
and detritivore). We modelled the relationship between energy flux and
species richness on a log-log scale because this specification has
empirical supports in fish communities (Benkwitt et al. 2020). We nested
season within stream sites (Nuevo Berlín, Fray Bentos, and Las cañas) as
our random structure.
Structural equation models (SEM) were employed to address the direct and
indirect pathways by which human pressure, precipitation, N:P ratio, and
environmental variables affect the species richness and energy flux. We
test in SEM the influence of time on the causal effects of drivers on
diversity and energy flux (Fig. S5). We tested multicollinearity between
drivers by calculating the variance inflation factor (VIF). VIF
> 3 indicates possible collinearity, which was not observed
in our model. We constructed SEMs for trophic guilds separately, hence,
four SEMs were fitted: (i) top-carnivores, (ii) mesocarnivores, (iii)
omnivores, and (iv) detritivores. The SEMs were fitted using a linear
mixed-effect model in the piecewiseSEM package (Lefcheck 2016). We
present the standardized coefficient for each path and estimated. We
estimated the indirect effects of each driver on the energy flux
mediated by species richness. Specifically, the indirect effect was
estimated by multiplying the coefficient of each driver on richness by
the coefficient of richness on energy flux. The significance of all
paths was obtained using maximum likelihood and SEM fit was examined
using Shipley’s test of d-separation through Fisher’s C statistic (p
> 0.05 indicates an adequate model). All analyses were
conducted in R 3.4.4 (RStudio Team 2020).