Fit a new model with modified arguments from the current model.
# S3 method for class 'lcModel'
update(object, ...)The lcModel object.
Arguments passed on to latrend
methodAn lcMethod object specifying the longitudinal cluster method to apply, or the name (as character) of the lcMethod subclass to instantiate.
dataThe data of the trajectories to which to estimate the method for.
Any inputs supported by trajectories() can be used, including data.frame and matrix.
envirThe environment in which to evaluate the method arguments via compose().
If the data argument is of type call then this environment is also used to evaluate the data argument.
verboseThe level of verbosity. Either an object of class Verbose (see R.utils::Verbose for details),
a logical indicating whether to show basic computation information,
a numeric indicating the verbosity level (see R.utils::Verbose),
or one of c('info', 'fine', 'finest').
The refitted lcModel object, of the same type as the object argument.
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model2 <- latrend(method, latrendData, nClusters = 2)
# fit for a different number of clusters
model3 <- update(model2, nClusters = 3)