summarize_growth_model_mixed {GrowthCurveME} | R Documentation |
Summarize mixed-effects growth model object and data
Description
This function is used within the summarize_growth_model
function to create a list object of
data frames based on a user's input data frame and output mixed-effects
growth model object from growth_curve_model_fit
.
The list object (referred to in this package as 'growth_model_summary_list')
can be used to extract model predicted values, residuals, and can be
inputted into supporting functions from GrowthCurveME to generate plots and
perform model diagnostics.
Usage
summarize_growth_model_mixed(
data_frame,
mixed_growth_model,
function_type = "exponential",
fixed_rate = TRUE,
time_unit = "hours"
)
Arguments
data_frame |
A data frame object that at minimum contains three variables:
|
mixed_growth_model |
The mixed-effects model object that is created
using the |
function_type |
A character string specifying the function for modeling the shape of the growth. Options include "exponential", "linear", "logistic", or "gompertz". |
fixed_rate |
A logical value specifying whether the rate constant of the function should be treated as a fixed effect (TRUE) or random effect (FALSE). Defaults to TRUE |
time_unit |
A character string specifying the units in which time is measured in. Defaults to "hours" |
Value
A list object with the following data frames within the list:
model_summary_wide - a data frame with 1 row containing key model estimates, doubling-time, and model metrics depending on the model_type and function_type specified
model_summary_long - a data frame that is a long dataset version of 'model_summary_wide' that can be used to generate a table of the model results (see function
growth_model_summary_table
)model_residual_data - a data frame containing the original data frame values as well as predicted values, residuals, and theoretical quantiles of the residuals depending on the model_type selected (see functions
growth_model_residual_plots
andgrowth_vs_time_plot
)model_sim_pred_data - a data frame with estimates and 95% prediction intervals (not to be confused with the 95% confidence intervals calculated from the model estimates), for mixed-effects models, values are calculated as the median estimate and the 2.5th and 97.5th percentiles of the simulated data from the saemix model at each time point (see
compute.sres
andplot
with plot.type = "vpc"). For least-squares models, prediction intervals are calculated through Taylor-series approximations using thepredFit
function.
See Also
growth_curve_model_fit
summarize_growth_model
Examples
# Load example data (exponential data)
data(exp_mixed_data)
# Fit an mixed-effects growth model to the data
exp_mixed_model <- growth_curve_model_fit(
data_frame = exp_mixed_data,
function_type = "exponential",
return_summary = FALSE)
# Summarize the data by creating a summary list object
exp_mixed_model_summary <- summarize_growth_model_mixed(
data_frame = exp_mixed_data,
mixed_growth_model = exp_mixed_model,
fixed_rate = TRUE,
function_type = "exponential",
time_unit = "hours")
model_summary_wide <- exp_mixed_model_summary[["model_summary_wide"]]