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,...)

Objects from the Class

Object LongData can be created either directly by calling the fonction longData or form an existing structure (data.frame or matrix) by using as.longData.

Slots

id
[character]: Single identifier for each of the longData (each individual).
time
[numeric]: Time during which measures were made.
varName
[character]: Name of the variable measured.
traj
[array(numeric)]: Contains the longitudianl data. Each line corresponds to the trajectory of an individual. The columns refer to the time during which measures were made.
other
[list]: list of additionnal information (see section Value in generateArtificialLongData for an example).

Construction

Object LongData can be created either directly by calling the fonction longData (build from scratch) or via as.longData (turning a data.frame into a LongData).

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["traj"]
[matrix(numeric)]: Gets all the longData' values (the value of the slot traj)
Object["traj"][3,]
[matrix(numeric)]: Gets the trajectorie of the individual 3.
Object["traj"][,2]
[matrix(numeric)]: Gets all values corresponding to time 2.
Object["traj"][3,2]
[matrix(numeric)]: Gets the second value of the third trajectorie.

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["traj"]
[matrix(numeric)]: Sets all the longData' to values.
Object["traj"][3,]<-value
[vecteur(numeric)]: Sets the trajectorie of the individual 3 to value.

Methods

plot(LongData)
display the LongData.
plot(LongData,Partition)
display the LongData according to a specific Partition.
plotSubGroups(LongData,Partition)
display one graph for each clusters, sub-groups by sub-groups according to a specificPartition.
selecSupTrajMinSize(LongData,minSize)
select the individual trajectories that are made by at least minSize values (usefull to exclude from the LongData some individual trajectories with to many missing values.)

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>

References

Article submited

See Also

Overview: longitudinalData-package
Methods: longData, as.longData, selectSupTrajMinSize, imputation, criterion
Plot: plot(LongData),plotSubGroups(LongData)

Examples

### building longData
mat <- matrix(c(NA,2,3,4,1,6,2,5,1,3,8,10),4)
ld <- new("LongData",id=c("I1","I2","I3","I4"),time=c(2,4,8),varName="Age",traj=mat)

### '[' and '[<-'
ld["id"]
ld["time"]<- c(1,3,9)
ld["varName"]
ld["traj"]
ld["traj"][3,]<-c(2,7,9)
(ld)

### Plot
plot(ld,type.mean="n",legend=FALSE)

### Only trajectories with at least 3 values
selectSupTrajMinSize(ld,3)

[Package longitudinalData version 0.6 Index]