| LongData-class {longitudinalData} | R Documentation |
~ Class: LongData ~
Description
LongData is an objet containing the longitudinal
data (the individual trajectories) and some associate value (like time, individual
identifiant,...). It can be used either for a single
variable-trajectory or for joint variable-trajectories.
Objects from the Class
Object LongData for single variable-trajectory can be created using
the fonction longData on a data.frame or on a matrix.
LongData for joint trajectories can be created by calling
the fonction longData3d on a data.frame or on an array.
Slots
idAll[vector(character)]: Single identifier for each of the longData (each individual). Usefull to export clusters.idFewNA[vector(character)]: Restriction ofidAllto the trajectories that does not have 'too many' missing value. SeemaxNAfor 'too many' definition.time[numeric]: Time at which measures are made.varNames[character]: Name of the variable measured.traj[matrix(numeric)]: Contains the longitudianl data. Each lines is the trajectories of an individual. Each column is the time at which measures are made.dimTraj[vector3(numeric)]: size of the matrixtraj(iedimTraj=c(length(idFewNA),length(time))).maxNA[numeric]or[vector(numeric)]: Individual whose trajectories contain 'too many' missing value are exclude fromtrajand will no be use in the analysis. Their identifier is preserved inidAllbut not inidFewNA. 'too many' is define bymaxNA: a trajectory with more missing thanmaxNAis exclude.reverse[matrix(numeric)]: if the trajectories are scale using the functionscale, the 'scaling parameters' (probably mean and standard deviation) are saved inreverse. This is usefull to restore the original data after a scaling operation.
Construction
Object LongData for single variable-trajectory can be created by calling
the fonction longData on a data.frame or on a matrix.
LongData for joint trajectories can be created by calling
the fonction longData3d on a data.frame or on an array.
Get [
- Object["idAll"]
[vecteur(character)]: Gets the full list of individual identifiant (the value of the slot
idAll)- Object["idFewNA"]
[vecteur(character)]: Gets the list of individual identifiant with not too many missing values (the value of the slot
idFewNA)- Object["varNames"]
[character]: Gets the name(s) of the variable (the value of the slot
varNames)- Object["time"]
[vecteur(numeric)]: Gets the times (the value of the slot
time)- Object["traj"]
[array(numeric)]: Gets all the longData' values (the value of the slot
traj)- Object["dimTraj"]
[vector3(numeric)]: Gets the dimension of
traj.- Object["nbIdFewNA"]
[numeric]: Gets the first dimension of
traj(ie the number of individual include in the analysis).- Object["nbTime"]
[numeric]: Gets the second dimension of
traj(ie the number of time measurement).- Object["nbVar"]
[numeric]: Gets the third dimension of
traj(ie the number of variables).- Object["maxNA"]
[vecteur(numeric)]: Gets maxNA.
- Object["reverse"]
[matrix(numeric)]: Gets the matrix of the scaling parameters.
Methods
scalescale the trajectories. Usefull to normalize variable trajectories measured with different units.
restoreRealDatarestore original data that have been modified after a scaling operation.
longDataFrom3dExtract a variable trajectory form a dataset of joint trajectories.
plotTrajMeansplot all the variables of the
LongData, optionnaly according to aPartition.plotTrajMeans3dplot two variables of the
LongDatain 3 dimensions, optionnaly according to aPartition.plot3dPdfcreate 'Triangle objects' representing in 3D the cluster's center according to a
Partition. 'Triangle object' can latter be include in a LaTeX file to get a dynamique (rotationg) pdf figure.imputationImpute the missing values of the trajectories.
qualityCriterionCompute some quality criterion that can be use to compare the quality of differents
Partition.
Author
Christophe Genolini
1. UMR U1027, INSERM, Université Paul Sabatier / Toulouse III / France
2. CeRSME, EA 2931, UFR STAPS, Université de Paris Ouest-Nanterre-La Défense / Nanterre / France
References
[1] C. Genolini and B. Falissard
"KmL: k-means for longitudinal data"
Computational Statistics, vol 25(2), pp 317-328, 2010
[2] C. Genolini and B. Falissard
"KmL: A package to cluster longitudinal data"
Computer Methods and Programs in Biomedicine, 104, pp e112-121, 2011
See Also
Overview: longitudinalData-package
Methods: longData, longData3d, imputation, qualityCriterion
Plot: plotTrajMeans,
plotTrajMeans3d, plot3dPdf
Examples
#################
### building trajectory (longData)
mat <- matrix(c(NA,2,3,4,1,6,2,5,1,3,8,10),4)
ld <- longData(mat,idAll=c("I1","I2","I3","I4"),time=c(2,4,8),varNames="Age")
### '[' and '[<-'
ld["idAll"]
ld["idFewNA"]
ld["varNames"]
ld["traj"]
(ld)
### Plot
plotTrajMeans(ld,parMean=parMEAN(type="n"))