plot_qqmodel {grafify} | R Documentation |
Plot quantile-quantile (QQ) graphs from residuals of linear models.
Description
This function takes a linear model (simple or mixed effects) and plots a QQ graph after running rstudent
from rstudent
to generate a table of Studentised model residuals on an ordinary (simple_model
), mixed model (mixed_model
or mixed_model_slopes
. The graph plots studentised residuals from the model (sample) on Y axis & Theoretical quantiles on X axis.
Usage
plot_qqmodel(
Model,
symsize = 3,
s_alpha = 0.8,
fontsize = 20,
symthick,
linethick,
SingleColour = "#E69F00"
)
Arguments
Model |
name of a saved model generated by |
symsize |
size of symbols, default set to 3. |
s_alpha |
fractional opacity of symbols, default set to 0.8 (i.e., 80% opacity). |
fontsize |
parameter of |
symthick |
thickness of symbol border, default set to |
linethick |
thickness of line, default set to |
SingleColour |
colour of symbols (default = |
Details
For generalised additive models fit with mgcv
, scaled Pearson residuals are plotted.
The function uses ggplot2[geom_qq]
and ggplot2[geom_qq_line]
geometries. Symbols receive "ok_orange" colour by default.
Value
This function returns a ggplot2
object of class "gg" and "ggplot".
Examples
#Basic usage
m1 <- simple_model(data = data_2w_Festing,
Y_value = "GST",
Fixed_Factor = c("Treatment", "Strain"))
plot_qqmodel(m1)