generateArtificialLongData3d {kml3d} | R Documentation |
~ Function: generateArtificialLongData3d (or gald3d) ~
Description
This function builp up an artificial longitudinal data set (joint
trajectories) an turn them
into an object of class ClusterLongData
.
Usage
gald3d(nbEachClusters=50,time=0:10,varNames=c("V","T"),
meanTrajectories=list(function(t){c(0,0)},
function(t){c(10,10)},function(t){c(10-t,10-t)}),
personalVariation=function(t){c(rnorm(1,0,2),rnorm(1,0,2))},
residualVariation=function(t){c(rnorm(1,0,2),rnorm(1,0,2))},
decimal=2,percentOfMissing=0)
generateArtificialLongData3d(nbEachClusters=50,time=0:10,varNames=c("V","T"),
meanTrajectories=list(function(t){c(0,0)},
function(t){c(10,10)},function(t){c(10-t,10-t)}),
personalVariation=function(t){c(rnorm(1,0,2),rnorm(1,0,2))},
residualVariation=function(t){c(rnorm(1,0,2),rnorm(1,0,2))},
decimal=2,percentOfMissing=0)
Arguments
nbEachClusters |
|
time |
|
varNames |
|
meanTrajectories |
|
personalVariation |
|
residualVariation |
|
decimal |
|
percentOfMissing |
|
Details
generateArtificialLongData3d
(gald3d
in short) is a
function that contruct a set of artificial joint longitudinal data.
Each individual is considered as belonging to a group. This group
follows a theoretical trajectory, function of time.
These functions (one per group) are given via the argument meanTrajectories
.
Within a group, the individual undergoes individal
variations. Individual variations are given via the argument residualVariation
.
The number of individuals in each group is given by nbEachClusters
.
Finally, it is possible to add missing values randomly (MCAR) striking the
data thanks to percentOfMissing
.
Value
Object of class ClusterLongData
.
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
ClusterLongData3d
, clusterLongData3d
, generateArtificialLongData
Examples
#####################
### Default example
ex1 <- generateArtificialLongData3d()
plot3d(ex1,parTraj=parTRAJ(col=rep(2:4,each=50)))
#####################
### 4 lines with unbalanced groups
ex2 <- generateArtificialLongData3d(
nbEachClusters=c(5,10,20,40),
meanTrajectories=list(
function(t)c(t,t^3/100),
function(t)c(0,t),
function(t)c(t,t),
function(t)c(0,t^3/100)
),
residualVariation = function(t){c(rnorm(1,0,1),rnorm(1,0,1))}
)
plot3d(ex2,parTraj=parTRAJ(col=rep(1:4,time=c(5,10,20,40))))