Simulated data was generated in part with R code (see file "Behavior of PL metric (Supplementary Materials 2)" ) and in part from simulations taken from Albecker et al. 2022. To create those simulations, we performed the following:
We created simulations that mimicked experimental data, and provided an array of scenarios to understand how effect size, presence of GxE, total sample size, experimental design, and variability affected CovGE, as well as the ability to detect and measure these patterns. We simulated datasets with total sample sizes (number of environments × number of genotypes × sample size) between 32 and 500 individuals. For reciprocal transplant data, we simulated genotypic effects that increased linearly at rate γ along an environmental variable (e) for genotypes equally spaced from environment j = [1, 2,... nenv]. We generated unitless phenotypic data based on the equation: In this equation, the phenotype of individual k from genotype i in environment j is given by the genotypic effect (intercept, (i − 1) × γ), the reaction norm (where ej is the value of the environment and β is the slope of the reaction norm), an interaction term for genotype i in environment j (ηij) that describes the deviation of the reaction norm from linearity, and error (εijk). When ηij = 0, GxE is absent. When γ = 0 (i.e. when Vp = VE + VGxE, Equation 1), β = 0 (i.e. Vp = VG + VGxE, Equation 1), or ηij is large, CovGE is absent. Interaction terms (ηij) were drawn from a normal distribution with mean of zero and variance equal to the number of genotypes. Random error (εijk) was added by sampling from a normal distribution with a mean of zero and standard deviation of either 0.5 (low residual variation) or 1 (high residual variation). Scenarios with no random error (εijk) were used to assess population parameters (see file "Supplemental Materials 1", figure 3). For common garden designs, we adjusted this approach to model designs in which different numbers of genotypes were reared in two common environments (see file "Supplemental Materials 1", figure 4, panel c). We generated a single phenotypic reaction norm for each group of genotypes (i.e. genotypes native to the same environment) based on the first terms of Equation 4 (e.g. (i − 1)γ + βej). Then we generated reaction norm data for individual genotypes by adding the interaction term (ηij) and error (εijk) to the overall reaction norms.