summarize_growth_model_ls {GrowthCurveME} | R Documentation |
Summarize least-squares 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 least-squares 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_ls(
data_frame,
ls_model,
function_type = "exponential",
time_unit = "hours"
)
Arguments
data_frame |
A data frame object that at minimum contains three variables:
|
ls_model |
The least-squares 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". |
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_ls_model <- growth_curve_model_fit(
data_frame = exp_mixed_data,
function_type = "exponential",
model_type = "least-squares",
return_summary = FALSE)
# Summarize the data by creating a summary list object
exp_ls_model_summary <- summarize_growth_model_ls(
data_frame = exp_mixed_data,
ls_model = exp_ls_model,
function_type = "exponential",
time_unit = "hours")