trait <- params$trait
geno <- params$geno
env <- params$env
rep <- params$rep
dfr <- params$dfr
maxp <- params$maxp

lc <- ck.f(trait, c(geno, env), rep, dfr)
at <- suppressWarnings(aov.met(trait, geno, env, rep, dfr, maxp))
if (lc$nmis > 0) {
  trait.est <- paste0(trait, ".est")
  dfr[, trait] <- mve.met(trait, geno, env, rep, dfr, maxp)[, trait.est]
}
model <- aov(dfr[, trait] ~ dfr[, geno] + dfr[, env] +
               dfr[, rep] %in% dfr[, env] + dfr[, geno]:dfr[, env])

r if(lc$nt.0 == 0 & lc$nrep > 1) {"You have fitted a linear model for a multi environment trial (MET) with a RCBD in each environment. The ANOVA table for your model is:"}

at

r if(lc$nmis > 0) paste("You have some missing values (", format(lc$pmis * 100, digits = 3), "%) and they have been estimated before running ANOVA.")

The p-values for your model are:

r if(at[4, 5] < 0.05) {"Because interaction is significant you should want to run a stability analysis. Keep also in mind that a significant interaction means that the differences in response of the genotypes are not the same in all the environments. Therefore, on an individual analysis you could find significant differences among genotypes for some environments and non-significant differences for some others, and the difference for any pair of genotypes could be in different directions and magnitudes depending on the environment."}

Below you can see a table of means for genotypes, environments, and interaction:

tapply(dfr[, trait], dfr[, geno], mean)
tapply(dfr[, trait], dfr[, env], mean)
tapply(dfr[, trait], list(dfr[, geno], dfr[, env]), mean)

Don't forget the assumptions of the model. It is supposed that the error has a normal distribution with the same variance for all the genotypes and evironments. The following plots must help you evaluate this:

par(mfrow = c(1, 2))
plot(model, which = 1)
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.



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