pwtime | R Documentation |
pwtime - function to make piecewise time variables for a multiphase study
pwtime(time, phase)
time |
Numeric vector. A sequence of study times. If any times are negative (e.g., if time is center at 0 between the first and second phase) it is rescale to have a minimum of 0 so that the first observation within each phase has time=0. |
phase |
Numeric or character vector of the same length as time. The phases within which time is rescale to create the time variables needed for a piecewise growth model. |
Stephen Tueller Stueller@rti.org
pwtime(-49:50, sort(rep(letters[1:5], length.out = 100)))
## Not run:
# time should not be scaled in [0,1] or similar, rescale to integer
OvaryICT2 <- OvaryICT
OvaryICT2$Time <- round(OvaryICT2$Time*30)
p1 <- Palytic$new(data = OvaryICT2, ids='Mare', dv='follicles',
time='Time', phase='Phase', alignPhase = 'none')
p2 <- Palytic$new(data = OvaryICT2, ids='Mare', dv='follicles',
time='Time', phase='Phase', alignPhase = 'piecewise')
summary(p1$lme())
summary(p2$lme())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.