Function to generate artificial data from a structural equation model

simdata(
  paths = list(3:4, 4:5),
  blocks = list(1:3, 4:7, 8:10, 11:16, 17:21),
  sigma2 = runif(Nv, 0.1, 0.9),
  exogenous = list(1:2),
  beta = list(c(1, -0.5), c(-1, 0.5)),
  gamma0 = list(c(1.5)),
  gamma = list(c(0.5, -1)),
  tau2 = list(c(0.49)),
  Nv = 21,
  Ne = 30,
  Nna = 0,
  save = FALSE,
  name = "dt"
)

Arguments

paths

list referring to the inner model paths; a list of integers referring to the scores relationship; the jth first latent variable are explained

blocks

list of integers in 1:ncol(data) indicating the manisfest variables corresponding to each block

sigma2

outer model error variances

exogenous,

minimum color range (might cause blank spots if misspecified)

beta

inner paths regression coefficients

gamma0

inner exogenous intercept

gamma

inner exogenous regression coefficients

tau2

inner exogenous error variance

Nv

number of endogenous variables in the database (default = 21)

Ne

number of sample elements in the database (default = 30)

Nna

number of missing observations in each database (default = 0)

save

logical (default = FALSE); whether to save in the local filepath

name

rdata name used if save = TRUE

See also

Examples

dt <- bsem::simdata() arrayplot(dt$real$alpha)
arrayplot(dt$real$alpha, colors = 0)
arrayplot(dt$real$alpha, colors = 1)
arrayplot(dt$real$alpha, -4, 4)