generate_data: generate_data

View source: R/generate_data.R

generate_dataR Documentation

generate_data

Description

Generates data based on the simulation settings provided by Cheung et al. (2021). Note that the reliability used here is omega.

Usage

generate_data(
  n_obs = 100,
  corr = 0.3,
  effect = 0.42,
  ld = c(1, 1, 1, 1),
  alp = 0.9,
  effect_x = 0.4,
  effect_z = 0.2
)

Arguments

n_obs

Integer. The number of observations.

corr

Numeric. The correlation of the latent variables.

effect

Numeric. The effect of the moderator.

ld

Numeric. The factor loading of the latent variable to its indicators.

alp

Numeric. The reliability of the latent variable.

effect_x

Numeric. The direct effect of x.

effect_z

Numeric. The direct effect of z.

Value

A dataset simulated from the argument settings.

Examples

n_obs = 100
corr = 0.1
effect = 0.12
ld = c(1,1,1,1)
alp = 0.9
generate_data(n_obs, corr, effect, ld, alp)

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