**A “predict.asreml () ” function in ASReml-R**

*C. Supakorn*

The “** predict.asreml ()**” command in ASReml-R forms a linear function of the vector of fixed and random effects to obtain a predicted value for a factor of interest. Predictions are formed as an extra process after the final iteration and they are primarily used for generating tables of adjusted means for all levels of a given model factor.

These predictions are sometimes called least-square means (LSMeans), but this term applies only to predictions from models without random effects. The output from ASReml-R forms predicted values for a factor and considers for the remaining variables, either user specified values of the remaining variables or average of these values. For predict.asreml(), your model term of interest will be referenced in the *classify* set.

Let’s see an example using the nin89 dataset[1].

##### [1] Stroup WW, Baenziger PS and Mulitze DK (1994). “Removing Spatial Variation from Wheat Yield Trials: A Comparison of Methods.” *Crop Science*, 86, pp. 62-66.

In this instance, we have requested the adjusted means for all levels of variety, which are shown in the red rectangle together with their standard errors for the response variable means. Hence, these values represent the expected mean yield performance of a given variety once it is ‘adjusted’ or ‘corrected’ by the other model terms, such as replicated in this case. If you are interested in the average standard error of the difference between predicted means you can use “$avsed” from the generated object ’rcv.pv’.

You can learn more about this data set from package “asreml” and use of the command data(“nin89”) or details of arguments of this function at this link