ctmaGenData: ctmaGenData

View source: R/ctmaGenData.R

ctmaGenDataR Documentation

ctmaGenData

Description

Generates data from lists of parameters (drift, diffusion etc). Experimental!!

Usage

ctmaGenData(
  activeDirectory = NULL,
  burnin = 0,
  cint = NULL,
  coresToUse = 2,
  ctmaExtract = FALSE,
  diff = NULL,
  digits = 4,
  doPar = FALSE,
  drift = NULL,
  empirical = TRUE,
  envir = NULL,
  sampleSizes = 100,
  lambda = NULL,
  latentNames = NULL,
  manifestMeans = NULL,
  manifestVars = NULL,
  manifestNames = NULL,
  missings = NULL,
  modValues = 0,
  n.latent = NULL,
  n.manifest = NULL,
  randomIntercepts = NULL,
  T0means = 0,
  T0var = NULL,
  TIpreds = NULL,
  tpoints = 10,
  tpointTargets = NULL,
  useRawData = NULL
)

Arguments

activeDirectory

defines active directory where files are saved. No default.

burnin

vector of initial time points to be deleted (default = 0)

cint

list of cint matrices. By default (NULL), cint matrices will be used that create a steady-state (i.e., means at all time points = T0means)

coresToUse

if neg., the value is subtracted from available cores, else value = cores to use.

ctmaExtract

if TRUE (default = FALSE) uses ctmaExtract to extract objects required for CoTiMA into the environment specified using the argument envir. Requires the argument useRawData to be set to TRUE or FALSE.

diff

list of diffusion matrices. By default (NULL), diffusion matrices will be used that create a steady-state (i.e., covariance at all time points = T0var)

digits

number of digits used for rounding (in outputs).

doPar

parallel generating of data. if TRUE, data are generated in coresToUse parallel loops during which no output is generated (screen remains silent).

drift

list of drift matrices. No default (all = NULL).

empirical

whether (default) or not generated data that should be independent as generally assumed (e.g., diffusions at different time points, T0var, etc) are truly independent. Allow for exact estimation of parameters (no random variance; not useful for MC simulations). May require large sample sizes.

envir

environment where objects should be extracted too. NULL by default. Typically one would use the global environment (envir = globalenv()). Has to be specified if ctmaExtract is set to TRUE.

sampleSizes

vector of sample sizes. Default = 100.

lambda

list of matrices. By default all are diagonal matrices with 1 in the diagonal.

latentNames

names for latent variables (default = NULL using generic names)

manifestMeans

list of manifest mean matrices. By default all are = 0.

manifestVars

list of manifest error (co-)variances matrices. By default all are = 0.

manifestNames

names for manifest variables (default = NULL using generic names)

missings

proportion of missings (default = 0, which does not delete any value)

modValues

list of moderator values (possible used to generate the list of drift matrices provided). By default all are = 0.

n.latent

number of latent variables of the model No default (all = NULL).

n.manifest

number of manifest variables of the model (if left empty it will assumed to be identical with n.latent).

randomIntercepts

list of (co-)variances matrices of TIpreds (traits). By default all are = 0.

T0means

list of Time 0 mean levels. By default all are = 0.

T0var

list of Time 0 (co-)variance matrices. No default (all = NULL).

TIpreds

list of time-independent predictors, e.g., the moderators that were used to create the drift matrices. No default (all = NULL).

tpoints

vector of number of tpoints to be generated (default = 10).

tpointTargets

list of vectors of tpoints to be selectd (default = burnin:tpoints).

useRawData

if TRUE (or FALSE) and ctmaExtract is also TRUE, creates rawData (or empcov) objects required for CoTiMA into the environment specified using the argument envir.

Value

ctmaGenData returns a list containing ...

Examples

# Fit a ctsem model to all three primary studies summarized in
# CoTiMAstudyList_3 and save the three fitted models
## Not run: 
CoTiMAInitFit_3 <- ctmaInit(primaryStudies=CoTiMAstudyList_3,
                            n.latent=2,
                            checkSingleStudyResults=FALSE,
                            activeDirectory="/Users/tmp/") # adapt!
summary(CoTiMAInitFit_3)

## End(Not run)


CoTiMA documentation built on July 20, 2026, 5:08 p.m.

Related to ctmaGenData in CoTiMA...