ge_model() fits the two-way model with interaction and random replicates within environments by restricted
maximum likelihood (lme4::lmer()). Its residual variance is the error variance of the least-squares AMMI
fit (ge_ammi(), which computes it in closed form).
Usage
ge_model(.data, .y, .gen, .env, .rep)
# Default S3 method
ge_model(.data, .y, .gen, .env, .rep)Details
$$y_{ijl} = \mu + \delta_j + \tau_i + (\tau\delta)_{ij} + b_{l(j)} + e_{ijl}, \qquad b_{l(j)} \sim N(0, \sigma^2_b), \quad e_{ijl} \sim N(0, \sigma^2).$$ The package lme4 is needed (it is suggested, not required, since version 1.0.0).
References
Crossa, J., Perez-Elizalde, S., Jarquin, D., Cotes, J. M., Viele, K., Liu, G. and Cornelius, P. L. (2011). Bayesian estimation of the additive main effects and multiplicative interaction model. \emphCrop Science, \strong51(4), 1458–1469. \doi10.2135/cropsci2010.06.0343
Bates, D., Maechler, M., Bolker, B. and Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1), 1–48. doi:10.18637/jss.v067.i01
Author
Muhammad Yaseen (myaseen208@gmail.com)
Examples
data(Maiz)
if (requireNamespace("lme4", quietly = TRUE)) {
fm <-
ge_model(
.data = Maiz
, .y = y
, .gen = entry
, .env = site
, .rep = rep
)
stats::sigma(fm)^2
}
#> [1] 602844.8