The phase predictors a cycle added by ctModelPeriodicComponent reads
Source:R/ctModelPeriodicComponent.R
ctPeriodicPhases.RdAdds to long format data, for each subject, the cosine and sine of the
time of its first row over period: the columns <name>_cos0
and <name>_sin0 that ctModelPeriodicComponent sets its
cycle from.
Arguments
- datalong
Long format data, one row per observation.
- period
The cycle's period, in the data's time units.
- name
The cycle's name, as given to
ctModelPeriodicComponent.- id, time
The subject and time columns.
Examples
d <- data.frame(id = rep(1:2, each = 3), time = c(8, 12, 20, 33, 37, 45))
ctPeriodicPhases(d, period = 24)