plot.asreml | R Documentation

## plot method for asreml objects

### Description

A method for the generic function `plot()` for objects inheriting from class `asreml`.

### Usage

    plot.asreml(object, formula = ~NULL, fun = NULL, spatial = "plot",
                npanels = NA, ...)

### Arguments

`object` | An object inheriting from class `asreml`.
`formula` | an optional formula specifying the form of a Trellis plot, where the trellis function to be used is given by the `fun` argument. This overrides the default plot behaviour. Variables in the original data frame can be referenced in the formula and the object itself can be referenced by ".", allowing extractor functions like `resid` and `fitted` to be used.
`fun` | a character string naming a Trellis or user defined function to be used with the `formula` argument. Required if `formula` is specified.
`spatial` | If `"plot"` and an independent error has been fitted with `units` in the random formula, these are added to the residuals, otherwise if `"trend"` then `units` are not added even if present in the model.
`npanels` | an integer specifying the maximum number of panels per page. If NA then a suitable default is determined.
`...` | graphical parameters, typically title information, can be supplied to `plot.asreml()`.

### Details

By default, four plots are currently generated: a histogram of the residuals, a Normal Q-Q plot, a plot of residuals against fitted values and a plot of residuals against unit number. If the residual structure of the model contains multiple sections, the default plots are conditioned on the factor whose levels define the sections. For multivariate analyses, the plots are conditioned on `trait`.

### Value

An invisible list of trellis graph objects. The default behaviour uses `print.trellis` to position the four plots on the screen

### Author(s)

David Butler

### See Also

`asreml` `asreml.object` `lattice`

### Examples

    data(oats, package="asreml3")
    oats.asr <- asreml(yield ~ Variety*Nitrogen, random = ~ Blocks/Wplots,
                       data=oats)
    plot(oats.asr)