ClusterLongData
or LongData
.gald(nbEachClusters=c(50,50,50),time=0:10,varNames=c("V1","V2"),
functionClusters=list(function(t){c(0,0)},function(t){c(10,10)},function(t){c(10-t,10-t)}),
functionNoise=function(t){c(rnorm(1,0,3),rnorm(1,0,3))},
decimal=2,percentOfMissing=0,clusterLD=TRUE)
generateArtificialLongData(nbEachClusters=c(50,50,50),time=0:10,varNames=c("V1","V2"),
functionClusters=list(function(t){c(0,0)},function(t){c(10,10)},function(t){c(10-t,10-t)}),
functionNoise=function(t){c(rnorm(1,0,3),rnorm(1,0,3))},
decimal=2,percentOfMissing=0,clusterLD=TRUE)
[vector(numeric)]
: number of trajectories that each
cluster must contain.[vector(numeric)]
: time at which measures are made.[vector(character)]
: names of the variables.[vector(numeric) <- function(t)]
or
[list(vector(numeric <- function(t))]
: lists the functions
defining the average trajectories of each cluster.
The function shall return a value for each variable of varName
[vector(numeric) <- function(t)]
or
[list(vector(numeric <- function(t))]
: lists the functions
generating the noise of each trajectory within its own cluster.
The function shall return a value for each variable of [numeric]
: number of decimals used to round up values.[numeric]
: percentage (between 0 and 1)
of missing data generated in each cluster. If a single value is
given, it is duplicated for all groups (see detail).[logical]
: if TRUE
, the function
create an object ClusterLongData
. If
FALSE
, it create an object LongData
.LongData
or
ClusterLongData
, according to clusterLD
.generateArtificialLongData
(gald
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 functionClusters
.
Within a group, the individual undergoes individal
variations. Individual variations are given via the argument functionNoise
.
The number of individuals in each group is given by nbEachClusters
.
Finally, it is possible to add missing values randomly striking the
data thanks to percentOfMissing
.### Default example
ex1 <- generateArtificialLongData()
ex1
kml3d(ex1,3,1)
plot3d(ex1)
Run the code above in your browser using DataLab