simulate_pos: Simulate several points of stability

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Runs several simulations and returns the points of stability, which can then be further processed to calculate the critical point of stability.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simulate_pos(
  x_pop,
  y_pop,
  n_studies,
  sample_size_min,
  sample_size_max,
  replace,
  lower_limit,
  upper_limit
)

Arguments

x_pop

First vector of population.

y_pop

Second vector of population.

n_studies

How many studies to conduct.

sample_size_min

Minimum sample size to start in corridor of stability.

sample_size_max

How many participants to draw at maximum.

replace

Whether drawing samples is with replacement or not.

lower_limit

Lower limit of corridor of stability.

upper_limit

Upper limit of corridor of stability.

Value

Vector of sample sizes at which corridor of stability was reached.

Examples

1
2
pop <- fastpos::create_pop(0.5, 1000000)
simulate_pos(pop[,1], pop[,2], 100, 20, 1000, TRUE, 0.4, 0.6)

fastpos documentation built on Oct. 23, 2020, 7:12 p.m.