# \donttest{
library(metan)
#===============================================================#
# Example 1: Analyzing all numeric variables considering p-value#
# <= 0.05 to compute the WAAS. #
#===============================================================#
model <- waas(data_ge,
env = ENV,
gen = GEN,
rep = REP,
resp = everything())
# Residual plot (first variable)
plot(model)
# Get the WAAS index
get_model_data(model, "WAAS")
# Plot WAAS and response variable
plot_scores(model, type = 3)
#===============================================================#
# Example 2: Declaring the number of axis to be used for #
# computing WAAS and assigning a larger weight for the response #
# variable when computing the WAASBY index. #
#===============================================================#
model2 <- waas(data_ge,
env = ENV,
gen = GEN,
rep = REP,
resp = everything(),
naxis = 1, # Only to compare with PC1
wresp = 60)
# Get the WAAS index (it will be |PC1|)
get_model_data(model2)
# Get values for IPCA1
get_model_data(model2, "PC1")
#===============================================================#
# 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 <- waas(data_ge,
env = ENV,
gen = GEN,
rep = REP,
resp = c(GY, HM),
mresp = c("h, l"),
wresp = c(60, 40))
# Get the ranks for the WAASY index
get_model_data(model3, what = "OrWAASY")
# }
Run the code above in your browser using DataLab