Learn R Programming

SynergyLMM (version 1.1.2)

plot_ranefDiagnostics: Plots for random effects diagnostics

Description

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

Usage

plot_ranefDiagnostics(model)

Value

A list with different plots for evaluating the normality and homoscedasticity of the random effects, including:

  • A normal Q-Q plot of the random effects of the model.

  • A normal Q-Q plot of the residuals by sample.

  • Boxplots of the "raw" residuals (observed - fitted) by sample.

  • Scatter plots of the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix, see nlme::residuals.lme) vs fitted values by sample. Observations with absolute standardized (normalized) residuals greater than the \(1-0.05/2\) quantile of the standard normal distribution are identified in the plots labelled with the time point corresponding to the observation.

Arguments

model

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

Examples

Run this code
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_ranefDiagnostics(lmm)
# Access to specific plots
plot_ranefDiagnostics(lmm)$plots[[1]]
plot_ranefDiagnostics(lmm)$plots[[2]]

Run the code above in your browser using DataLab