*2.4. Statistical Analysis*

Statistical analyses were performed in the R software 3.4.4 (R Core Team, Vienna, Austria) [49] using the R packages "readxl", "gdata", "MuMIn", "mgcv", "reshape2", "tiff", and "nlme". Linear models (lm) were used to identify the key predictors of fish abundance and fish family richness and of coral cover and coral genus richness. For overall fish abundance and fish family richness (i.e., the number of fish families recorded), we tested the proportional cover of the main substrate variables, "macroalgae", "turf algae", "herbivorous invertebrates", "seagrass" and "coral", as predictor variables. For coral cover and coral genus richness (i.e., the number of coral genera recorded) we used the same substrate variables, "macroalgae", "turf algae", "herbivorous invertebrates", and "seagrass", and also "fish abundance", and "fish family richness" were tested as predictor variables. The herbivorous invertebrate data was *logn*+<sup>1</sup> transformed (as is often done with zero biased data) in order to increase linearity between predictor and response variables and to increase normality of model residuals. To evaluate the support for different combinations of predictor variables, the dredge-function of the "MuMIn" R package was used. For each model, the Akaike Information Criterion (AIC) was derived, which evaluates models based on model fit and model complexity [50]. As the sample size was relatively low compared to the number of estimated parameters, the AIC with a second-order bias correction (AICC) was used. Using AICC-based model selection, the best linear models were selected for explaining fish abundance, fish species richness, coral cover, and coral genus richness. The best model was considered to be the one with the lowest AICC ranking [50].
