plot_resqq: Normal quantile plot for residuals

Description Usage Arguments Details Value Examples

View source: R/plot_resqq.R

Description

Creates a normal quantile plot of the raw conditional residuals. For linear mixed models, these residuals are expected to be normally distributed. This plot can be used to assess this assumption.

Usage

1
plot_resqq(model)

Arguments

model

Model fit using lmer from lme4.

Details

Confidence bands are constructed pointwise 95% normal confidence intervals.

Value

A normal quantile plot in the form of a ggplot2 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# fits a linear mixed effect model using lme4 where model has a
# random intercept for Days and random slope for Subject*Days
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)

# checks that error term is normally distributed
plot_resqq(fm1)

# edits theme of ggplot2 object
library(ggplot2)
plot_resqq(fm1) + theme_grey()

goodekat/redres documentation built on March 3, 2021, 10:15 a.m.