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.
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
.
idAll
[vector(character)]
: Single identifier
for each of the longData (each individual). Usefull to export clusters.
idFewNA
[vector(character)]
: Restriction of
idAll
to the trajectories that does not have 'too many' missing
value. See maxNA
for '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 matrix
traj
(ie dimTraj=c(length(idFewNA),length(time))
).
maxNA
[numeric]
or [vector(numeric)]
:
Individual whose trajectories contain 'too many' missing value
are exclude from traj
and will no be use in
the analysis. Their identifier is preserved in idAll
but
not in idFewNA
. 'too many' is define by maxNA
: a
trajectory with more missing than maxNA
is exclude.
reverse
[matrix(numeric)]
: if the trajectories
are scale using the function scale
, the 'scaling
parameters' (probably mean and standard deviation) are saved in
reverse
. This is usefull to restore the original data after a
scaling operation.
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
.
[vecteur(character)]: Gets the full list of individual
identifiant (the value of the slot idAll
)
[vecteur(character)]: Gets the list of individual
identifiant with not too many missing values (the value of the slot idFewNA
)
[character]: Gets the name(s) of the variable (the value of the slot varNames
)
[vecteur(numeric)]: Gets the times (the value of the slot time
)
[array(numeric)]: Gets all the longData' values (the value of the slot traj
)
[vector3(numeric)]: Gets the dimension of traj
.
[numeric]: Gets the first dimension of
traj
(ie the number of individual include in the analysis).
[numeric]: Gets the second dimension of
traj
(ie the number of time measurement).
[numeric]: Gets the third dimension of
traj
(ie the number of variables).
[vecteur(numeric)]: Gets maxNA.
[matrix(numeric)]: Gets the matrix of the scaling parameters.
scale
scale the trajectories. Usefull to normalize variable trajectories measured with different units.
restoreRealData
restore original data that have been modified after a scaling operation.
% \item{\code{\link{generateArtificialLongData}} (or % \code{\link{gald}})}{Generate an artifial dataset of a single variable-trajectory.} % \item{\code{\link{generateArtificialLongData3d}} (or % \code{\link{gald3d}})}{Generate a artifial dataset of some joint % variable-trajectory.}
longDataFrom3d
Extract a variable trajectory form a dataset of joint trajectories.
plotTrajMeans
plot all the variables of the LongData
, optionnaly according to a Partition
.
plotTrajMeans3d
plot two variables of the LongData
in 3 dimensions, optionnaly according to a Partition
.
plot3dPdf
create '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.
imputation
Impute the missing values of the trajectories.
qualityCriterion
Compute some quality criterion that
can be use to compare the quality of differents Partition
.
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
[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
Overview: longitudinalData-package
Methods: longData
, longData3d
, imputation
, qualityCriterion
Plot: plotTrajMeans
,
plotTrajMeans3d
, plot3dPdf
#################
### 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"))
Run the code above in your browser using DataLab