Learn R Programming

silp (version 1.0.0)

generate_data: 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
)

Value

A dataset simulated from the argument settings.

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab