r i = {{i}}

lc <- check.2f(traits[i], A, B, rep, data)
if (lc$c4 == 0)
  data$est <- mve.2f(traits[i], A, B, rep, design, data, maxp)[, 5] else
    data$est <- data[, traits[i]]

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

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

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

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

{{i+1}}.1.1. Means by factor A levels

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

{{i+1}}.1.2. Means by factor B levels

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

{{i+1}}.1.3. Means by factor A and factor B levels

tapply(data$est, list(data[, A], data[, B]), 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 combinations among the levels of both factors. The following plots help to evaluate this assumptions:

if (design == "crd")
  model <- aov(data[, traits[i]] ~ data[, A] * data[, B])
if (design == "rcbd")
  model <- aov(data[, traits[i]] ~ data[, A] * data[, B] + data[, rep])
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

at <- suppressWarnings(aov.2f(traits[i], A, B, rep, design, data, maxp))
at


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