ObsvsPred: Observed vs predicted values and performance of the model

View source: R/ObsvsPred.R

ObsvsPredR Documentation

Observed vs predicted values and performance of the model

Description

ObsvsPred allows the user to have a straight forward idea about how the model is fitting the data, providing plots of the predicted regression lines versus the actual data points.

Usage

ObsvsPred(model, nrow = 4, ncol = 5, ...)

Arguments

model

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

nrow

Number of rows of the layout to organize the observed vs predicted plots.

ncol

Number of columns of the layout to organize the observed vs predicted plots.

...

Additional arguments to be passed to performance::model_performance().

Details

The function provides visual and quantitative information about the performance of the model:

  • A layout of the observed and predicted values of log(relative tumor volume) vs Time for each SampleID (i.e. subject), with the actual measurements, the regression line for each SampleID, and the marginal, treatment-specific, regression line for each treatment group.

  • Performance metrics of the model obtain calculated using performance::model_performance(). The maximum likelihood-based Akaike's Information Criterion (AIC), small sample AIC (AICc), and Bayesian Information Criterion, and the Nakagawa's r-squared root mean squared error (RMSE) of the residuals, and the standard deviation of the residuals (sigma) are provided.

Value

Performance metrics of the model obtain calculated using performance::model_performance() and a layout of plots of the observed vs predicted values for each SampleID.

References

  • Andrzej Galecki & Tomasz Burzykowski (2013) Linear Mixed-Effects Models Using R: A Step-by-Step Approach First Edition. Springer, New York. ISBN 978-1-4614-3899-1

  • Lüdecke et al., (2021). performance: An R Package for Assessment, Comparison and Testing of Statistical Models. Journal of Open Source Software, 6(60), 3139. https://doi.org/10.21105/joss.03139

  • Sakamoto, Y., M. Ishiguro, and G. Kitagawa. 1984. Akaike Information Criterion Statistics. Mathematics and Its Applications. Reidel.

  • Nakagawa, Shinichi, and Holger Schielzeth. 2013. A General and Simple Method for Obtaining r2 from Generalized Linear Mixed-effects Models. Methods in Ecology and Evolution 4 (February): 133–42. https://doi.org/10.1111/j.2041-210x.2012.00261.x.

  • Johnson, Paul C. D. 2014. Extension of Nakagawa & Schielzeth’s r 2 GLMM to Random Slopes Models. Methods in Ecology and Evolution 5 (September): 944–46. https://doi.org/10.1111/2041-210X.12225.

  • Nakagawa, Shinichi, Paul C. D. Johnson, and Holger Schielzeth. 2017. The Coefficient of Determination r2 and Intra-Class Correlation Coefficient from Generalized Linear Mixed-Effects Models Revisited and Expanded. Journal of The Royal Society Interface 14 (September): 20170213. https://doi.org/10.1098/rsif.2017.0213.

Examples

# Load the example data
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"
  )
# Obtain Observed vs Predicted plots, and model performance metrics
ObsvsPred(model = lmm, nrow = 4, ncol = 8)

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