metan (version 1.2.1)

plot.waas: Several types of residual plots

Description

Residual plots for a output model of class waas. Seven types 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, and (7) 1:1 line plot

Usage

# S3 method for waas
plot(
  x,
  var = 1,
  conf = 0.95,
  labels = FALSE,
  plot_theme = theme_metan(),
  band.alpha = 0.2,
  point.alpha = 0.8,
  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),
  ncol = NULL,
  nrow = NULL,
  ...
)

Arguments

x

An object of class waas.

var

The variable to plot. Defaults to var = 1 the first variable of x.

conf

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

labels

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

plot_theme

The graphical theme of the plot. Default is plot_theme = theme_metan(). For more details, see theme.

band.alpha, point.alpha

The transparency of confidence band in the Q-Q plot and the points, respectively. 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.

ncol, nrow

The number of columns and rows of the plot pannel. Defaults to NULL

...

Additional arguments passed on to the function plot_grid

Examples

Run this code
# NOT RUN {
library(metan)
model <- performs_ammi(data_ge, ENV, GEN, REP, GY)
model2 <- waas(data_ge, ENV, GEN, REP, GY)
plot(model)
plot(model2,
     which = c(3, 5),
     ncol = 2,
     labels = TRUE,
     size.lab.out = 4)
# }

Run the code above in your browser using DataCamp Workspace