exponential_mixed_model {GrowthCurveME} | R Documentation |
Fit an exponential mixed-effects regression model
Description
This function is utilized within the
growth_curve_model_fit
function for fitting a mono-exponential
mixed-effects regression model to growth data utilizing the saemix package.
Starting values are derived from an initial least-squares model using
the nlsLM
function.
Usage
exponential_mixed_model(
data_frame,
model_type = "mixed",
fixed_rate = TRUE,
num_chains = 1,
seed = NULL
)
Arguments
data_frame |
A data frame object that at minimum contains three variables:
|
model_type |
A character string specifying the type of regression model to be used. If 'mixed', a mixed-effects regression model will be used with fixed and random-effects to account for clustering. For 'least-squares', a least-squares regression model with only fixed-effects is applied. Defaults to "mixed". |
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 |
num_chains |
A numeric value specifying the number of chains to run in parallel in the MCMC algorithm of saemix. Increasing the number of chains may improve convergence but may also increase the computational time. Defaults to 1. |
seed |
A numeric value specifying a seed number to reproduce the random starting values sampled within the function. Defaults to NULL. |
Value
Returns an exponential model object of class 'SaemixObject' when a mixed-effects model is specified or a model object of class 'nls' if a least-squares model is specified.
See Also
Examples
# Load example data (exponential data from GrowthCurveME package)
data(exp_mixed_data)
# Fit an exponential mixed-effects growth model
exp_mixed_model <- growth_curve_model_fit(
data_frame = exp_mixed_data,
function_type = "exponential"
)
# Fit an exponential mixed-effected model using exponential_mixed_model()
exp_mixed_model <- exponential_mixed_model(data_frame = exp_mixed_data)