r i = {{i}}

lc <- check.met(traits[i], geno, env, rep, data)
if (lc$c3 == 0)
  data$est <- mvemet(traits[i], geno, env, rep, data, maxp)[, 5] else
    data$est <- data[, traits[i]]

{{i+1}}. Analysis for trait r traits[i]

r if(lc$c3 == 1) {"There are no missing values for this trait; the design es balanced."}

r if(lc$c3 == 0) paste("There are some missing values (", format(lc$pmis * 100, digits = 3), "%) and they have been estimated for the descriptive statistics, ANOVA, regression stability analysis and Tai sections.")

{{i+1}}.1. Descriptive statistics

{{i+1}}.1.1. Means by genotypes

tapply(data$est, data[, geno], mean)

{{i+1}}.1.2. Means by environments

tapply(data$est, data[, env], mean)

{{i+1}}.1.3. Means by genotypes and environments

tapply(data$est, list(data[, geno], data[, env]), mean)

{{i+1}}.2. ANOVA

{{i+1}}.2.1. Checking assumptions

As it was stated in section 1, it is supposed that the error has a normal distribution with the same variance for all the genotypes and evironments. The following plots help to evaluate this assumptions:

model <- aov(data[, traits[i]] ~ data[, geno] + data[, env]
             + data[, rep] %in% data[, env] + data[, geno]:data[, env])
par(mfrow = c(1, 2))
suppressWarnings(plot(model, which = 1))
suppressWarnings(plot(model, which = 2))

Funnel shapes for the first plot may suggest heterogeneity of variances while departures from the theoretical normal line are symptoms of lack of normality.

{{i+1}}.2.2. ANOVA table

For this analysis it is assumed that genotypes and environments have fixed effects and that the blocks are random.

at <- suppressWarnings(aovmet(traits[i], geno, env, rep, data, maxp))
at

The coefficient of variation for this experiment is r format(agricolae::cv.model(model), digits = 4)%. The p-values for the model are:

{{i+1}}.2.3. Variance components estimation

Under the assumption that all the factors (genotypes, environments, and blocks) have random effects, below it is shown the variance components estimation. Here the model is estimated by REML (Restricted Maximum Likelihood) and the original data without the estimation of missing values is used.

y <- data[, traits[i]]
fg <- data[, geno]
fe <- data[, env]
fr <- data[, rep]
ff <- as.formula(y ~ (1|fg) + (1|fg:fe) + (1|fe/fr))
model.reml <- lme4::lmer(ff)
vc <- data.frame(lme4::VarCorr(model.reml))
vg <- vc[vc[, 1] == "fg", 4]
vgxe <- vc[vc[, 1] == "fg:fe", 4]
vr <- vc[vc[, 1] == "Residual", 4]
vc[vc[, 1] == "fg", 1] <- geno
vc[vc[, 1] == "fe", 1] <- env
vc[vc[, 1] == "fg:fe", 1] <- paste(geno, ":", env, sep = "")
vc[vc[, 1] == "fr:fe", 1] <- paste(rep, "(", env, ")", sep = "")
rownames(vc) <- vc[, 1]
vc <- vc[, c(4, 5)]
colnames(vc) <- c("Variance", "Std.Dev.")
h2 <- vg / (vg + vgxe / lc$ne + vr / lc$ne / lc$nr) * 100
vc

With these variance estimates, the broad sense heritability results r paste(format(h2, digits = 4), "%", sep = "").

{{i+1}}.3. Stability analysis

r if(at[4, 5] > 0.05) {"Because interaction is non significant a stability analysis is not presented."} r if(at[4, 5] < 0.05) {"Because interaction is significant a stability analysis is presented."}

r if(at[4, 5] < 0.05) {paste("### ", {{i+1}}, ".3.1. AMMI", sep = "")}

r if(at[4, 5] < 0.05) {"#### AMMI biplots"}

if(at[4, 5] < 0.05) {
  ammimodel <- suppressWarnings(ammi(traits[i], geno, env, rep, data))
  plot(ammimodel, biplot = 1)
}
if(at[4, 5] < 0.05) {
  plot(ammimodel, biplot = 2)
}

r if(at[4, 5] < 0.05) {"#### Interaction effects"}

if(at[4, 5] < 0.05) ammimodel$Interaction_effects

r if(at[4, 5] < 0.05) {"#### PC-values for genotypes"}

if(at[4, 5] < 0.05) ammimodel$PC_values_genotypes

r if(at[4, 5] < 0.05) {"#### PC-values for environments"}

if(at[4, 5] < 0.05) ammimodel$PC_values_environments

r if(at[4, 5] < 0.05) {"#### PC contributions"}

if(at[4, 5] < 0.05) ammimodel$Contribution_PCs

r if(at[4, 5] < 0.05) {paste("### ", {{i+1}}, ".3.2. GGE", sep = "")}

r if(at[4, 5] < 0.05) {"#### GGE biplots"}

if(at[4, 5] < 0.05) {
  ggemodel <- suppressWarnings(ammi(traits[i], geno, env, rep, data, method = "GGE"))
  plot(ggemodel, biplot = 1)
}
if(at[4, 5] < 0.05) {
  plot(ggemodel, biplot = 2)
}

r if(at[4, 5] < 0.05) {"#### PC-values for genotypes"}

if(at[4, 5] < 0.05) ggemodel$PC_values_genotypes

r if(at[4, 5] < 0.05) {"#### PC-values for environments"}

if(at[4, 5] < 0.05) ggemodel$PC_values_environments

r if(at[4, 5] < 0.05) {"#### PC contributions"}

if(at[4, 5] < 0.05) ggemodel$Contribution_PCs

r if(at[4, 5] < 0.05) {paste("### ", {{i+1}}, ".3.3. Regression Stability Analysis", sep = "")}

if(at[4, 5] < 0.05) {
  rsamodel <- suppressWarnings(rsa(traits[i], geno, env, rep, data))
}

r if(at[4, 5] < 0.05) {"#### ANOVA"}

if(at[4, 5] < 0.05) rsamodel$ANOVA

r if(at[4, 5] < 0.05) {"#### Stability measures for genotypes"}

if(at[4, 5] < 0.05) rsamodel$Stability_for_genotypes

r if(at[4, 5] < 0.05) {"Here: \n - a is the linear regression intercept, \n - b is the linear regression slope, \n - se is the slope standard error, \n - MSe is the error mean square, \n - MSentry is the variance of the means, and \n - MSinter is the variance of the interaction effects. \n The same is shown in the next section for each environment."}

r if(at[4, 5] < 0.05) {"#### Stability measures for environments"}

if(at[4, 5] < 0.05) rsamodel$Stability_for_environments

r if(at[4, 5] < 0.05) {paste("### ", {{i+1}}, ".3.4. Tai stability analysis", sep = "")}

r if(at[4, 5] < 0.05) {"#### Tai plot"}

if(at[4, 5] < 0.05) {
  taimodel <- suppressWarnings(tai(traits[i], geno, env, rep, data))
  plot(taimodel)
}

r if(at[4, 5] < 0.05) {"#### Tai alpha and lambda values"}

if(at[4, 5] < 0.05)
  taimodel$Tai_values


CIP-RIU/hidap documentation built on April 30, 2021, 9:21 p.m.