A short note about GGE and GGB biplots.

```
library("knitr")
knitr::opts_chunk$set(fig.align="center", fig.width=6, fig.height=6)
options(width=90)
```

An example of a GGE (genotype plus genotype-by-environment) biplot similar to figure 12 of Yan and Tinker (2006). The `flip`

argument can be used to flip the x and y axes so that biplots are oriented as desired. Because the SVD factorization is not unique,

```
library(agridat)
data(yan.winterwheat)
dat1 <- yan.winterwheat
library(gge)
m1 <- gge(yield~gen*env, dat1, scale=FALSE)
biplot(m1, main="yan.winterwheat - GGE biplot",
flip=c(1,0), origin=0, hull=TRUE)
```

Many people prefer to use ‘standardized’ biplots, in which the data for each environement has been centered and scaled. For standardized biplots, a unit circle is drawn. Environment vectors that reach out to the unit circle are perfectly represented in the two dimensional plane.

```
m2 <- gge(yield~gen*env, dat1, scale=TRUE)
biplot(m2, main="yan.winterwheat - GGE biplot",
flip=c(1,1), origin=0)
```

As seen above, the environment vectors are fairly long, so that relative performance of genotypes in environments can be assessed with reasonable accuracy. In contrast, a biplot based on principal components 2 and 3 has shorter vectors which should not be interpreted.

```
biplot(m2, main="yan.winterwheat - GGE biplot - PC 2 & 3",
comps=c(2,3), flip=c(1,1), origin=0)
```

Laffont, Hanafi, and Wright (2007) showed how to partition the sums-of-squares simultaneously along the principal component axes and along ‘G’ and ‘GxE’ axes.

`plot(m1, title="yan.winterwheat")`

`## Argument 'title' will be deprecated. Use 'main' instead.`

The mosaic plot above shows that the first principal component axis is capturing almost all of the variation between genotypes, so that a projection of the genotype markers onto the first principal component axis is a good overall representation of the rankings of the genotypes.

Laffont, Wright, and Hanafi (2013) presented GGB (genotype plus genotype-by-block of environments) biplots, which are useful to enhance the view of mega-environments consisting of multiple locations.

```
library(agridat)
data(crossa.wheat)
dat2 <- crossa.wheat
# Define mega-environment groups of locations
dat2$eg <- ifelse(is.element(dat2$loc,
c("KN","NB","PA","BJ","IL","TC",
"JM","PI","AS","ID","SC","SS",
"SJ","MS","MG","MM")), "Grp1", "Grp2")
library(gge)
# Specify env.group as column in data frame
m3 <- gge(yield~gen*loc, dat2, env.group=eg, scale=FALSE)
biplot(m3, title="crossa.wheat - GGB biplot")
```

`## Argument 'title' will be deprecated. Use 'main' instead.`

When \(\bf X\) is a genotype-by-environment matrix, a *genotype-focused* biplot is easily obtained. The genotype coordinates are can be obtained from the SVD using the first two columns of \(\bf G_{gf} = U S\) or equivalently from NIPALS \(\bf G_{gf} = T\).

```
## u <- Xc.svd$u
## s <- diag(Xc.svd$d)
## v <- Xc.svd$v
## (u %*% s)[,1:2]
## t[,1:2]
```

The environment coordinates are the first two colunns of \(\bf E_{gf} = V\) (from the SVD) or \(\bf E_{gf} = P\) (from NIPALS).

```
## v[,1:2]
## p[,1:2]
```

For an *environment-focused* biplot, a little more effort is needed as the eigenvalues from NIPALS are also required. The square root of the NIPALS eigenvalues are the same as the SVD singular values.

The genotype coordinates are the first two columns of $

```
## (v %*% s)[,1:2]
## (p %*% diag(sv))[,1:2]
```

`sessionInfo()`

```
## R version 3.4.2 (2017-09-28)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 7 x64 (build 7601) Service Pack 1
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=C LC_CTYPE=English_United States.1252
## [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
## [5] LC_TIME=English_United States.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] gge_1.3 agridat_1.13 knitr_1.17
##
## loaded via a namespace (and not attached):
## [1] Rcpp_0.12.14 magrittr_1.5 xtable_1.8-2 R6_2.2.2 highr_0.6
## [6] stringr_1.2.0 plyr_1.8.4 tools_3.4.2 htmltools_0.3.6 yaml_2.1.15
## [11] rprojroot_1.2 digest_0.6.12 rgl_0.98.1 shiny_1.0.5 reshape2_1.4.3
## [16] htmlwidgets_0.9 nipals_0.3 evaluate_0.10.1 mime_0.5 rmarkdown_1.8
## [21] stringi_1.1.6 compiler_3.4.2 backports_1.1.1 jsonlite_1.5 httpuv_1.3.5
```

Laffont, Jean-Louis, Mohamed Hanafi, and Kevin Wright. 2007. “Numerical and Graphical Measures to Facilitate the Interpretation of Gge Biplots.” *Cs* 47: 990–96. doi:10.2135/cropsci2006.08.0549.

Laffont, Jean-Louis, Kevin Wright, and Mohamed Hanafi. 2013. “Genotype Plus Genotype-by-Block of Environments Biplots.” *Crop Science* 53 (6): 2332–41. doi:10.2135/cropsci2013.03.0178.

Yan, Weikai, and Nicholas A Tinker. 2006. “Biplot Analysis of Multi-Environment Trial Data: Principles and Applications.” *Canadian Journal of Plant Science* 86: 623–45. doi:10.4141/P05-169.

## Comments on biplots

Note that GGE biplots are environment-focused. In particular, this provides the interpretation that the correlation of genotype performance in two environments is approximated by the cosine of the angle between the vectors for those two environments.

The SVD and NIPALS methods provide the same principal components for complete-data, except that a principal component from SVD and the corresponding principal component from NIPALS might point in opposite directions (differ by a factor of \(-1\)) as in some of the examples above. The corresponding biplots would therefore be mirror-reversed along that component. For biplots from SVD and NIPALS that are visually consistent, each principal component can be directed to point in a direction that is positively correlated with the overall genotype means. In other words, if the correlation of the genotype means and the ordinate of the genotypes along the principal component is negative, the principal component is multiplied by \(-1\).

As with all biplots, the environment vectors can be arbitrarily scaled so that the genotypes and environments uses a similar amount of area on the plot. The algorithm that physically centers the biplot and scales it on the page is not perfect and has opportunities for improvement.