lcMethodRandom: Specify a random-partitioning method

View source: R/methodRandom.R

lcMethodRandomR Documentation

Specify a random-partitioning method

Description

Creates a model with random cluster assignments according to the random cluster proportions drawn from a Dirichlet distribution.

Usage

lcMethodRandom(
  response,
  alpha = 10,
  center = meanNA,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  nClusters = 2,
  name = "random",
  ...
)

Arguments

response

The name of the response variable.

alpha

The Dirichlet parameters. Either scalar or of length nClusters. The higher alpha, the more uniform the clusters will be.

center

Optional function for computing the longitudinal cluster centers, with signature (x).

time

The name of the time variable.

id

The name of the trajectory identification variable.

nClusters

The number of clusters.

name

The name of the method.

...

Additional arguments, such as the seed.

References

\insertRef

frigyik2010introductionlatrend

See Also

Other lcMethod implementations: getArgumentDefaults(), getArgumentExclusions(), lcMethod-class, lcMethodAkmedoids, lcMethodCrimCV, lcMethodDtwclust, lcMethodFeature, lcMethodFunFEM, lcMethodFunction, lcMethodGCKM, lcMethodKML, lcMethodLMKM, lcMethodLcmmGBTM, lcMethodLcmmGMM, lcMethodMclustLLPA, lcMethodMixAK_GLMM, lcMethodMixtoolsGMM, lcMethodMixtoolsNPRM, lcMethodStratify

Examples

data(latrendData)
method <- lcMethodRandom(response = "Y", id = "Id", time = "Time")
model <- latrend(method, latrendData)

# uniform clusters
method <- lcMethodRandom(
  alpha = 1e3,
  nClusters = 3,
  response = "Y",
  id = "Id",
  time = "Time"
)

# single large cluster
method <- lcMethodRandom(
  alpha = c(100, 1, 1, 1),
  nClusters = 4,
  response = "Y",
  id = "Id",
  time = "Time"
)

latrend documentation built on March 31, 2023, 5:45 p.m.