Skip to contents

[Stable]

Computes environment stratification based on factor analysis.

Usage

env_stratification(
  .data,
  env,
  gen,
  resp,
  use = "complete.obs",
  mineval = 1,
  verbose = TRUE
)

Arguments

.data

The dataset containing the columns related to Environments, Genotypes, replication/block and response variable(s)

env

The name of the column that contains the levels of the environments.

gen

The name of the column that contains the levels of the genotypes.

resp

The response variable(s). To analyze multiple variables in a single procedure use, for example, resp = c(var1, var2, var3).

use

The method for computing covariances in the presence of missing values. Defaults to complete.obs, i.e., missing values are handled by casewise deletion.

mineval

The minimum value so that an eigenvector is retained in the factor analysis.

verbose

Logical argument. If verbose = FALSE the code will run silently.

Value

An object of class env_stratification which is a list with one element per analyzed trait. For each trait, the following values are given.

  • data The genotype-environment means.

  • cormat: The correlation matrix among the environments.

  • PCA: The eigenvalues and explained variance.

  • FA: The factor analysis.

  • env_strat: The environmental stratification.

  • mega_env_code: The environments within each mega-environment.

  • mega_env_stat: The statistics for each mega-environment.

  • KMO: The result for the Kaiser-Meyer-Olkin test.

  • MSA: The measure of sampling adequacy for individual variable.

  • communalities_mean: The communalities' mean.

  • initial_loadings: The initial loadings.

References

Murakami, D.M.D., and C.D.C. Cruz. 2004. Proposal of methodologies for environment stratification and analysis of genotype adaptability. Crop Breed. Appl. Biotechnol. 4:7-11.

Author

Tiago Olivoto, tiagoolivoto@gmail.com

Examples

# \donttest{
library(metan)
model <-
env_stratification(data_ge,
                   env = ENV,
                   gen = GEN,
                   resp = everything())
gmd(model)
#> Class of the model: env_stratification
#> Variable extracted: env_strat
#> # A tibble: 28 × 7
#>    TRAIT ENV   MEGA_ENV  MEAN   MIN   MAX    CV
#>    <chr> <chr> <chr>    <dbl> <dbl> <dbl> <dbl>
#>  1 GY    E1    ME1       2.52 1.97   2.90 13.3 
#>  2 GY    E10   ME1       2.18 1.54   2.57 14.4 
#>  3 GY    E11   ME1       1.37 0.899  1.68 16.4 
#>  4 GY    E12   ME1       1.61 1.02   2    20.3 
#>  5 GY    E13   ME1       2.91 1.83   3.52 16.8 
#>  6 GY    E5    ME1       3.91 3.37   4.81 10.7 
#>  7 GY    E3    ME2       4.06 3.43   4.57  8.22
#>  8 GY    E6    ME2       2.66 2.34   2.98  7.95
#>  9 GY    E14   ME3       1.78 1.43   2.06 11.7 
#> 10 GY    E8    ME3       2.54 2.05   2.88 10.5 
#> # … with 18 more rows

# }