Statistical analysis
To understand how resource flows affected function and biodiversity in meta-ecosystems, we performed statistical analysis using mixed-effect models with the ’glmmTMB’ (for Tweedie distributions, Mollie et al., 2017) and ’lme4’ (for normal distributions, Bates et al., 2015) packages in R. The analysis did not include the initial two time points before the disturbances (grey zones in all figures), as they are not related to the understanding of the effects of disturbances and resource flows.
At the meta-ecosystem level, to examine resource flow effects, we compared connected and unconnected meta-ecosystems for each meta-ecosystem type (autotrophic-dominated, heterotrophic-dominated, and equally-dominated). To test the influence of relative patch size and the resource flow connection on total biomass, we examined the effects of the resource flow connection and its interaction with relative patch size in a mixed effect model where random effects were time and baseline (response variable at the time point before the first disturbance) using analysis of deviance. As we set the distribution of biomass as a Tweedie distribution, which considers distribution to be bound to positive numbers (biomass cannot be negative) and to have a spike at zero (when both patches’ biomass crashes), we performed an analysis of deviance, which can handle Tweedie assumptions (non-normality, zero inflation, and overdispersion). Next, we performed a post hoc Tukey test with the package ‘emmeans’ (Lenth, 2022) in R to see in which meta-ecosystems resource flows affected total biomass by comparing connected to unconnected scenarios for each meta-ecosystem type. Finally, also using a post hoc Tukey test, we compared the biomass among meta-ecosystems types, when they are connected and when they are unconnected.
At the local level, we investigated whether patch size and its interaction with the connection via resource flows influenced response variables (biomass density, Shannon Index, median body size) by constructing two identical models: one for heterotrophic patches (i.e.,SHLA , SH , MHMA ,MH , LHSA , and LH ) and one for autotrophic patches (i.e., SALH , SA ,MAMH , MA , LASH , andLA ). In each of these two models, we examined the effects of the interaction between resource flow connection and patch size in a mixed effect model where random effects were time and baseline (response variable at the time point before the first disturbance) using analysis of deviance as above. Next, to understand the effects of this interaction, as above, we performed an analysis of deviance for biomass density and median body size (we set distribution as Tweedie) and an analysis of variance (ANOVA) for Shannon Index (we set distributions as normal). Next, as also above, using a Tukey test we saw in which patches the connection via resource flows had an effect (comparing in heterotrophic patches SHLA to SH ,MHMA to MH , andLHSA to LH and in autotrophic patchesSALH to SA , MAMH toMA , and LASH to LA ), and whether size had an effect in unconnected patches (comparing in heterotrophic patches SH to MH and SH to LH and in autotrophic patches SA to MA , and SA to LA ).