View source: R/plot_residDiagnostics.R
plot_residDiagnostics | R Documentation |
Visualization of residuals diagnostics for a fitted linear mixed model of tumor growth data.
plot_residDiagnostics(model)
model |
An object of class "lme" representing the linear mixed-effects model fitted by |
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.
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]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.