Two-step clustering through linear regression modeling and k-means

lcMethodLMKM(
  formula,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  nClusters = 2,
  center = meanNA,
  standardize = scale,
  ...
)

Arguments

formula

A formula specifying the linear trajectory model.

time

The name of the time variable.

id

The name of the trajectory identification variable.

nClusters

The number of clusters to estimate.

center

A function that computes the cluster center based on the original trajectories associated with the respective cluster. By default, the mean is computed.

standardize

A function to standardize the output matrix of the representation step. By default, the output is shifted and rescaled to ensure zero mean and unit variance.

...

Arguments passed to stats::lm. The following external arguments are ignored: x, data, control, centers, trace.

Examples

data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time", nClusters = 3)
model <- latrend(method, latrendData)