plot_residDiagnostics: Plots for residuals diagnostics

View source: R/plot_residDiagnostics.R

plot_residDiagnosticsR Documentation

Plots for residuals diagnostics

Description

Visualization of residuals diagnostics for a fitted linear mixed model of tumor growth data.

Usage

plot_residDiagnostics(model)

Arguments

model

An object of class "lme" representing the linear mixed-effects model fitted by lmmModel().

Value

A list with different plots for evaluating the normality and homoscedasticity of the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix, see nlme::residuals.lme), including:

  • A normal Q-Q plot of the normalized residuals of the model.

  • A normal Q-Q plot of the normalized residuals of the model by Time.

  • A normal Q-Q plot of the normalized residuals of the model by Treatment.

  • A dotplot of normalized residuals vs fitted values.

  • A dotplot of the normalized residuals by Time and Treatment.

Examples

data(grwth_data)
# Fit the model
lmm <- lmmModel(
  data = grwth_data,
  sample_id = "subject",
  time = "Time",
  treatment = "Treatment",
  tumor_vol = "TumorVolume",
  trt_control = "Control",
  drug_a = "DrugA",
  drug_b = "DrugB",
  combination = "Combination",
  show_plot = FALSE
  )
# Generate plots 
plot_residDiagnostics(lmm)
# Access to specific plots
plot_residDiagnostics(lmm)[[1]]
plot_residDiagnostics(lmm)[[2]]

SynergyLMM documentation built on April 4, 2025, 4:13 a.m.