| generateLongData | R Documentation | 
Generate longitudinal test data
generateLongData(
  sizes = c(40, 60),
  fixed = Value ~ 1,
  cluster = ~1 + Time,
  random = ~1,
  id = getOption("latrend.id"),
  data = data.frame(Time = seq(0, 1, by = 0.1)),
  fixedCoefs = 0,
  clusterCoefs = cbind(c(-2, 1), c(2, -1)),
  randomScales = cbind(0.1, 0.1),
  rrandom = rnorm,
  noiseScales = c(0.1, 0.1),
  rnoise = rnorm,
  clusterNames = LETTERS[seq_along(sizes)],
  shuffle = FALSE,
  seed = NULL
)
sizes | 
 Number of strata per cluster.  | 
fixed | 
 Fixed effects formula.  | 
cluster | 
 Cluster effects formula.  | 
random | 
 Random effects formula.  | 
id | 
 Name of the strata.  | 
data | 
 Data with covariates to use for generation. Stratified data may be specified by adding a grouping column.  | 
fixedCoefs | 
 Coefficients matrix for the fixed effects.  | 
clusterCoefs | 
 Coefficients matrix for the cluster effects.  | 
randomScales | 
 Standard deviations matrix for the size of the variance components (random effects).  | 
rrandom | 
 Random sampler for generating the variance components at location 0.  | 
noiseScales | 
 Scale of the random noise passed to rnoise. Either scalar or defined per cluster.  | 
rnoise | 
 Random sampler for generating noise at location 0 with the respective scale.  | 
clusterNames | 
 A   | 
shuffle | 
 Whether to randomly reorder the strata in which they appear in the data.frame.  | 
seed | 
 Optional seed to set for the PRNG. The set PRNG state persists after the function completes.  | 
latrend-data
longdata <- generateLongData(
  sizes = c(40, 70), id = "Id",
  cluster = ~poly(Time, 2, raw = TRUE),
  clusterCoefs = cbind(c(1, 2, 5), c(-3, 4, .2))
)
if (require("ggplot2")) {
  plotTrajectories(longdata, response = "Value", id = "Id", time = "Time")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.