test_cosinor_levels {GLMMcosinor} | R Documentation |
Test for differences in a cosinor model between levels of the grouping variable.
Description
Given a time variable and optional covariates, generate inference a cosinor fit. For the covariate named (or vector of covariates), this function performs a Wald test comparing the group with covariates equal to 1 to the group with covariates equal to 0. This may not be the desired result for continuous covariates.
Usage
test_cosinor_levels(
x,
x_str,
param = "amp",
comparison_A,
comparison_B,
component_index = 1,
ci_level = 0.95
)
Arguments
x |
An |
x_str |
A |
param |
A |
comparison_A |
An |
comparison_B |
An |
component_index |
An |
ci_level |
The level for calculated confidence intervals. Defaults to
|
Value
Returns a test_cosinor
object.
Examples
data_2_component <- simulate_cosinor(
n = 10000,
mesor = 5,
amp = c(2, 5),
acro = c(0, pi),
beta.mesor = 4,
beta.amp = c(3, 4),
beta.acro = c(0, pi / 2),
family = "gaussian",
n_components = 2,
period = c(10, 12),
beta.group = TRUE
)
mod_2_component <- cglmm(
Y ~ group + amp_acro(times,
n_components = 2, group = "group",
period = c(10, 12)
),
data = data_2_component
)
test_cosinor_levels(mod_2_component, param = "amp", x_str = "group")