Description Usage Arguments Details Value Examples
View source: R/resid_interact.R
Creates a panel of interactive residual diagnostic plots given a model. Currently accepts models of type "lm", "glm", "lmerMod", "lmerModLmerTest", "lme", and "glmerMod".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
model |
Model fit using either |
plots |
Plots chosen to include in the panel of plots. The default panel
includes a residual plot, a normal quantile plot, an index plot,
and a histogram of the residuals. (See details in the help file
for |
type |
Type of residuals to use in the plot. If not specified, the
default residual type for each model type is used. (See details in the help file
for |
bins |
Number of bins to use when creating a histogram of the residuals. Default is set to 30. |
smoother |
Indicates whether or not to include a smoother on the index, residual-leverage, location-scale, and residual plots. Specify TRUE or FALSE. Default is set to FALSE. |
qqline |
Indicates whether to include a 1-1 line on the qq-plot. Specify
TRUE or FALSE. Default is set to TRUE. (The option of |
scale |
Scales the size of the graphs in the panel. Takes values in (0,1]. |
theme |
ggplot2 theme to be used. Current options are |
axis.text.size |
Specifies the size of the text for the axis labels of all plots in the panel. |
title.text.size |
Specifies the size of the text for the titles of all plots in the panel. |
title.opt |
Indicates whether or not to include a title on the plots in the panel. Specify TRUE or FALSE. Default is set to TRUE. |
nrow |
Sets the number of rows in the panel. |
Details on the creation of the plots can be found in the details section of
the help file for resid_panel
.
A panel of interactive residual diagnostic plots containing plots specified.
1 2 3 4 5 6 7 8 9 | # Fit a model to the penguin data
penguin_model <- lme4::lmer(heartrate ~ depth + duration + (1|bird), data = penguins)
# Create the default interactive panel
resid_interact(penguin_model)
# Select only the residual plot and qq-plot to be included in the panel,
# set the number of rows to 2, change the theme to classic
resid_interact(penguin_model, plots = c("resid", "qq"), nrow = 2, theme = "classic")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.