Run simulations for one or several population correlations and return the critical points of stability (POS). The critical point of stability is the sample size at which a certain percentage of studies will fall into an a priori specified interval and stay in this interval if the sample size is increased further.
find_critical_pos(
rhos,
precision = 0.1,
precision_rel = FALSE,
sample_size_min = 20,
sample_size_max = 1000,
replace = TRUE,
n_studies = 10000,
confidence_levels = c(0.8, 0.9, 0.95),
pop_size = 1e+06,
n_cores = 1
)
A data frame containing all the above information, as well as the points of stability.
Vector of population correlations (can also be a single correlation).
Precision around the correlation which is acceptable (defaults to 0.1). The precision will determine the corridor of stability which is just rho+-precision.
Whether the precision is absolute (rho+-precision or relative rho+-rho*precision), boolean (defaults to FALSE).
Minimum sample size for each study (defaults to 20).
Maximum sample size for each study (defaults to 1e3).
Whether drawing samples is with replacement or not.
Number of studies to run for each rho (defaults to 10e3).
Confidence levels for point of stability. This corresponds to the quantile of the distribution of all found critical sample sizes (defaults to c(.8, .9, .95)).
Population size (defaults to 1e6).
Number of cores to use for simulation.
find_critical_pos(rhos = 0.5)
find_critical_pos(rhos = c(0.4, 0.5), n_studies = 1e3)
Run the code above in your browser using DataLab