Specify AKMedoids method

lcMethodAkmedoids(
  response,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  nClusters = 3,
  clusterCenter = median,
  crit = "Calinski_Harabasz",
  ...
)

Arguments

response

The name of the response variable.

time

The name of the time variable.

id

The name of the trajectory identification variable.

nClusters

The number of clusters to estimate.

clusterCenter

A function for computing the cluster center representation.

crit

Criterion to apply for internal model selection. Not applicable.

...

Arguments passed to akmedoids::akclustr. The following external arguments are ignored: traj, id_field, k

References

adepeju2020akmedoidslatrend

Examples

data(latrendData)
if (rlang::is_installed("akmedoids")) {
  method <- lcMethodAkmedoids(response = "Y", time = "Time", id = "Id", nClusters = 3)
  model <- latrend(method, data = latrendData)
}