ClusterizLongData-class {kml}R Documentation

~ Class: ClusterizLongData ~

Description

ClusterizLongData is an objet containing trajectories and associated clusterizations.

Objects from the Class

kml is an algorithm that builds an set of Clusterization from longitudinal data. ClusterizLongData is the object contaning the original longitudinal data and all the Clusterization that kml finds.

When created, a class ClusterizLongData object simply contains initial data (the trajectories). After the execution of kml, it contains the original data and the Clusterization which has just been calculated by kml.

Please note that if kml is executed several times, every new Clusterization are added to the original ones, no pre-existing Clusterization is erased.

Slots

id
[character]: single identifier for each of the trajectories, which is to say each individual.
time
[numeric]: time during which measures were made.
traj
[array(numeric)]: contains longitudinal data. Each line corresponds to the trajectory of an individual. The columns refer to the time during which measures were made.
varName
[character]: Name of the variable measured.
trajSizeMin
[numeric]: Trajectories whose values are partially missing can either be excluded or included in the computation. trajSizeMin sets the minimum number of values that a trajectory must contain to not be excluded. For example, if the trajectories have 7 mesurements (time=7) and trajSizeMin is set to 3, the trajectory (5,3,NA,4,NA,NA,NA) will be include in the calculation while (2,NA,NA,NA,4,NA,NA) will be exclude. Please note that trajectories that are totally missing (i.e. 0 present values) are always excluded.
clusters
[list(list(Clusterization))]: clusters contains the list of Clusterization found by kml. More specifically, clusterizList contains twenty five items : c1, c2, c3, c4 up to c25. Each item contains a list of Clusterization: c2 contains the Clusterization having 2 clusters, c3 contains the Clusterization having 3 clusters and so on. Note that c1 is not used for regular Clusterization but for trajectories that are artificialy generated, it contain the "true" clusterization, .

Construction

Class ClusterizLongData objects can be constructed via function cld (build from scratch), via gald (generation of artificial longitudinal data) or via as.cld (turning a data.frame into a ClusterizLongData).

Get [

Object["id"]
[vecteur(character)]: Gets each individual indentifiant (the value of the slot id)
Object["time"]
[vecteur(numeric)]: Gets the times (the value of the slot time)
Object["varName"]
[character]: Gets the name of the variable (the value of the slot varName)
Object["trajSizeMin"]
[numeric]: Gets the limit for not excluding a trajectory countaining missing values (the value of the slot trajSizeMin)
Object["traj"]
[matrix(numeric)]: Gets all the trajectories' values (the value of the slot traj)
Object["traj",3]
[matrix(numeric)]: Gets the trajectorie of the individual 3.
Object["clusters"]
[list(list(Clusterization))]: Gets the list off all the sublist of Clusterization contain in the object.
Object["clusters",3]
[list(Clusterization)]: Gets the sublist "c3", the sublist that contain all the Clusterization with 3 clusters.
Object["clusters",c(3,2)]
[Clusterization]: Get the second Clusterization off the sublist "c3".
Object["calinski"]
[calinski, matrix(numeric)]: Gets the matrix of the Calinski criterion for all the Clusterization contain in the object. The class of Object["calinski"] is c("calinski","matrix"). The calinski class is used only for graphical output.
Object["calinski",4]
[vecteur(numeric)]: Gets the Calinski criterion for the "c4" sublist.
Object["calinski",c(4,5)]
[numeric] Gets the fifth Calinski criterion of the "c4" list.

Set [<-

Object["id"]<-value
[vecteur(character)]: Sets each individual indentifiant to value
Object["time"]<-value
[vecteur(numeric)]: Sets the times to value.
Object["varName"]<-value
[character]: Sets the name of the variable to value)
Object["trajSizeMin"]<-value
[numeric]: Sets the limit for not excluding a trajectory with missing value to value.
Object["traj"]
[matrix(numeric)]: Sets all the trajectories' to values.
Object["traj",3]
[matrix(numeric)]: Sets the trajectorie of the individual 3 to value.
Object["clusters","add"]<-value
[Clusterization]: Adds the Clusterization to the corresponding sublist (the sublist that contain Clusterization with that same number of clusters that the one curently added), then sorts the sublist by decreasing Calinski criterion value (highest Calinski firsts).
Object["clusters","clear"]<-value
[numeric]: Empty the sublist "c-value", that is the sublist of Clusterization with value clusters.
Object["clusters","clear"]<-"all"
[numeric]: Empty all the sublist of clusters.
Object["clusters"]<-value
[Clusterization]: Short cut for Object["clusters","add"]<-value.

Methods

kml
kml is the algorithm that construct a new Clusterization and add it to the one already calculated.
choice
choice enables you to display all the Clusterization found, to choose some and export them.

Author(s)

Christophe Genolini
PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health
INSERM U669 / Maison de Solenn / Paris

Contact author : <genolini@u-paris10.fr>

English translation

Raphaël Ricaud
Laboratoire "Sport & Culture" / "Sports & Culture" Laboratory
University of Paris 10 / Nanterre

References

Article submited
Web site: http://christophe.genolini.free.fr/kml

See Also

Overview: kml-package
Classes : Clusterization, ArtificialLongData
Methods : clusterizLongData, kml, choice, as.clusterizLongData
Plot : plot: overview, plot(ClusterizLongData), plot(Calinski), plotSubGroups(ClusterizLongData), plotAll(ClusterizLongData)

Examples

showClass("ClusterizLongData")
mat <- matrix(c(1,2,3,1,4,6,1,8,10),3)
ld <- new("ClusterizLongData",id=c("1","2","3"),time=c(2,4,8),varName="Age",traj=mat,trajSizeMin=2)
ld["id"]
ld["time"]<- c(1,3,9)
ld["varName"]
ld["traj"]
ld["traj",3]<-c(2,7,9)
(ld)

[Package kml version 0.9.2 Index]