simEGM: Simulate data following a Exploratory Graph Model ('EGM')

View source: R/oldsimEGM.R View source: R/simEGM.R

simEGMR Documentation

Simulate data following a Exploratory Graph Model (EGM)

Description

Function to simulate data based on EGM

Usage

simEGM(
  communities,
  variables,
  loadings,
  cross.loadings = 0.02,
  correlations,
  sample.size,
  max.iterations = 1000
)

Arguments

communities

Numeric (length = 1). Number of communities to generate

variables

Numeric vector (length = 1 or communities). Number of variables per community

loadings

Numeric (length = 1). Magnitude of the assigned network loadings. For reference, small (0.20), moderate (0.35), and large (0.50)

Uses runif(n, min = value - 0.075, max = value + 0.075) for some jitter in the loadings

cross.loadings

Numeric (length = 1). Standard deviation of a normal distribution with a mean of zero (n, mean = 0, sd = value). Defaults to 0.02. Not recommended to change too drastically (small increments such as 0.01 work best)

correlations

Numeric (length = 1). Magnitude of the community correlations

sample.size

Numeric (length = 1). Number of observations to generate

max.iterations

Numeric (length = 1). Number of iterations to attempt to get convergence before erroring out. Defaults to 1000

Author(s)

Hudson F. Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>

Examples

simulated <- simEGM(
  communities = 2, variables = 6,
  loadings = 0.55, # use standard factor loading sizes
  correlations = 0.30,
  sample.size = 1000
)


EGAnet documentation built on April 11, 2025, 6:11 p.m.