replicate_sim: Repeat Simulation

Description Usage Arguments Value Examples

View source: R/simcom_functions.R

Description

Repeat Simulation

Usage

1
2
3
replicate_sim(REPS = 10, 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

REPS

The number of simulations to be made of

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 list with two objects: The first is a data frame for the component analyses, the second is a vector with the explained variances.

Examples

1

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