1. Home
  2. Extracting results

Extracting results

One of the big differences between the standalone version and the R version of ASReml is the way output is dealt with. The console version generates several text files with the same base name of the .as file containing the job, but different extensions. For example, a job.as file will generate job.asr with a summary of the run, job.sln with the fixed and random effect solutions, job.yht with predicted values, etc. In contrast, ASReml-R follows the ‘R way’, creating an object that contains all the output. This object has to be queried, by using specific functions or commands, to obtain particular parts of the output.

Let’s assume that we have fitted a simple linear mixed model to explain plant yield (yield), based on overall mean (1), Fertilizer dose (Fert) and a genetic effect (vm(Tree, pedinv)):

fm <- asreml(yield ~ 1 + Fertil, random = ~ vm(Tree, pedinv), 
             data = mytrial)

An ASReml-R object for a linear mixed model will contain information on the model fitted, Log likelihood, predicted values for fixed and random effects, residuals, variance components, etc. A common way to obtain summary results in R is to use the function summary on the fitted object as summary(fm). Unfortunately, the summary function in ASReml-R displays the whole contents of the object, which will be many pages and not a summary at all. So, how do you get a proper summary?

Part of the default output of running ASReml-R is to display the log likelihood of the fitted model. Most likely, the next thing that we would like to know are the variance components, which we can obtain as:

summary(fm)$varcomp

Random and fixed effects are extracted using the coef.random and coef.fixed names for the fitted model within the same summary. The outputs are matrices with 3 columns: solution, standard error and z ratio. The latter is simply the solution divided by its standard error, an indication of significance.

# Extracting random effects
summary(fm, coef = TRUE)$coef.random

# Extracting fixed effects
summary(fm, coef = TRUE)$coef.fixed

R data frames can have associated row names and column names. These objects contain the column names solutionstd error and z ratio, while the row names correspond to the names of the factor, followed by underscores with the levels of the factor.

Copyright (1997–2021) by Luis Apiolaza, some rights are reserved.

Updated on September 22, 2021

Was this article helpful?