2.6 Statistical analyses
We used generalized linear models (glm function within R v.3.5.1, R Core Team, 2018, running under R Studio v.1.2.5019, RStudio Team, 2019) to evaluate the effect of population (4 levels) on the variables measured in the field-collected samples of S. cataractae , and the effects of population (3 levels for C. purpureus ; 4 levels forS. cataractae ), treatment (2 levels: control vs Cd; control vs Cu) and their interaction on the variables measured in both species during the common garden experiments using the gamma distribution with the log link function in most cases (but see Table 1 for more details). The field samples and the four common garden experiments comprised the following datasets: i) Field samples: total concentrations of Cd and Cu in soil; total and relative concentrations of Cd and Cu, and plant length, leaf length, and leaf width in S. cataractae ; ii) Common garden: total and relative concentrations of Cd and Cu, and concentration of MDA in S. cataractae and C. purpureus ; protonemal growth in C. purpureus , and plant length, leaf length, and leaf width in S. cataractae . In the common garden, we compared the responses to each of the specific treatments (Cd enriched and Cu enriched) to the control conditions for each species.
We graphically inspected residuals of the models for any trends, and tested for normality and homoscedasticity using the functionsshapiro.test and leveneTest respectively. When these assumptions were not met, we tried other family distributions to model the response (inverse gaussian with log link, and gaussian with inverse link), used standardized variables (mean = 0, standard deviation = 1), or applied BoxCox transformations (Box & Cox, 1964) in order to improve the fit of the models (summarized in Table 1). Then we used the functionanova to test for the significance of the main effects of the models followed by multiple pairwise comparisons using the functionglht (multcomp package, Hothorn, Bretz, & Westfall, 2008) when the main effects were significant. Finally, all p-values were adjusted using the Benjamini & Hochberg (1995) method to obtain false discovery rates (FDR).
We used a Kruskal Wallis test to assess the effect of the treatment on the total concentrations of Cd and Cu in C. purpureus in the laboratory without accounting for the population effect due to the low number of replicates.