Introduction

The advent of the digital age has allowed the development of genetic analyses for complex data. Despite advances in hardware, scalable software remains an issue. This is particularly true of mixed model software, which is largely built on methods from twenty-five or more years ago. The underlying algorithms that are used restrict the speed of analysis, and the size of the problem can prevent a full single stage analysis.

Crop improvement programs usually involve trials being run in multiple environments (METs) because genotype or variety by environment (GE or VE) interaction is likely to be substantial, and recommendations on the use of specific varieties may therefore need to be environment specific. In analyzing such sets of trials, it is preferable to use single stage methods, usually based on mixed models; see the first paragraph of the introduction in Piepho et al. (2012). Single stage methods have been proposed by many authors and examined for optimality, for example see Smith et al. (2001b) and Welham et al. (2010). These methods typically rely on factor analytic models and can be computationally expensive. Two-stage methods however, in which each trial is analyzed separately, and the results combined in some manner (Smith et al. 2001a; Piepho et al. 2012; Gogel et al. 2018) are simpler to use and faster. However, there is a loss of information and hence efficiency, provided the single stage approach is based on the “correct” model. The issue of two-stage analysis with weighting has been discussed by a number of authors (Mohring and Piepho 2009; Damesa et al. 2017, 2019; Buntaran et al. 2019; Endelman 2023).

Both Piepho et al. (2012) and Gogel et al. (2018) show that a two-stage approach that uses fixed genetic effects at the first stage of analysis, is exactly equivalent to the single stage approach if variance parameters are known, and a known full weight matrix is carried forward to the second stage. Variance parameters are not known, and for the case of fixed genetic effects at the first stage of analysis, Gogel et al. (2018) quantify the information loss in using a two-stage approach through dissection of the residual likelihood used for estimating the unknown variance parameters.

Genetic effects are usually assumed to be random. In animal breeding, this is necessary because replication is not possible (except for clones). For genomic prediction in animal breeding, Garrick et al. (2009) develop so-called de-regression. Random genetic effects are predicted or estimated at the first stage, and then transformed or de-regressed for use in genomic prediction. De-regression is in fact returning the best linear unbiased predictions (BLUPs) to best linear unbiased estimates (BLUEs), as is shown in this paper. Garrick et al. (2009) consider individual BLUPs, rather than the full vector, and a diagonal weight matrix is used at the second stage of analysis for genomic prediction. This is a special case of the more general mixed effects two stage analysis presented in this paper. This approach is called random plus de-regression in this paper.

For partially replicated trials (Cullis et al. 2006), Gogel et al. (2018) state on page 6 of their paper, that using single stage analysis is preferred. It might be conjectured that using random plus de-regression at the first of a two-stage process, might be preferable to starting with fixed genetic effects as in Piepho et al. (2012) and Gogel et al. (2018). This approach is examined and formalised in this paper, and ultimately uses the approach given by Smith et al. (2001a) for practical application.

Two examples are used in this paper to illustrate the approaches and to compare various two-stage methods and a one-stage method. The two data sets examined were a barley breeding MET with 24 trials (environments) and replicated lines (at least 2), and a MET for 4 trials in a wheat variety trial in which partial replication was used. The approaches that use either fixed or random plus de-regression genetic effects are presented. The results of analysis of both data sets are presented. In animal breeding, animals cannot be replicated, and genetic effects need to be assumed random. A relationship matrix is required for analysis. With partially replicated designs (Cullis et al. 2006) of low replication, it seems intuitively clear that using fixed genetic effects at the first stage will be problematic, even with an optimal design. A small simulation study is presented to illustrate that at the first stage, it is preferable to use random genetic effects, and then convert these to best linear unbiased estimates through de-regression, for use at the second stage. Discussion and conclusions complete the paper.

Examples

Barley stage 3 variety selection trials

Multi-environment trials were conducted by the South Australian Barley Program in 2006 and 2007. A total of 24 Stage 3 trials were grown over the two years. The designs for all trials were randomised complete blocks, with two or three blocks and hence two or three replicates of the varieties. The details of each trial are given in Table 1. The number of common lines within the two years is approximately 180, while between years there are approximately 50 lines for each pair of trials. A total of 322 lines were used in the trials. No pedigree or genomic information is available. The trait of interest is yield. Note the mean yields (in tonnes/hectare) are highly variable reflecting the multi-environment nature of the trials. The aim of the trials was promotion of lines to stage 4 trials, and hence best linear unbiased predictions of variety by environment effects are required, to enable selection of varieties.

Table 1 Barley trial information: name of the trial, layout (number of rows and columns), number of varieties at each site, number of missing values and the mean yield for each site

Multi-site p-rep yield trials

A series of wheat variety trials were conducted at 4 sites over 2 years, sites 1 and 2 in year 1 and sites 3 and 4 in year 2. The layouts (rows,columns and blocks), the number of varieties in each trial and the proportion that are replicated, the number of missing values and mean yield (the trait of interest, tonnes/hectare) are given in Table 2. A simple initial randomised block design of 2 blocks (Reps) was used for all trials. Additional blocking with 2 blocks within each Rep, was included in the first year, while in the second year, further blocking was based on the level of phenology (flowering time), classified into 3 classes. Within each Rep, there were 6 blocks, each phenology class being replicated. As pointed out by a reviewer, blocking on phenology might be an issue, as randomisation of lines is compromised by the likely presence of a genetic component for phenology traits, and hence estimated variance components may be biased.

The trials were designed using partial replication of lines, although the replication rate is fairly high. There were 943 lines in total with 25 standard or commercial lines used in the trials. The concurrence of lines across sites varied from 482 to 616.

Table 2 p-rep trial information: name of the trial, layout (number of rows, columns, Reps, blocks and the configuration for each Rep and block), number of varieties at each site, level of partial replication (P-rep), number of missing values and the mean yield for each site

As for the barley trials, the aim was selection of varieties, using best linear unbiased prediction.

Simulation study: multi-site p-rep

A small simulation study was conducted to investigate two-stage methods for p-rep or partially replicated designs. In the simulation study, data was generated for four sites, and three levels of partial replication were examined, namely 50%, 20% and 10% replication of the total of 480 lines. The simulated trials consisted of 24 columns and 30, 24 and 22 rows for the three replication rates (50, 20 and 10%) respectively. The replicated lines were assigned to 6 blocks (of 4 columns) in a balanced incomplete block design for all scenarios, using find.BIB from the crossdes R package (https://CRAN.R-project.org/package=crossdes). In the case of 50% replication, allocation of replicated lines was balanced over sites. For the lower replication rates, different replicated lines appeared at each site. Non-replicated lines were allocated to each block at random. An optimal row(-column) BIB design was then constructed using odw (Butler and Cullis 2022) using the tabu+rw option for each site. For a discussion of design of plant breeding experiments, including p-rep designs, see Piepho et al. (2021).

For each simulation, the model used consisted of fixed site means, random Block, Row and Column effects and a spatial ar1 \(\times\) ar1 (Gilmour et al. 1997) residual model. The parameters used are given in Table 3.

Table 3 Parameter values for all simulations, Mean(s) are fixed effects, and the remaining effects are random.

The variance matrix for genetic effects for sites was (with correlations below the diagonal)

$$\begin{aligned} {\textbf{G}}_e = \left[ \begin{array}{cccc} 0.150 &{} 0.027 &{} 0.120 &{} 0.060 \\ 0.100 &{} 0.500 &{} 0.082 &{} 0.383 \\ 0.800 &{} 0.300 &{} 0.150 &{} 0.150 \\ 0.200 &{} 0.700 &{} 0.500 &{} 0.600 \end{array} \right] \end{aligned}$$
(1)

All designs were generated using the variance components and parameters for each site so that the designs are optimal for the simulations.

The aim of the simulation study was to compare 5 approaches, namely, the one-stage, the two-stage analysis using fixed or random plus de-regression variety effects at the first stage, and subsequently using the full weight matrix and diagonal weights at the second stage. Using an unstructured variance matrix for the site genetic variance matrix resulted in convergence issues. Thus a factor analytic model (of order 1) was used for the analysis in all the simulations across all methods.

The approaches were compared using mean square error of prediction (MSEP) of the predicted random variety effects for the five approaches, with the simulated true variety effects for each scenario. The mean and standard deviation of the MSEP were also calculated as an overall summary over the 100 simulations for each scenario. Thus for simulation i, the 1920 (480 varieties \(\times 4\) sites) effects were used to find the MSEP, namely

$$\begin{aligned} \text{ MSEP}_i = \frac{\sum _{j=1}^{1920}(u_{ij} - \hat{u}_{ij})^2}{1920} \end{aligned}$$
(2)

and subsequently the mean and standard deviation of the MSEP was calculated over the 100 simulations. In addition, counts of the ranking of the 5 approaches on \(\text{ MSEP}_i\) (smallest 1 to worst 5) over the 100 simulations were found.

Methods

Models

Piepho et al. (2012) and Gogel et al. (2018) provided details of the one-stage analysis for MET data. Suppose we have t environments. Let \({\textbf{y}}_j\) be the \(n_j\times 1\) vector of observations for environment j, \(j=1,2,\ldots ,t\). A mixed model forms the basis of analysis, and for each environment

$$\begin{aligned} {\textbf{y}}_j = {\textbf{X}}_j \varvec{\tau }_j + {\textbf{Z}}_{gj} {\textbf{u}}_{gj} + {\textbf{Z}}_{oj} {\textbf{u}}_{oj} + {\textbf{e}}_j \end{aligned}$$
(3)

where the four terms on the right-hand side of (3) represent fixed effects, genetic effects (typically a random effect), other random effects (hence o) and the residual. The fixed effects typically include a mean effect for the environment, and may also include global trends for that environment. The “other” random effects \({\textbf{u}}_{oj}\) typically contain design (blocking) effects, and where required global and extraneous effects. Lastly, the residual effects often allow for spatial variation for that site. All these aspects are discussed by Gilmour et al. (1997), and the examples provide details on terms that appear in the (3) and the models developed below.

The genetic effects \({\textbf{u}}_{gj}\) will vary in dimension in most cases, unless all varieties are the same for each environment or trial. Let \(n_{gj}\) be the number of varieties in environment j.

For a succinct presentation, the models (3) are put together into a single model. Thus if \({\textbf{y}} = ({\textbf{y}}_1^T,{\textbf{y}}_2^T, \ldots , {\textbf{y}}_t^T)^T\) is the vector of responses across all environments, and the full data set has \(n=\sum _{j=1}^t n_j\) observations, the combined mixed model is

$$\begin{aligned} {\textbf{y}} = {\textbf{X}} \varvec{\tau } + {\textbf{Z}}_{g2} {\textbf{u}}_{g2} + {\textbf{Z}}_o {\textbf{u}}_o + {\textbf{e}} \end{aligned}$$
(4)

where the design matrices are all block diagonal, with the diagonal blocks being the design matrices in (3), and the vectors are concatenations of the vectors of effects in (3). The effects \({\textbf{u}}_o\) and residual vector \({\textbf{e}}\) are independent, with \({\textbf{u}}_o \sim N({\textbf{0}}, {\textbf{G}}_o)\) and \({\textbf{e}} \sim N({\textbf{0}}, {\textbf{R}})\). The variance matrices \({\textbf{G}}_o\) and \({\textbf{R}}\) are block diagonal, so that non-genetic and residual effects are also environment specific. The labelling for the genetic effects includes a subscript 2, and this denotes the form that would be appropriate in a two-stage analysis.

One-stage analysis for MET data

In a one-stage analysis, the model specification is

$$\begin{aligned} {\textbf{y}} = {\textbf{X}} \varvec{\tau } + {\textbf{Z}}_{g} {\textbf{u}}_{g} + {\textbf{Z}}_o {\textbf{u}}_o + {\textbf{e}} \end{aligned}$$
(5)

where the non-genetic effects match those in (4), but the genetic effects are such that all varieties are represented at all environments. This allows prediction of all varieties at all environments, even if particular varieties were not in a particular trial. In (5), the genetic effects are assumed \({\textbf{u}}_g \sim N({\textbf{0}}, {\textbf{G}}_g)\), where \({\textbf{G}}_g = {\textbf{G}}_e \otimes {\textbf{I}}_{n_g}\), where \({\textbf{G}}_e\) is the covariance matrix for the environments. Thus here, the lines are assumed unrelated, because no pedigree or genomic information is available. The methods can be modified easily, if such information is available. In that case, multiple terms would be required in plant trials with replicated lines.

Note that

$$\begin{aligned} {\textbf{Z}}_g = {\textbf{Z}}_{g2} {\textbf{D}} \end{aligned}$$
(6)

for a block diagonal matrix \({\textbf{D}}\), and where this matrix pads out \({\textbf{Z}}_{g2}\) with zero columns for those varieties not observed at a particular site.

Let \(\boldsymbol {\epsilon } = {\textbf{Z}}_o {\textbf{u}}_o + {\textbf{e}}\). The variance matrix is \({\textrm {var}}\;{\boldsymbol{\epsilon }} = {\textbf{V}} = {\textbf{Z}}_o {\textbf{G}}_o {\textbf{Z}}_o^T + {\textbf{R}}\). The mixed model (5) can then be written as

$$\begin{aligned} {\textbf{y}} = {\textbf{X}} \varvec{\tau } + {\textbf{Z}}_g {\textbf{u}}_g + \boldsymbol {\epsilon } \end{aligned}$$
(7)

The mixed model equations for estimation of fixed effects and prediction of random effects are

$$\begin{aligned} \left[ \begin{array}{cc} {\textbf{X}}^T {\textbf{V}}^{-1} {\textbf{X}} &{} {\textbf{X}}^T {\textbf{V}}^{-1} {\textbf{Z}}_g \\ {\textbf{Z}}_g^T {\textbf{V}}^{-1} {\textbf{X}} &{} {\textbf{Z}}_g^T {\textbf{V}}^{-1} {\textbf{Z}}_g + {\textbf{G}}_g^{-1} \end{array} \right] \left[ \begin{array}{c} \hat{\mathbf {\tau }} \\ \tilde{{\textbf{u}}}_g \end{array} \right] = \left[ \begin{array}{c} {\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{y}} \\ {\textbf{Z}}_g^T{\textbf{V}}^{-1}{\textbf{y}} \end{array} \right] \end{aligned}$$
(8)

Define

$$\begin{aligned} {\textbf{H}}= & {} {\textbf{V}} + {\textbf{Z}}_g {\textbf{G}}_g {\textbf{Z}}_g^T \end{aligned}$$
(9)
$$\begin{aligned} {\textbf{P}}= & {} {\textbf{H}}^{-1} - {\textbf{H}}^{-1}{\textbf{X}} ({\textbf{X}}^T{\textbf{H}}^{-1}{\textbf{X}})^{-1}{\textbf{X}}^T{\textbf{H}}^{-1} \end{aligned}$$
(10)

The conventional estimate of \(\varvec{\tau }\) and best linear unbiased prediction of \({\textbf{u}}_g\) are given by

$$\begin{aligned} \hat{\varvec{\tau }}= & {} ({\textbf{X}}^T {\textbf{H}}^{-1} {\textbf{X}})^{-1} {\textbf{X}}^T {\textbf{H}}^{-1} {\textbf{y}} \end{aligned}$$
(11)
$$\begin{aligned} \tilde{{\textbf{u}}}_g= & {} {\textbf{G}}_g {\textbf{Z}}_g^T {\textbf{P}} {\textbf{y}} \end{aligned}$$
(12)

Let \({\textbf{X}} = [{\textbf{X}}_e\; {\textbf{X}}_o]\) and \(\varvec{\tau } = [\varvec{\tau }_e^T\; \varvec{\tau }_o^T]^T\) be a partition of the fixed effects design matrix and parameter vector into site or environment means (indexed by e) and other fixed effects (indexed by o). The examples present terms that appear in the other fixed effects. Note that

$$\begin{aligned} {\textbf{X}}_e = {\textbf{Z}}_g {\textbf{D}}_e \end{aligned}$$
(13)

where \({\textbf{D}}_e\) is a diagonal matrix whose diagonal blocks are simply a vector of unities of length the number of varieties in the corresponding environment. The matrix \({\textbf{D}}_e\) appears in the model for the second stage in a two-stage analysis. The other fixed effects can be eliminated from the mixed model equations to form the reduced mixed model equations

$$\begin{aligned} \left[ \begin{array}{cc} {\textbf{X}}_e^T {\textbf{S}}_o {\textbf{X}}_e &{} {\textbf{X}}_e^T {\textbf{S}}_o {\textbf{Z}}_g \\ {\textbf{Z}}_g^T {\textbf{S}}_o {\textbf{X}}_e &{} {\textbf{Z}}_g^T {\textbf{S}}_o {\textbf{Z}}_g + {\textbf{G}}_g^{-1} \end{array} \right] \left[ \begin{array}{c} \hat{\mathbf {\tau }}_e \\ \tilde{{\textbf{u}}}_g \end{array} \right] = \left[ \begin{array}{c} {\textbf{X}}_e^T{\textbf{S}}_o{\textbf{y}} \\ {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{y}} \end{array} \right] \end{aligned}$$
(14)

where

$$\begin{aligned} {\textbf{S}}_o = {\textbf{V}}^{-1} - {\textbf{V}}^{-1}{\textbf{X}}_o ({\textbf{X}}_o^T{\textbf{V}}^{-1}{\textbf{X}}_o)^{-1}{\textbf{X}}_o^T{\textbf{V}}^{-1} \end{aligned}$$
(15)

allows for the elimination of \(\varvec{\tau }_o\). Note that using (9), (15) and the Sherman–Morrison–Woodbury formula, (10) can be written as

$$\begin{aligned} {\textbf{P}} = {\textbf{S}}_o - {\textbf{S}}_o {\textbf{Z}}_g ({\textbf{Z}}_g^T {\textbf{S}}_o {\textbf{Z}}_g + {\textbf{G}}_g^{-1})^{-1} {\textbf{Z}}_g {\textbf{S}}_o \end{aligned}$$
(16)

which will be used to connect one and two-stage methods.

Note that in Gogel et al. (2018), their Eq. (3) is not correct as it is missing a term on the right-hand side.

Two-stage analysis of MET data

There are two important components of a two-stage analysis. The first component is that the estimated effects taken forward to the second stage of analysis must be unbiased for the effects of interest. This means that at the end of stage one, best linear unbiased estimates and hence fixed effects estimates are required. The second component is a weight matrix (or weights). This is required because estimates are taken as the response in the stage two model, and estimates have an error associated with them. The weight matrix depends on non-genetic variance parameters and these are estimated at the first stage of analysis. It might be better to estimate the non-genetic variance components in an extra step in the first stage of analysis, using a model with random genetic effects. But the resulting predicted genetic effects are biased, and hence an additional step to convert (de-regress) these to fixed effects is required, that is, random plus de-regression as noted earlier.

The following sub-sections consider the stage one analysis starting with fixed genetic effects, and alternatively starting with random genetic effects, then de-regressing to obtain fixed effect estimates.

Fixed genetic effects at stage 1

Piepho et al. (2012) and Gogel et al. (2018) present the two-stage approach assuming fixed genetic effects at stage 1. In particular they show that for known variance matrices, and a full weight matrix carried from stage 1 to stage 2, the same form for estimates of \(\varvec{\tau }_e\) and predictions of \({\textbf{u}}_g\)..

Equation (4) is the basis for two-stage analysis. If \({\textbf{u}}_{g2}\) are taken as fixed effects in (4), estimation is based on the normal equations

$$\begin{aligned} \left[ \begin{array}{cc} {\textbf{X}}^T {\textbf{V}}^{-1} {\textbf{X}} &{} {\textbf{X}}^T {\textbf{V}}^{-1} {\textbf{Z}}_{g2} \\ {\textbf{Z}}_{g2}^T {\textbf{V}}^{-1} {\textbf{X}} &{} {\textbf{Z}}_{g2}^T {\textbf{V}}^{-1} {\textbf{Z}}_{g2} \end{array} \right] \left[ \begin{array}{c} \hat{\mathbf {\tau }} \\ \hat{{\textbf{u}}}_{g2} \end{array} \right] = \left[ \begin{array}{c} {\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{y}} \\ {\textbf{Z}}_{g2}^T{\textbf{V}}^{-1}{\textbf{y}} \end{array} \right] \end{aligned}$$
(17)

with solutions

$$\begin{aligned} \hat{\varvec{\tau }}= & {} ({\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{X}})^{-1} {\textbf{X}}^T {\textbf{V}}^{-1} ({\textbf{y}} - {\textbf{Z}}_{g2} \hat{{\textbf{u}}}_{g2}) \end{aligned}$$
(18)
$$\begin{aligned} \hat{{\textbf{u}}}_{g2}= & {} ({\textbf{Z}}_{g2}^T{\textbf{V}}^{-1}{\textbf{Z}}_{g2})^{-1} {\textbf{Z}}_{g2}^T {\textbf{V}}^{-1} ({\textbf{y}} - {\textbf{X}} \hat{\varvec{\tau }}) \end{aligned}$$
(19)

Substituting (18) into (19), rearranging, and defining

$$\begin{aligned} {\textbf{S}} = {\textbf{V}}^{-1} - {\textbf{V}}^{-1}{\textbf{X}} ({\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{X}})^{-1}{\textbf{X}}^T{\textbf{V}}^{-1} \end{aligned}$$
(20)

we find

$$\begin{aligned} \hat{{\textbf{u}}}_{g2} = ({\textbf{Z}}_{g2}^T{\textbf{S}}{\textbf{Z}}_{g2})^{-1} {\textbf{Z}}_{g2}^T {\textbf{S}} {\textbf{y}} \end{aligned}$$
(21)

Equation (21) is a key results for the following sub-section. Notice that \(\hat{{\textbf{u}}}_{g2}\) is an unbiased estimate of \({\textbf{u}}_g\), and this is a key property that is needed to proceed to the second stage of analysis. Taking forward a biased estimate, would introduce bias into the second stage analysis.

The final details for the first stage are presented after the discussion of random plus de-regression genetic effects at the first stage.

Random genetic effects plus de-regression at stage 1

Now suppose \({\textbf{u}}_{g2}\) is taken as a random effect at stage 1. A two-stage analysis ignores genetic covariance between environments. Indeed each environment is analyzed separately or in a single analysis where all fixed, random, and genetic effects have block diagonal design matrices, and in the latter two cases variance matrices that are block diagonal so that each environment has it’s own effects without covariance or correlation across environments. For our examples, \({\textbf{G}}_{g2d} = \textrm{diag}\left( \sigma _{gj}^2{\textbf{I}}_{n_{gj}}\right)\), recalling \(n_{gj}\) is the number of varieties at environment j. In particular, the genetic random effects in the combined model (4) are specified as \({\textbf{u}}_{g2} \sim N({\textbf{0}}, \; {\textbf{G}}_{g2d})\), with the d making the block diagonal form explicit. So our mixed model at stage 1 is

$$\begin{aligned} {\textbf{y}} = {\textbf{X}} \varvec{\tau }_d + {\textbf{Z}}_{g2} {\textbf{u}}_{g2} + \mathbf {\epsilon } \end{aligned}$$
(22)

and in the mixed model Eq. (8), \(\tilde{{\textbf{u}}}_g\) and \({\textbf{G}}_g\) are replaced by \(\tilde{{\textbf{u}}}_{g2}\) and \({\textbf{G}}_{g2d}\). The solutions of the mixed model equations are

$$\begin{aligned} \hat{\varvec{\tau }}_d= & {} ({\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{X}})^{-1} {\textbf{X}}^T {\textbf{V}}^{-1} ({\textbf{y}} - {\textbf{Z}}_{g2} \tilde{{\textbf{u}}}_{g2}) \end{aligned}$$
(23)
$$\begin{aligned} \tilde{{\textbf{u}}}_{g2}= & {} ({\textbf{Z}}_{g2}^T{\textbf{V}}^{-1}{\textbf{Z}}_{g2} + {\textbf{G}}_{g2d}^{-1})^{-1} {\textbf{Z}}_{g2}^T {\textbf{V}}^{-1} ({\textbf{y}} - {\textbf{X}} \hat{\varvec{\tau }}_d) \end{aligned}$$
(24)

and similar to the case of fixed genetic effects, substituting (23) into (24) we find

$$\begin{aligned} \tilde{{\textbf{u}}}_{g2} = ({\textbf{Z}}_{g2}^T{\textbf{S}}{\textbf{Z}}_{g2} + {\textbf{G}}_{g2d}^{-1})^{-1} {\textbf{Z}}_{g2}^T {\textbf{S}} {\textbf{y}} \end{aligned}$$
(25)

where \({\textbf{S}}\) is given in (20). Note that (21) and (25) only differ by the term \({\textbf{G}}_{g2d}^{-1}\).

Now,

$$\begin{aligned} \textrm{E}\left( \tilde{{\textbf{u}}}_{g2}\right) = ({\textbf{Z}}_{g2}^T{\textbf{S}}{\textbf{Z}}_{g2} + {\textbf{G}}_{g2d}^{-1})^{-1} {\textbf{Z}}_{g2}^T {\textbf{S}} {\textbf{Z}}_{g2} {\textbf{u}}_{g2} \end{aligned}$$

and hence is biased for \({\textbf{u}}_{g2}\). This in turn means \(\hat{\varvec{\tau }}_d\) is also biased, using (23), and the effects that would be taken to the second stage of analysis (combined estimated site means and the predicted genetic effects) would also be biased. However, the bias can be removed. Thus if we define

$$\begin{aligned} \hat{{\textbf{u}}}_{g2} = ({\textbf{Z}}_{g2}^T {\textbf{S}} {\textbf{Z}}_{g2})^{-1} ({\textbf{Z}}_{g2}^T{\textbf{S}}{\textbf{Z}}_{g2} + {\textbf{G}}_{g2d}^{-1}) \tilde{{\textbf{u}}}_{g2} \end{aligned}$$
(26)

this estimate is unbiased for \({\textbf{u}}_{g2}\). If this estimate is used in (23), \(\hat{\varvec{\tau }}_d\) is unbiased for \(\varvec{\tau }_d\), and the effects taken forward to the second stage of analysis will be unbiased for the genetic by environment means. In the animal breeding literature, this is termed de-regression (Garrick et al. 2009).

Note that substituting (25) into (26),

$$\begin{aligned} \hat{{\textbf{u}}}_{g2} = ({\textbf{Z}}_{g2}^T{\textbf{S}}{\textbf{Z}}_{g2})^{-1} {\textbf{Z}}_{g2}^T {\textbf{S}} {\textbf{y}} \end{aligned}$$

which is identical to (21), found if the genetic effects are taken as fixed. Thus, de-regression results in an estimate of the same form as for fixed genetic effects.

The practical effect of the above derivation is that when a stage 1 analysis is undertaken with random genetic effects, it is necessary to de-regress both the predicted random genetic effects and the fixed effects of interest. A practical way to do this is presented in Smith et al. (2001a). The stage 1 model with random genetic effects is fitted. The resulting estimated non-genetic variance parameters (and hence their structures) are then fixed and the model with genetic effects taken as fixed effects rather than random is then fitted.

Stage 1 fitted model

The final details of the first stage of analysis using either fixed or random plus de-regression genetic effects are as follows. It is simpler to fit genetic by environment means at the end of first stage, rather than site means plus genetic by environment effects. This is true for both fixed and random plus de-regression cases, noting that in the latter, the fitting is achieved by fixing variance parameters at their values when genetic effects were fitted as random. This means that \({\textbf{X}}_e\varvec{\tau }_e\) is omitted from the model (7), and the model fitted is

$$\begin{aligned} {\textbf{y}} = {\textbf{X}}_o \varvec{\tau }_o + {\textbf{Z}}_{g2} \varvec{\tau }_{g2} + \mathbf {\epsilon } \end{aligned}$$
(27)

where \(\varvec{\tau }_{g2}\) are the fixed effects for genetic by environment means. With \({\textbf{S}}_o\) defined in (15), and in a similar fashion to (21), we find under (27)

$$\begin{aligned} \hat{\varvec{\tau }}_{g2} = ({\textbf{Z}}_{g2}^T{\textbf{S}}_o{\textbf{Z}}_{g2})^{-1} {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{y}} \end{aligned}$$
(28)

and importantly the conditional distribution of \(\hat{\varvec{\tau }}_{g2}\) given \(\varvec{\tau }_{g2}\) is

$$\begin{aligned} \hat{\varvec{\tau }}_{g2} \vert \varvec{\tau }_{g2} \sim \text{ N }\left( \varvec{\tau }_{g2}, \; ({\textbf{Z}}_{g2}^T{\textbf{S}}_o{\textbf{Z}}_{g2})^{-1} \right) \end{aligned}$$
(29)

This distribution forms the basis of the second stage of analysis.

Stage 2 analysis

The second stage model is

$$\begin{aligned} \hat{\varvec{\tau }}_{g2} = {\textbf{D}}_e \varvec{\tau }_e + {\textbf{D}} {\textbf{u}}_g + {\textbf{e}}_{g2} \end{aligned}$$
(30)

where \({\textbf{u}}_g\) is the full set of genetic effects as in the one-stage model (5), and \({\textbf{D}}_e\) and \({\textbf{D}}\) are defined (13) and (6). Note that \({\textbf{u}}_g \sim \text{ N }({\textbf{0}}, {\textbf{G}}_g)\) and \({\textbf{e}}_{g2} \sim \text{ N }({\textbf{0}}, {\textbf{V}}_{g2})\) where

$$\begin{aligned} {\textbf{V}}_{g2} = ({\textbf{Z}}_{g2}^T{\textbf{S}}_o{\textbf{Z}})_{g2}^{-1} \end{aligned}$$
(31)

The distribution of \({\textbf{e}}_{g2}\) has no unknown parameters, and the variance matrix is block diagonal (the blocks correspond to the environments) and is fully known (found at the first stage of analysis). With these specifications the mixed model equations based on (30) are

$$\begin{aligned} \left[ \begin{array}{cc} {\textbf{D}}_e^T {\textbf{V}}_{g2}^{-1} {\textbf{D}}_e &{} {\textbf{D}}_e^T {\textbf{V}}_{g2}^{-1} {\textbf{D}} \\ {\textbf{D}}^T {\textbf{V}}_{g2}^{-1} {\textbf{D}}_e &{} {\textbf{D}}^T {\textbf{V}}_{g2}^{-1} {\textbf{D}} + {\textbf{G}}_g^{-1} \end{array} \right] \left[ \begin{array}{c} \hat{\mathbf {\tau }}_e \\ \tilde{{\textbf{u}}}_g \end{array} \right] = \left[ \begin{array}{c} {\textbf{D}}_e^T{\textbf{V}}_{g2}^{-1} \hat{\varvec{\tau }}_{g2} \\ {\textbf{D}}^T {\textbf{V}}_{g2}^{-1} \hat{\varvec{\tau }}_{g2} \end{array} \right] \end{aligned}$$
(32)

Substituting for the weight matrix \({\textbf{V}}_{g2}^{-1}\) in (32) using (31),

$$\begin{aligned} \left[ \begin{array}{cc} {\textbf{D}}_e^T{\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2} {\textbf{D}}_e &{} {\textbf{D}}_e^T {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2} {\textbf{D}} \\ {\textbf{D}}^T {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2} {\textbf{D}}_e &{} {\textbf{D}}^T {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2} {\textbf{D}} + {\textbf{G}}_g^{-1} \end{array} \right] \left[ \begin{array}{c} \hat{\mathbf {\tau }}_e \\ \tilde{{\textbf{u}}}_g \end{array} \right] = \left[ \begin{array}{c} {\textbf{D}}_e^T {\textbf{Z}}_{g2}^T {\textbf{S}}_o{\textbf{Z}}_{g2} \hat{\varvec{\tau }}_{g2} \\ {\textbf{D}}^T {\textbf{Z}}_{g2}^T{\textbf{S}}_o {\textbf{Z}}_{g2} \hat{\varvec{\tau }}_{g2} \end{array} \right] \end{aligned}$$
(33)

Noting (13), (6) and

$$\begin{aligned} {\textbf{D}}_e^T {\textbf{Z}}_{g2}^T{\textbf{S}}_o {\textbf{Z}}_{g2} \hat{\varvec{\tau }}_{g2} = {\textbf{X}}_e^T {\textbf{S}}_o {\textbf{y}} \qquad {\textbf{D}}^T {\textbf{Z}}_{g2}^T{\textbf{S}}_o {\textbf{Z}}_{g2} \hat{\varvec{\tau }}_{g2} = {\textbf{Z}}_g^T {\textbf{S}}_o {\textbf{y}} \end{aligned}$$

we see that (33) is identical to (14). Thus the form of estimates and predictions is the same for one and two-stage methods of analysis. Note that in Gogel et al. (2018), the derivation of \(\hat{\varvec{\tau }}_e\) is incorrect as a term is missing on the right-hand-side of their equation.

Lastly, the difference between one-stage and two-stage methods lies in the estimation of variance parameters in the linear mixed models. This difference is presented in the following sub-section.

Estimation of variance parameters

In all approaches, there is a need to estimate unknown parameters in \({\textbf{V}}\) and \({\textbf{G}}_g\). The score equations are compared for the one and two-stage approaches. If \(\varvec{\phi }\) and \(\varvec{\gamma }\) are the parameters in \({\textbf{V}}\) and \({\textbf{G}}_g\) respectively, in all the equations presented below, the dot above a matrix means the derivative with respect to a parameter, either \(\gamma _j\) or \(\phi _j\), and j also appears in the subscript for derivative of the matrix.

Genetic variance parameters

The usual approach for estimation of variance parameters is to use residual maximum likelihood or REML (Patterson and Thompson 1971). For the one-stage approach, the residual log-likelihood is

$$\begin{aligned} \ell (\varvec{\phi }, \varvec{\gamma }; {\textbf{y}}) = -\frac{1}{2} \left\{ \textrm{log}\left( \left| {\textbf{H}}\right| \right) + \textrm{log}\left( \left| {\textbf{X}}^T{\textbf{H}}^{-1}{\textbf{X}}\right| \right) + {\textbf{y}}^T {\textbf{P}} {\textbf{y}} \right\} \end{aligned}$$
(34)

where \(\vert \cdot \vert\) denotes the determinant of the matrix argument and \({\textbf{H}}\) and \({\textbf{P}}\) were given in (9) and (10). The REML estimates of \(\varvec{\phi }\) and \(\varvec{\gamma }\) are found by maximizing (34). This involves finding the score or derivative of the log-likelihood with respect to each parameter. For \(\gamma _j\), the score is given by

$$\begin{aligned} U(\gamma _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{P}} {\textbf{Z}}_g \dot{{\textbf{G}}}_{gj} {\textbf{Z}}_g^T\right) + \frac{1}{2} {\textbf{y}}^T {\textbf{P}} {\textbf{Z}}_g \dot{{\textbf{G}}}_{gj} {\textbf{Z}}_g^T {\textbf{P}} {\textbf{y}} \end{aligned}$$
(35)

and using (12) this reduces to

$$\begin{aligned} U(\gamma _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{Z}}_g^T {\textbf{P}} {\textbf{Z}}_g \dot{{\textbf{G}}}_{gj}\right) + \frac{1}{2} \tilde{{\textbf{u}}}_g^T {\textbf{G}}_g^{-1} \dot{{\textbf{G}}}_{gj} {\textbf{G}}_g^{-1} \tilde{{\textbf{u}}}_g \end{aligned}$$
(36)

For the two-stage approach, the residual log-likelihood is based on (30). If

$$\begin{aligned} {\textbf{H}}_2 = {\textbf{V}}_{g2} + {\textbf{D}} {\textbf{G}}_{g2} {\textbf{D}}^T \end{aligned}$$
(37)

and

$$\begin{aligned} {\textbf{P}}_2 = {\textbf{H}}_2^{-1} - {\textbf{H}}_2^{-1}{\textbf{D}}_e ({\textbf{D}}_e ^T {\textbf{H}}_2^{-1} {\textbf{D}}_e )^T {\textbf{D}}_e^T {\textbf{H}}_2^{-1} = {\textbf{Q}}_{22}({\textbf{Q}}_{22}^T {\textbf{H}}_2 {\textbf{Q}}_{22})^{-1} {\textbf{Q}}_{22}^T \end{aligned}$$
(38)

where \({\textbf{Q}}_{22}\) is such that \({\textbf{Q}}_{22}^T {\textbf{D}}_e = {\textbf{0}}\), the residual log-likelihood is

$$\begin{aligned} \ell (\varvec{\gamma }; \hat{\varvec{\tau }}_g) = -\frac{1}{2} \left\{ \textrm{log}\left( \left| {\textbf{H}}_2\right| \right) + \textrm{log}\left( \left| {\textbf{D}}_e^T{\textbf{H}}_2^{-1}{\textbf{D}}_e\right| \right) + \hat{\varvec{\tau }}_g^T {\textbf{P}}_2 \hat{\varvec{\tau }}_g \right\} \end{aligned}$$
(39)

The score for \(\gamma _j\) is then given by

$$\begin{aligned} U_{2}(\gamma _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{P}}_2 {\textbf{D}} \dot{{\textbf{G}}}_{gj} {\textbf{D}}^T\right) + \frac{1}{2} \hat{\varvec{\tau }}_g^T {\textbf{P}}_2 \dot{{\textbf{G}}}_{gj} {\textbf{P}}_2 \hat{\varvec{\tau }}_g \end{aligned}$$
(40)

Now using \({\textbf{G}}_{g} {\textbf{P}}_2 \hat{\varvec{\tau }}_g = \tilde{{\textbf{u}}}_{g}\), the sum of squares in (40) equals

$$\begin{aligned} \hat{\varvec{\tau }}_g^T {\textbf{P}}_2 \dot{{\textbf{G}}}_{gj} {\textbf{P}}_2 \hat{\varvec{\tau }}_g = \tilde{{\textbf{u}}}_{g}^T {\textbf{G}}_{g2}^{-1} \dot{{\textbf{G}}}_{gj} {\textbf{G}}_{g}^{-1} \tilde{{\textbf{u}}}_{g} \end{aligned}$$
(41)

The trace term requires some manipulation as follows. Firstly, using (37), (38), and the Sherman-Morrison-Woodbury formula,

$$\begin{aligned} {\textbf{P}}_2 = {\textbf{P}}_{V_{g2}} - {\textbf{P}}_{V_{g2}} ({\textbf{D}}^T {\textbf{P}}_{V_{g2}} {\textbf{D}} + {\textbf{G}}_g^{-1})^{-1} {\textbf{D}}^T {\textbf{P}}_{V_{g2}} \end{aligned}$$

where

$$\begin{aligned} {\textbf{P}}_{V_{g2}} = {\textbf{Q}}_{22}({\textbf{Q}}_{22}^T {\textbf{V}}_{g2} {\textbf{Q}}_{22})^{-1} {\textbf{Q}}_{22}^T \end{aligned}$$

Now \(\varvec{V_{g2}}^{-1} = {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2}\) and hence using (13) and (6), \({\textbf{D}}_e^T {\textbf{Z}}_{g2}^T {\textbf{S}}_o {\textbf{Z}}_{g2} {\textbf{D}}_e = {\textbf{X}}_e^T{\textbf{S}}_o{\textbf{X}}_e\) and \({\textbf{D}}^T {\textbf{P}}_{V_{g2}} {\textbf{D}} = {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{Z}}_g\), so that the term in the trace

$$\begin{aligned} {\textbf{D}}^T {\textbf{P}}_2 {\textbf{D}} = {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{Z}}_g - {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{Z}}_g ( {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{Z}}_g + {\textbf{G}}_g^{-1})^{-1} {\textbf{Z}}_g^T{\textbf{S}}_o{\textbf{Z}}_g = {\textbf{Z}}_g^T{\textbf{P}}{\textbf{Z}}_g \end{aligned}$$
(42)

using (16). Substituting (41) and (42) into (40), the score is then equal to (35), the score for the one-step analysis.

While the form of the score is identical for the one and two-step approaches, estimates of unknown parameters in \({\textbf{V}}\) (and hence \({\textbf{R}}\) and \({\textbf{G}}_o\)) have to be used in calculating the effects and variance parameters. These estimates differ in the two two-stage approaches and differ with the one stage approach. This is because the score equations are updated in an iterative process for the one-stage analysis, whereas in the two-stage analysis, the non-genetic variance parameters are fixed from the first stage analysis and define the weight matrix \(\varvec{V_{g2}}^{-1}\). This matrix also differs between the two-stage approaches using fixed or random genetic effects at the first stage.

Non-genetic variance parameters

Using the residual log-likelihood (34), the score equation for a non-genetic variance parameter \(\phi _j\) for the one-stage approach is

$$\begin{aligned} U(\phi _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{P}} \dot{{\textbf{H}}}_{j}\right) + \frac{1}{2} {\textbf{y}}^T {\textbf{P}} \dot{{\textbf{H}}}_{j}{\textbf{P}} {\textbf{y}} \end{aligned}$$
(43)

For the two-stage approach using fixed genetic effects, the residual log-likelihood used for estimating non-genetic variance parameters at stage 1 is

$$\begin{aligned} \ell (\varvec{\phi }; {\textbf{y}}) = -\frac{1}{2} \left\{ \textrm{log}\left( \left| {\textbf{V}}\right| \right) + \textrm{log}\left( \left| {\textbf{X}}^T{\textbf{V}}^{-1}{\textbf{X}}\right| \right) + {\textbf{y}}^T {\textbf{S}} {\textbf{y}} \right\} \end{aligned}$$
(44)

where \({\textbf{S}}\) is given by (20). The score for \(\phi _j\) then follows as

$$\begin{aligned} U_f(\phi _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{S}} \dot{{\textbf{V}}}_{j}\right) + \frac{1}{2} {\textbf{y}}^T {\textbf{S}} \dot{{\textbf{V}}}_{j}{\textbf{S}} {\textbf{y}} \end{aligned}$$
(45)

For random genetic effects at stage 1, the residual log-likelihood is

$$\begin{aligned} \ell (\varvec{\phi }, \varvec{\gamma }; {\textbf{y}}) = -\frac{1}{2} \left\{ \textrm{log}\left( \left| {\textbf{H}}_d\right| \right) + \textrm{log}\left( \left| {\textbf{X}}^T{\textbf{H}}_d^{-1}{\textbf{X}}\right| \right) + {\textbf{y}}^T {\textbf{P}}_d {\textbf{y}} \right\} \end{aligned}$$
(46)

where \({\textbf{H}}_d\) and \({\textbf{P}}_d\) are of the same form as (9) and (10) but with \({\textbf{G}}_g\) replaced by \({\textbf{G}}_{g2d}\). The score for \(\phi _j\) is

$$\begin{aligned} U_r(\phi _j) = -\frac{1}{2} \textrm{tr}\left( {\textbf{P}}_d \dot{{\textbf{H}}}_{dj}\right) + \frac{1}{2} {\textbf{y}}^T {\textbf{P}}_d \dot{{\textbf{H}}}_{dj}{\textbf{P}}_d {\textbf{y}} \end{aligned}$$
(47)

These are all of different forms and hence the estimates of non-genetic variance parameters will differ across the methods. As the score equations under the random genetic effects scenario are closer to the one-stage equations, it might be the case that the estimates in that case will be “better” than under a fixed genetic effects scenario.

De-regression and diagonal weight matrices

The original development of de-regression by Garrick et al. (2009) considered adjusting individual predicted genetic random effects. This also meant that individual weights were formed, and hence a diagonal weight matrix resulted. For very large problems, it may only be feasible to use a diagonal weight matrix. Smith et al. (2001a) take the diagonal elements of the inverse variance matrix \({\textbf{V}}_{g2}^{-1}\) as the weights. These elements are conditional variances and hence provide an adjustment for other effects. The use of diagonal weights was investigated to some extent by Gogel et al. (2018) and they show that in some cases using diagonal weights shows considerable disagreement with a one-stage and two-stage approach using the full weight matrices. This is further examined in the examples and the simulation study.

Results

All analyses were conducted using the asreml package in R (Butler et al. 2018), which is a commercial product (VSN International, https://vsni.co.uk/software/asreml). A function that automates the stage 1 analysis (stage1) is available from the author, as is data and code for the analyses of the two examples.

Barley stage 3 variety selection trials

To investigate two-stage methods of analysis, the one-stage analysis of the 24 site multi-environment trials was conducted first. Each trial was analyzed separately (needed for two-stage methods as well) to examine what fixed and random effects were needed to account for extraneous and global variation (Gilmour et al. 1997). A subset of linear row and column, and random row and column effects were needed across sites. These constitute terms that appear in \({\textbf{X}}_o \varvec{\tau }_o\) and \({\textbf{Z}}_o{\textbf{u}}_o\), the latter also including random block effects. All analyses included the separable ar1 by ar1 spatial model. The necessary extraneous and global effects were then included in a full multi-site analysis.

Table 4 Barley Multi-environment trial, one-stage analysis: The sequence of models for the site genetic variance matrix is presented together with the residual log-likelihood for each model, residual likelihood ratio statistics (REMLRS) for sequential models, the degrees of freedom (df) and p-value for the test

The models fitted for the random genetic effects were a diagonal (diag) structure over sites, and then factor analytic models of order 1 to 9, labelled fa1 to fa9 in Table 4. This table also includes the residual log-likelihood, sequential residual likelihood ratio statistics with the corresponding degrees of freedom and p-value for each test.

The likelihood ratio tests suggests the fa7 model is required and this model was used in the comparisons given below.

There were four two-stage methods used for comparison. For all four methods, linear row and column, and random row and column effects were included in the model as well as random block effects. The spatial ar1 by ar1 model was fitted for the residuals. This enabled an automated first stage analysis.

Firstly, fixed genetic effects were fitted for each site. The estimated fixed genetic effects were then taken forward, with a full weight matrix and a diagonal weight matrix. The same approach was used for random genetic effects at the first stage, with the de-regressed genetic effects taken forward to the second stage analyses, again with a full weight matrix and a diagonal set of weights.

The second stage analyses followed the one-stage process by starting with a diagonal variance matrix for sites for random site by genetic effects, and then fitted a sequence of factor analytic models.

Table 5 gives the models fitted for four two-stage approaches, fixed or random plus de-regression effects at the first stage and either a full weight matrix or diagonal weights carried forward. Using sequential residual likelihood ratio tests, a factor analytic model of order 8 (fa8) was selected for all two-stage approaches. Note that if the standard approach was used, model fitting would have stopped at the fa7 model for three of the approaches and the fa6 selected as the best model. This highlights the fact that important factors need not enter in order of importance, and that a sequential approach might miss factors that are important. Discovering that the fa8 improved the fit occurred by chance and not design. The two-stage models used for comparison were the fa8 in all cases compared to the fa7 used for the one-stage approach.

As variety selection is the aim, the predicted variety effects are of interest. These effects for one-stage model and the four two-stage models are plotted against each other for a selection of sites. In Fig. 1, the plots of the BLUPs for each pair of methods and their Pearson correlation are presented for Site 06S3NTR. For this site, the full weight matrix is slightly better than the diagonal form, for both fixed and random plus de-regression stage 1 analyses and the fixed first stage models are marginally better than their random counterparts.

Figure 2 provides the pairwise plots of BLUPs and their Pearson correlations for site 06S3WEE. For this site using random plus de-regression genetic effects at the first stage leads to a better stage 2 correspondence with the one-stage results than when fixed genetic effects were used at the first stage.

Table 5 Barley Multi-environment trial, second stage analysis using fixed (Fixed) or random plus de-regression (Random) genetic effects at the first stage with either a full weight matrix (Full) or diagonal weights (Diagonal): The sequence of models for the site genetic variance matrix is presented together with the residual log-likelihood for each model, residual likelihood ratio statistics for sequential models (REMLRS), the degrees of freedom (df) and p-value for the test

An examination of the 24 sites showed that there is no consistent pattern of which two-stage method, fixed or random plus de-regression is better overall. It depends on the site. However, the differences were generally small. The full weight matrix approach is generally better than using diagonal weights, but the BLUPs were highly correlated with the corresponding full weight matrix case.

Fig. 1
figure 1

Barley Multi-environment Trial, Site 06S3NTR: Five models in a scatterplot matrix. A factor analytic model of seven factors is fitted in a one-stage analysis (label fa7), an fa8 was used two-stage models with fixed (label fixed) or random plus de-regression (label random) at stage one, and in each case a full weight matrix and diagonal weights were used at stage two

Fig. 2
figure 2

Barley Multi-environment Trial, Site 06S3WEE: Five models in a scatterplot matrix. A factor analytic model of seven factors is fitted in a one-stage analysis (label fa7), and fa8 was used for two-stage models with fixed (label fixed) or random plus de-regression (label random) at stage one, and in each case a full weight matrix and diagonal weights were used at stage two

Two-stage methods do not estimate the unknown variance parameters in the same manner as an iterative full analysis. The estimated variance components were compared graphically for the different methods.

Fig. 3
figure 3

Barley Multi-environment Trial, comparison of estimated genetic correlations

Fig. 4
figure 4

Barley Multi-environment Trial, comparison of estimated genetic variances

For the genetic variance model, the full estimated \(24\times 24\) variance matrix was formed for the four approaches that involved weights from the first stage of analysis. The estimated correlations between the sites were found for each model and Fig. 3 is a scatterplot matrix of these estimated correlations, together with Pearson correlations for each pair of estimated correlations. It is clear that the correspondence of two-stage methods with the one-stage approach is very strong with high correlations. Using the fixed and random plus de-regression full weight matrices in particular are very close with the fixed approach being marginally better.

Figure 4 is a similar plot for the genetic variances. Again the Pearson correlations are very high, but under the fixed genetic effects stage 1 model (using both the full weight matrix and diagonal weights) and the random plus de-regression genetic effects stage 1 model with diagonal weights, there is one over-estimated genetic variance. This is site 06S3NTR for which the BLUPs were presented in Fig. 1. It was clear from those plots that only the stage 1 approach using random genetic effects with a full weight matrix at stage 2 captured the full set of genetic effects well, when compared to a one-stage analysis. Note that the ranking of top lines is not affected in this example.

Non-genetic parameters were matched across the 3 approaches where these parameters are estimated (one-stage, and stage 1 analyses with fixed or random plus de-regression genetic effects) and are presented graphically in Fig. 5. The correlations with the one-stage approach are higher for the random plus de-regression stage 1 analysis, although the difference appears minor.

Fig. 5
figure 5

Barley Multi-environment Trial, comparison of estimated non-genetic variance and correlation parameters

Multi-site p-rep yield trials

The same process was used for the p-rep trials as for the replicated Barley trials. Thus the five methods, one-stage, two-stage with fixed or random plus de-regression genetic effects at the first stage, and full and diagonal weights at the second stage, were examined.

The p-rep MET data were analyzed firstly using a one-stage approach. The Site factor (or trials) was included in the fixed effects in the model (\({\textbf{X}}_e\varvec{\tau }_e\)), as was the phenology group factor for sites 3 and 4 (\({\textbf{X}}_o\varvec{\tau }_o\)). The phenology factor was included so that shrinkage of variety effects would be relative to the membership of each variety to a phenology group. Random Rep, Block, and row and column effects were included for each trial (\({\textbf{Z}}_o{\textbf{u}}_o\)) and separable autoregressive processes of order 1 for row and column components were used in the residual model (Gilmour et al. 1997) also for each trial. The genetic model allowed for a separable structure for sites and lines, with a fully unstructured variance matrix used for the site component. Lines were assumed independent as no pedigree or genomic information was available.

For the two-stage analyses, the stage 1 model had a mean for the individual site being analyzed, as well as the phenology factor for sites 3 and 4, and random Rep, Block, row and column effects as for the one-stage model. The genetic effect for line was fixed or random with a scaled identity variance matrix. The residual model was a separable autoregressive processes of order 1 for row and column components as for the one-stage analysis.

For the second stage analyses, a full-weight matrix and the diagonal approximation as described above were used. The site by line model was the same as for the one-stage approach.

Figure 6 presents a scatterplot matrix of predicted genetic effects for all lines in the trials, for the five models for trial site 2 (similar results were found for other trials). The plotting panels represent the predicted line effects for pairs of models. The Pearson correlations are very high with the full weight matrix providing the highest correlation. Although not presented, the prediction standard errors are also highly correlated, although there is bias when a diagonal weight matrix is used.

Fig. 6
figure 6

For trial site 2, a scatterplot matrix for pairs of all predicted genetic line effects across five different models. The models were a one-stage, two stage fixed or random plus de-regression genetic effects at stage one, with full weight matrix and diagonal weights at stage two. The lower panels show the Pearson correlations between the predicted pairs of effects

The correlations and variances of the estimated genetic variance matrix were extracted for the three approaches, one-stage, two-stage with a full weight matrix, and two-stage using a diagonal weight matrix. Because of the smaller size of this set of METs, the scatterplot matrix of the estimated correlations and variances (chosen because they are of the same order) are presented in a single figure, rather than splitting into two as for the replicated MET. Figure 7 shows that using the full weight matrix results in a very high Pearson correlation of the components of the estimated genetic variance matrix with those found using the one-stage method. The diagonal weight matrix option is also very good.

Fig. 7
figure 7

p-rep Multi-environment Trial, comparison of estimated genetic variance matrix parameters

Figure 8 is a plot of the estimated non-genetic variance parameters for the one-stage and the stage 1 analysis with fixed or random plus de-regression genetic effects. The correspondence is good even though the larger effects under the full model appear to be under-estimated by the two-stage approach.

Fig. 8
figure 8

p-rep Multi-environment Trial, comparison of estimated non-genetic variance and correlation parameters

Simulation study: multi-site p-rep

Table 6 Comparison of five methods (Method) of analysis, one-stage, two-stage with fixed or random plus de-regression genetic effects at stage 1, and the latter two with a full or diagonal weight matrix at the second stage. Three levels of partial replication (p-rep), 0.5, 0.2 and 0.1. For 0.1, using fixed effects at stage 1 required a simpler model to be fitted (denoted by \(^*\)). Mean square error of prediction (MSEP) times 1920 was calculated for each of 100 simulations. The mean and standard deviation (Std dev) calculated for all methods. The counts of the rank (Ranking) from smallest (1) to largest (5) MSEP of each of the 100 simulations for all methods is presented

Table 6 presents a summary of results from simulations described in the Materials sub-section. The setup is given in Table 3 and (1). One hundred simulations of a four site MET with three levels of partial replication were examined.

The mean square error of prediction MSEP (2) was calculated for each simulation for each scenario, and then the mean and standard deviation of the 100 values calculated. Note these values were multiplied by 1920, the number of effects, for scaling the results. The values are presented in Table 6. For each simulation, the five methods were ranked according the MSEP and the counts of rankings in each class (1, smallest, to 5, largest) were accumulated over the 100 simulations for each method. These are also presented in Table 6.

For a partial replication of 0.5 or 50%, the mean MSEP and standard deviation of the MSEP are similar for one-stage, and two-stage with fixed or random plus de-regression genetic effects at stage 1. There is an ordering but the differences are small. However, the rankings of the methods show the one-stage and two-stage plus de-regression random genetic effects methods are generally better. Using diagonal weights is poor whether fixed or random plus de-regression genetic effects at stage 1 are used, but random seems better.

The change as the partial replication decreases can be seen for 0.2 and 0.1. For 0.2 partial replication, the mean and standard deviation of MSEP are very similar for one-stage and two-stage with random plus de-regression genetics effects at stage 1. The rankings favour one-stage but there are cases where random plus de-regression two stage is ranked higher. Only once does starting with fixed genetic effects at stage 1 result in the lowest MSEP. Again diagonal weights are poor, with random plus de-regression rather than fixed genetic effects in the stage 1 analysis heavily favoured.

For 0.1 or 10% partial replication the results are stronger and again random plus de-regression at stage 1 in a two-stage analysis compares favourably with a one-stage approach. Note that the model for the fixed genetic effects at stage 1 had to be modified to ensure analysis of simulations did not fail by removing the ar1 by ar1 spatial model for the residuals. The anomaly for diagonal weights where fixed appears better than random plus de-regression may be a function of the different models fitted.

The clear message from the simulations is that for p-rep designed METs, if a two-stage approach is to be used, a random plus de-regression genetic effects formulation at stage 1 should be used, and furthermore a full weight matrix should be used in the second stage analysis. The small simulation study shows the results will then be similar to those of a one-stage analysis.

Discussion and conclusions

This paper examined one-stage versus two-stage analysis of multi-environment trials. These methods were examined because there are situations when one-stage analysis is not feasible (computational requirements or time taken to fit the model is prohibitive) or feasible but with a compromised model.

In a one-stage analysis the model, genetic effects are random. In a two-stage analysis, fixed or random genetic effects can be used at the first stage of analysis. Using fixed genetic effects results in unbiased estimated variety means, and together with a weight matrix, these means can be used at the second stage of analysis. If random genetic effects are used at the first stage, the predictions are biased, but de-regression leads again to unbiased variety means for the second stage and effectively fixed effects estimates, and again these estimates can be used at the second stage with a weight matrix. It might be expected that non-genetic effects that are estimated at the first stage, might be better estimated if genetic effects are initially random, and in the examples this appears to be the case. It might be expected that predicted genetic effects at the second stage would also be better. In the examples, this is also true, but the predicted genetic effects did not differ greatly if the full weight matrix was used. Diagonal weights were not as good.

With partial replication, fitting fixed genetic effects might be problematic with low replication. In animal breeding, genetic effects must be fitted as random, because there is no replication. A small simulation study showed that using fixed genetic effects at stage 1 is not as good as random plus de-regression genetic effects, with model fitting becoming problematic for low replication (10%) with fixed genetic effects, even with good design. One and two stage analyses with random genetic effects plus de-regression were very close in mean square error of prediction and ranking across methods showed these approaches were superior to using fixed genetic effects. Diagonal weights were very poor.

In animal breeding it is necessary to use a pedigree based or genomic relationship matrix to ensure a useful analysis is possible. Partially replicated trials would benefit with inclusion of a relationship matrix both from a design and analysis perspective (Cullis et al. 2020).

The conclusion from this paper is that if a two-stage analysis needs to be conducted, random genetic effects should be used at the first stage, then de-regressed, and subsequently a full weight matrix used in the second stage of analysis. It may be necessary in large data problems to use diagonal weights, but in some circumstances these weights will be far from optimal.