# NOT RUN {
library(metan)
#===============================================================#
# Example 1: Analyzing all numeric variables assuming genotypes #
# as random effects with equal weights for mean performance and #
# stability #
#===============================================================#
model <- waasb(data_ge,
env = ENV,
gen = GEN,
rep = REP,
resp = everything())
# Distribution of random effects (first variable)
plot(model, type = "re")
# Genetic parameters
get_model_data(model, "genpar")
#===============================================================#
# Example 2: Analyzing variables that starts with "N" #
# assuming environment as random effects with higher weight for #
# response variable (65) for the three traits. #
#===============================================================#
model2 <- waasb(data_ge2,
env = ENV,
gen = GEN,
rep = REP,
random = "env",
resp = starts_with("N"),
wresp = 65)
# Get the index WAASBY
get_model_data(model2, what = "WAASBY")
# Plot the scores (response x WAASB)
plot_scores(model2, type = 3)
#===============================================================#
# Example 3: Analyzing GY and HM assuming a random-effect model.#
# Smaller values for HM and higher values for GY are better. #
# To estimate WAASBY, higher weight for the GY (60%) and lower #
# weight for HM (40%) are considered for mean performance. #
#===============================================================#
model3 <- waasb(data_ge,
env = ENV,
gen = GEN,
rep = REP,
resp = c(GY, HM),
random = "all",
mresp = c(100, 0),
wresp = c(60, 40))
# Get P-values for Likelihood-ratio test
get_model_data(model3, "pval_lrt")
# Get the random effects
get_model_data(model3, what = "ranef")
# Get the ranks for the WAASB index
get_model_data(model3, what = "OrWAASB")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab