Skip to contents

This function creates a diagonal plot for a linear mixed effects model using the ggplot2 package. The plot includes a scatterplot of the residuals versus the fitted values, a Q-Q plot of the residuals, and a histogram of the residuals.

Usage

diag_plot_lmer(model)

Arguments

model

a linear mixed effects model created using the lme4 package

Value

a ggplot2 object representing the diagonal plot

Examples

library(lme4)
model <- lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)
diag_plot_lmer(model)