| LongData3d-class {longitudinalData} | R Documentation |
~ Class: LongData3d ~
Description
LongData3d is an objet containing joint longitudinal
data and some associate value (like time, individual
identifiant,...).
Objects from the Class
Object LongData3d can be created using
the fonction longData3d on a data.frame or on an array.
Slots
idAll[vector(character)]: Single identifier for each of the longData3d (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[vector(character)]: Names of the variable measured.traj[array(numeric)]: Contains the joint variable-trajectories. Each horizontal plan (first dimension) corresponds to the joint-trajectories of an individual. Vertical plans (second dimension) refer to the time at which measures are made. Transversal plans (the third dimension) are for variables.dimTraj[vector3(numeric)]: size of the arraytraj(iedimTraj=c(length(idFewNA),length(time),length(varNames))).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. WhenmaxNAis a single number, it is recycled for all the variables.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
LongData3d 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 joint trajectories (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.
longDataFrom3dCreate a
LongDataby extracting a single variable trajectory form a dataset of joint variable-trajectories.plotTrajMeansplot all the variable of the
LongData3d, optionnaly according to aPartition.plotTrajMeans3dplot two variables of the
LongData3din a 3 dimensions graph, 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 joint trajectories
dn <- data.frame(id=1:3,v1=c(11,14,16),t1=c(1,5,7),v2=c(12,10,13),t2=c(2,5,0),t3=c(3,6,8))
(ld <- longData3d(dn,timeInData=list(Vir=c(2,4,NA),Tes=c(3,5,6))))
### Scaling
scale(ld)
(ld)
### Plotting
plotTrajMeans3d(ld)
restoreRealData(ld)