Step3Clusters {traj}R Documentation

Classify the Longitudinal Data Based on the Selected Measures.

Description

Classifies the trajectories by applying the k-means clustering algorithm to the measures selected by Step2Selection.

Usage

Step3Clusters(
  trajSelection,
  nclusters = NULL,
  nstart = 200,
  iter.max = 100,
  K.max = 8,
  B = 500,
  d.power = 2,
  spaceH0 = "scaledPCA",
  method = "Tibs2001SEmax",
  SE.factor = 1
)

## S3 method for class 'trajClusters'
print(x, ...)

## S3 method for class 'trajClusters'
summary(object, ...)

Arguments

trajSelection

object of class trajSelection as returned by Step2Selection.

nclusters

either NULL or the desired number of clusters. If NULL, the number of clustersis determined using the GAP criterion as implemented in the clusGap function.

nstart

to be passed to the nstart argument of kmeans.

iter.max

to be passed to the iter.max argument of kmeans.

K.max

to be passed to the K.max argument of clusGap.

B

to be passed to the SE.factor argument of clusGap.

d.power

to be passed to the B argument of clusGap.

spaceH0

to be passed to the spaceH0 argument of clusGap.

method

to be passed to the method argument of clusGap.

SE.factor

to be passed to the SE.factor argument of clusGap.

x

object of class trajClusters

...

further arguments passed to or from other methods.

object

object of class trajClusters

Value

An object of class trajClusters; a list containing the result of the clustering, the output of the clusGap function, as well as a curated form of the arguments.

See Also

Step2Selection

Examples

## Not run: 
data("trajdata")
trajdata.noGrp <- trajdata[, -which(colnames(trajdata) == "Group")] #remove the Group column

m = Step1Measures(trajdata.noGrp, ID = TRUE, measures = 1:18)
s = Step2Selection(m)

s$RC$loadings

s2 = Step2Selection(m, select = c(3, 13, 11, 15))

c3.part <- Step3Clusters(s2, nclusters = 3)$partition
c4.part <- Step3Clusters(s2, nclusters = 4)$partition
c5.part <- Step3Clusters(s2, nclusters = 5)$partition

## End(Not run)


[Package traj version 2.1.0 Index]