Description Usage Arguments Value Examples
This function fits the cyclic model on ESM data, using a multilevel model (see Verboon & Leontjevas, 2018)
1 2 3 |
dat |
data frame containing variables |
yvar |
dependent variable |
xvar1 |
time variabele indicator of first or only cycle |
xvar2 |
time variabele indicator of second (longer) cycle |
id |
group (subjects, clusters) identifier |
cov |
additional variabels in the model |
ncycle |
is the number of cyclic processes in the model (1 = 1, otherwise = 2) |
P |
is the periodicity of the first cyclic process |
P2 |
is the periodicity of the second cyclic process |
random |
keyword indicating which terms should be random effect in the model. The following keywords are available: "intercept"= intercept only; "first"= cyclic parameters of first cyclic process; "second" = cyclic parameters of second cyclic process; "cov" = covariates only, no cyclic terms; and finally "all" = all terms |
list containing the following elements:
parameters = intercept, amplitude and phase (and other terms in the model)
fit = object from lmer()
formula = specification of lmer model
period = specified periodicity of cyclic process
1 2 3 4 | data("smokedat")
model <- fitCyclicMLA(dat=smokedat, yvar="intention", xvar1="beepnr",
xvar2="daynr", id = "subjnr", random = "all",
ncycle = 1, cov = c("stress", "positiveAffect"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.