growth_model_residual_plots {GrowthCurveME}R Documentation

Create residual diagnostic plots for growth model

Description

This function provides a wrapper to ggplot2 for generating residual diagnostic plots and summary statistics for a growth model summary list object produced by growth_curve_model_fit.

Usage

growth_model_residual_plots(
  growth_model_summary_list,
  residual_type = "cluster",
  weighted = TRUE
)

Arguments

growth_model_summary_list

A list object created by the growth_curve_model_fit function.

residual_type

A character string specifying the type of residuals to be displayed in the plot. Options include "population" for the fixed-effects residuals for mixed-effects and least-squares models and "cluster" for fixed and random-effects residuals for mixed-effects regression models. Defaults to "cluster".

weighted

A logical value, when TRUE displays weighted residuals for mixed-effects models or standardized residuals for least-squares models, when FALSE displays the raw residuals for mixed-effects and least-squares models. Defaults to "TRUE".

Value

Returns a patchwork collage of ggplot2 model diagnostic plots with the following plots displayed:

See Also

growth_curve_model_fit

Examples


# Load example data (exponential data)
data(exp_mixed_data)
# Fit an mixed-effects growth model to the data and produce summary list
exp_mixed_model_summary <- growth_curve_model_fit(
data_frame = exp_mixed_data,
function_type = "exponential",
verbose = FALSE)
# Check residuals and model assumptions
residual_diag_plot <- growth_model_residual_plots(
  growth_model_summary_list = exp_mixed_model_summary)
print(residual_diag_plot)


[Package GrowthCurveME version 0.1.11 Index]