View source: R/gompertz_mixed_model.R
gompertz_mixed_model | R Documentation |
This function is utilized within the
growth_curve_model_fit
function for fitting a Gompertz
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.
gompertz_mixed_model(
data_frame,
model_type = "mixed",
fixed_rate = TRUE,
num_chains = 1,
seed = NULL
)
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. |
Returns a Gompertz model object of class 'SaemixObject' if a mixed-effects model is specified or a model object of class 'nls' if a least-squares model is specified.
growth_curve_model_fit
# Load example data (Gompertz data from GrowthCurveME package)
data(gomp_mixed_data)
# Fit a Gompertz mixed-effects growth model
gomp_mixed_model <- growth_curve_model_fit(
data_frame = gomp_mixed_data,
function_type = "gompertz"
)
# Fit a Gompertz mixed-effected model using gompertz_mixed_model()
gomp_mixed_model <- gompertz_mixed_model(data_frame = gomp_mixed_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.