knitr::opts_chunk$set(comment = "#", collapse = TRUE)

Getting started

In this section, we will use the data in data_ge and data_ge2. For more information see ?data_ge and ?data_ge2, respectively. Other data sets can be used provided that the following columns are in the data_ge: environment, genotype, block/replicate and response variable(s).

library(metan)
library(DT) # Used to make the tables
# Function to make HTML tables
print_table <- function(table, rownames = FALSE, digits = 3, ...){
  df <- datatable(table, rownames = rownames, extensions = 'Buttons',
                  options = list(scrollX = TRUE, 
                                 dom = '<<t>Bp>',
                                 buttons = c('copy', 'excel', 'pdf', 'print')), ...)
  num_cols <- c(as.numeric(which(sapply(table, class) == "numeric")))
  if(length(num_cols) > 0){
    formatSignif(df, columns = num_cols, digits = digits)
  } else{
    df
  }
}

See the section Rendering engine to know how HTML tables were generated.

Genotype-environment performance

The function ge_plot() may be used to visualize the genotype's performance across the environments.

library(metan)
a <- ge_plot(data_ge, ENV, GEN, GY)
b <- ge_plot(data_ge, ENV, GEN, GY) + ggplot2::coord_flip()
arrange_ggplot(a, b, tag_levels = "a")

To identify the winner genotype within each environment, we can use the function ge_winners().

ge_winners(data_ge2, ENV, GEN, resp = everything()) %>% print_table()

Or get the genotype ranking within each environment.

ge_winners(data_ge2, ENV, GEN, resp = everything(), type = "ranks") %>% 
  print_table()

For more details about the trials, we can use ge_details()

ge_details(data_ge2, ENV, GEN, resp = everything()) %>% 
  print_table()

Within-environment analysis of variance

The function anova_ind() can be used to compute an within-environment analysis of variance. Environment with values in blue had a significant (p < 0.05) genotype effect.

ind <- anova_ind(data_ge, ENV, GEN, REP, GY)
print_table(ind$GY$individual)

Genotype-by-environment means

The function make_mat() can be used to produce a two-way table for the genotype-environment means.

make_mat(data_ge, GEN, ENV, GY) %>% print_table(rownames = TRUE)

Genotype-by-environment interaction effects

The function ge_effects() is used to compute the genotype-environment effects.

ge_ef <- ge_effects(data_ge, ENV, GEN, GY)
print_table(ge_ef$GY)

Genotype plus Genotype-by-environment effects

To obtain the genotype plus genotype-environment effects, we can use the argument type = "gge" in the function ge_effects().

gge_ef <- ge_effects(data_ge, ENV, GEN, GY, type = "gge")
print_table(gge_ef$GY)

Clustering tester locations

The function ge_cluster() computes a cluster analysis for grouping environments based on its similarities using an Euclidean distance based on standardized data. Line means are divided by the phenotypic standard error of the relevant environment after its mean has been subtracted. By standardizing the data each environment will have a mean of zero and unit variance, and the effect of variability in phenotypic variance (as well as the mean) should be reduced [@Fox1982].

d1 <- ge_cluster(data_ge, ENV, GEN, GY, nclust = 4)
plot(d1, nclust = 4)

The function env_dissimilarity() computes the dissimilarity between test environment using:

mod <- env_dissimilarity(data_ge, ENV, GEN, REP, GY)
# Pearson's correlation coefficient
print_table(mod$GY$correlation, rownames = TRUE)
# Mean square GxEjj'
print_table(mod$GY$MSGE, rownames = TRUE)
# % Of the single part of MS GxEjj' (Robertson, 1959)
print_table(mod$GY$SPART_RO, rownames = TRUE)
# % Of the complex part of MS GxEjj' (Robertson, 1959)
print_table(mod$GY$CPART_RO, rownames = TRUE)
# % Of the single part of MS GxEjj' (Cruz and Castoldi, 1991)
print_table(mod$GY$SPART_CC, rownames = TRUE)
# % Of the complex part of MS GxEjj' (Cruz and Castoldi, 1991)
print_table(mod$GY$CPART_CC, rownames = TRUE)

To obtain dendrograms based on the above matrix we can use plot(). The dendrograms are based on the hierarchical clustering algorithm UPGMA (Unweighted Pair Group Method using Arithmetic averages).

plot(mod)

Joint regression analysis

@Eberhart1966 popularized the regression-based stability analysis. In these procedures, the adaptability and stability analysis is performed by means of adjustments of regression equations where the dependent variable is predicted as a function of an environmental index, according to the following model:

$$ \mathop Y\nolimits_{ij} = {\beta {0i}} + {\beta {1i}}{I_j} + {\delta {ij}} + {\bar \varepsilon {ij}} $$ where ${\beta {0i}}$ is the grand mean of the genotype i (i = 1, 2, ..., I); ${\beta {1i}}$ is the linear response (slope) of the genotype i to the environmental index; Ij is the environmental index (j = 1, 2, ..., e), where ${I_j} = [(y_{.j}/g)- (y_{..}/ge)]$, ${\delta {ij}}$ is the deviation from the regression, and ${\bar \varepsilon {ij}}$ is the experimental error.

The model is fitted with the function ge_reg(). The S3 methods plot() and summary() may be used to explore the fitted model.

reg_model <- ge_reg(data_ge, ENV, GEN, REP, GY)
print_table(reg_model$GY$anova)
print_table(reg_model$GY$regression)

Genotypic confidence index

@Annicchiarico1992 proposed a stability method in which the stability parameter is measured by the superiority of the genotype in relation to the average of each environment, according to the following model:

$$ {Z_{ij}} = \frac{{{Y_{ij}}}}{{{{\bar Y}_{.j}}}} \times 100 $$ The genotypic confidence index of the genotype i ($W_i$) is then estimated as follows:

$$ W_i = Z_{i.}/e - \alpha \times sd(Z_{i.}) $$ Where $\alpha$ is the quantile of the standard normal distribution at a given probability error ($\alpha \approx 1.64$ at 0.05). The method is implemented using the function Annicchiarico(). The confidence index is estimated considering all environment, favorable environments (positive index) and unfavorable environments (negative index), as follows:

Computing the index

ann5 <- Annicchiarico(data_ge, ENV, GEN, REP, GY)
ann1 <- Annicchiarico(data_ge, ENV, GEN, REP, GY, prob = 0.01)

Environment classification

print_table(ann5$GY$environments)

Index computed with all environments

print_table(ann5$GY$general)

Superiority index

The function superiority() implements the nonparametric method proposed by @Lin1988, which considers that a measure of cultivar general superiority for cultivar x location data is defined as the distance mean square between the cultivar's response and the maximum response averaged over all locations, according to the following model.

$$ P_i = \sum\limits_{j = 1}^n{(y_{ij} - y_{.j})^2/(2n)} $$ where n is the number of environments

Similar then the genotypic confidence index, the superiority index is calculated by all environments, favorable, and unfavorable environments.

super <- superiority(data_ge, ENV, GEN, GY)
print_table(super$GY$index)

Environmental stratification

A method that combines stability analysis and environmental stratification using factor analysis was proposed by @murakami2004. This method is implemented with the function ge_factanal(), as follows:

fact <- ge_factanal(data_ge, ENV, GEN, REP, GY)
plot(fact)
print_table(fact$GY$PCA)
print_table(fact$GY$FA)
print_table(fact$GY$env_strat)

Wrapper function

The easiest way to compute the above-mentioned stability indexes is by using the function ge_stats(). It is a wrapper function that computes all the stability indexes at once. To get the results into a "ready-to-read" file, use get_model_data().

stat_ge <- data_ge2 %>% ge_stats(ENV, GEN, REP, resp = c(EH, PH))
get_model_data(stat_ge, "stats") %>% print_table()
get_model_data(stat_ge, "ranks") %>% print_table(digits = 1)

It is also possible to obtain the Spearman's rank correlation between the stability indexes by using corr_stab_ind().

corr_stab_ind(stat_ge)

Rendering engine {#rendering}

This vignette was built with pkgdown. All tables were produced with the package DT using the following function.

library(DT) # Used to make the tables
# Function to make HTML tables
print_table <- function(table, rownames = FALSE, digits = 3, ...){
  df <- datatable(table, rownames = rownames, extensions = 'Buttons',
                  options = list(scrollX = TRUE, 
                                 dom = '<<t>Bp>',
                                 buttons = c('copy', 'excel', 'pdf', 'print')), ...)
  num_cols <- c(as.numeric(which(sapply(table, class) == "numeric")))
  if(length(num_cols) > 0){
    formatSignif(df, columns = num_cols, digits = digits)
  } else{
    df
  }
}

References



TiagoOlivoto/WAASB documentation built on March 20, 2024, 4:18 p.m.