amp_acro {GLMMcosinor} | R Documentation |
Used to specify a cosinor component in the model formula.
Description
Checks the validity of user inputs before creating an updated formula
and associated modifications to the data.frame
.
Usage
amp_acro(time_col, n_components = 1, group, period, ...)
Arguments
time_col |
A |
n_components |
The Number of cosinor components in the model. |
group |
A vector of the names for the group factors (column names
within the |
period |
A |
... |
Extra arguments for use within |
Value
A data.frame
and formula
appropriate for use by
data_processor()
.
Examples
# Single component cosinor model
cglmm(
vit_d ~ amp_acro(time_col = time, group = "X", period = 12),
data = vitamind
)
# 2-component cosinor model with simulated data
sim_data <- simulate_cosinor(
n = 500,
mesor = 5,
amp = c(2, 1),
acro = c(1, 1.5),
beta.mesor = 2,
beta.amp = c(2, 1),
beta.acro = c(1, 1.5),
family = "gaussian",
period = c(12, 6),
n_components = 2,
beta.group = TRUE,
)
cglmm(
Y ~ group + amp_acro(times,
n_components = 2,
group = "group",
period = c(12, 6)
),
data = sim_data,
family = gaussian
)
[Package GLMMcosinor version 0.2.0 Index]