Installation:

The package requires the development version of cSEM (version 0.1.0:9000 as Feb. 2020). To install the development version use:

To install the development version of cSEM.DGP use:

Getting started

The best place to get started is the cSEM.DGP website.

Purpose

Generate data for structural equation models including up to eight constructs. Data generation is based on parameter values given in lavaan model syntax.

In addition to supplying numeric values, variable values (symbolic names) for parameters are allowed. To achieve this, the package makes use of lavaan’s labeling capabilities. Users may replace a given parameter in, i.e. the structural model by a symbolic name and assign a vector of values to that name. These values will be used to generate data for all possible combinations of these values with the remaining fixed parameters.

The package works nicely in combination with the cSEM package.

Examples

Including variable parameters

To include variable parameters:

  1. Replace a numeric value by a symbolic name (i.e., a character string) of your choice.
  2. Supply a named vector of values to generateData() where the name corresponds to the chosen character string.

Now, data for all possible combinations of these values with the remaining fixed parameters will be generated.

The return type in this case is a nested tibble. To access e.g. the first data set type: