Learn R Programming

longitudinalData (version 2.1.2)

LongData-class: ~ 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.

Arguments

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.

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.

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: plotTraj, plotTraj3d, plot3dPdf

Examples

Run this code
#################
### 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
plotTraj(ld)


#################
### building join trajectories (longData3d)
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
plotTraj(ld)
plotTraj3d(ld)
restoreRealData(ld)

Run the code above in your browser using DataLab