sim_data: Simulate Data for Components Analysis

Description Usage Arguments Value Examples

View source: R/simcom_functions.R

Description

Simulate Data for Components Analysis

Usage

1
2
3
sim_data(n_pop = 1000, b_s = 0.26, b_e = 0.19, s_p = 0.14, b_p = 0.27,
  s_e = 0.25, p_e = 0.23, cor_bs_l1 = 0.2, l1_var = 2,
  l1_bs_sample = 50)

Arguments

n_pop

The size of the population to simulate

b_s

The correlation between behavior and the situational variable on level-2, which determines the correlation of their counterparts on level-1.

b_e

The correlation between the stable environment e and the behavior b.

s_p

The correlation between the situational variable and the average behavior.

b_p

The correlation between the average behavior and personality.

s_e

The correlation between the situation and the stable environment

p_e

The correlation between the personality p and the environment e.

cor_bs_l1

The average correlation of behavior and situations on level-1, within person.

l1_var

The variance of the level-1 variables (the larger, the less accurate will the mean reflect the true score at fewer measurement occasions)

l1_bs_sample

The number of level-1 measurement occaisons that are sampled.

Value

Returns a data frame with the following variables

Examples

1

kthorstmann/simcom documentation built on May 22, 2019, 4:41 p.m.