autoplot: Several types of residual plots

Description Usage Arguments Author(s) Examples

Description

Residual plots for a output model of class "WAAS.AMMI" and "WAASB". Six sets of plots are produced: (1) Residuals vs fitted, (2) normal Q-Q plot for the residuals, (3) scale-location plot (standardized residuals vs Fitted Values), (4) standardized residuals vs Factor-levels, (5) Histogram of raw residuals and (6) standardized residuals vs observation order. For a "WAASB" object, normal Q-Q plot for random effects may also be obtained declaring type = "re"

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'WAAS.AMMI'
autoplot(x, conf = 0.95, labels = FALSE, theme = theme_waasb(),
         alpha = 0.2, fill.hist = "gray", col.hist = "black",
         col.point = "black", col.line = "red", col.lab.out = "red",
         size.lab.out = 2.5, size.tex.lab = 10, size.shape = 1.5,
         bins = 30, which = c(1:4), mfrow = c(2, 2), ...)


## S3 method for class 'WAASB'
autoplot(x, type = "res", conf = 0.95, out = "print",
         labels = FALSE, theme = theme_waasb(),
         alpha = 0.2, fill.hist = "gray", col.hist = "black",
         col.point = "black", col.line = "red", col.lab.out = "red",
         size.lab.out = 2.5, size.tex.lab = 10, size.shape = 1.5,
         bins = 30, which = c(1:4), mfrow = c(2, 2), ...)

Arguments

x

An object of class WAAS.AMMI or WAASB.

type

If type = "re", normal Q-Q plots for the random effects are obtained.

conf

Level of confidence interval to use in the Q-Q plot (0.95 by default).

out

How the output is returned. Must be one of the "print" (default) or "return".

labels

Logical argument. If TRUE labels the points outside confidence interval limits.

theme

The theme to use in the graphics. Default is theme = theme_waasb().

alpha

The transparency of confidence band in the Q-Q plot. Must be a number between 0 (opaque) and 1 (full transparency).

fill.hist

The color to fill the histogram. Default is "gray".

col.hist

The color of the border of the the histogram. Default is "black".

col.point

The color of the points in the graphic. Default is "black".

col.line

The color of the lines in the graphic. Default is "red".

col.lab.out

The color of the labels for the "outlying" points.

size.lab.out

The size of the labels for the "outlying" points.

size.tex.lab

The size of the text in axis text and labels.

size.shape

The size of the shape in the plots.

bins

The number of bins to use in the histogram. Default is 30.

which

Which graphics should be plotted. Default is which = c(1:4) that means that the first four graphics will be plotted.

mfrow

Allow creating a simple multi-paneled plot. Must be a vector of length 2. The first argument is the number of rows and the second the number of columns. Default is mfrow = c(2, 2).

...

Additional parameter for the function

Author(s)

Tiago Olivoto [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(METAAB)
library(ggplot2)
model = WAAS.AMMI(data_ge,
                  resp = GY,
                  gen = GEN,
                  env = ENV,
                  rep = REP)
autoplot(model$GY)


model2 = WAASB(data_ge,
               resp = c(GY, HM),
               gen = GEN,
               env = ENV,
               rep = REP)
lapply(model2, function(x){
  autoplot.WAASB(x, which = 2, out = "return")
})

TiagoOlivoto/WAASB documentation built on April 1, 2019, 10:25 a.m.