View source: R/logistic_mixed_model.R
logistic_mixed_model | R Documentation |
This function is utilized within the
growth_curve_model_fit
function for fitting a logistic
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.
logistic_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 logistic 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.
growth_curve_model_fit
# Load example data (logistic data from GrowthCurveME package)
data(log_mixed_data)
# Fit a logistic mixed-effects growth model to the data
log_mixed_model <- growth_curve_model_fit(data_frame = log_mixed_data,
function_type = "logistic")
# Fit a logistic mixed-effects model using logistic_mixed_model()
log_mixed_model <- logistic_mixed_model(data_frame = log_mixed_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.