Description Details Notes See Also Examples
The mvsimstudy package provides two overarching simulation functions - simulate_single_scenario and simulate_scenarios. The first function carries out the generation, analysis, and summarization of a single scenario, returning a list that allows you to examine each individual feature analyzed as well as a summary for the model overall. The simulate_scenarios function simulates multiple scenarios and returns an overall summary for each of them.
Along with these functions there are also generate_data, analyze, and summary functions that are accessible if you would like to track intermediate states.
For the simulation to run to completion the level of significance must be set with set.alpha() . This must be done once before package use commences. Please see documentation for more details.
set.alpha
for additional information
analyze
for details on method parameter
p.adjust
for p value adjustment arguments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | A single scenario, uncorrelated data analyzed with 'one feature at a time'
method
set.alpha(0.05)
e <- effect_size(c(0.3, 0, 0.7))
single_scenario_simulation(num_samples_trt = 80, num_samples_control= 95, delta = e, method="ofaat")
A single scenario, correlated data analyzed with lasso method
set.alpha(0.05)
e <- effect_size(c(rep(0.3, 10), rep(0, 60), rep(0.1, 30), rep(0, 20), rep(0.7, 10)))
corr_structure <- create_cor_matrix(130, strong = 15, med = 10, weak = 90)
single_scenario_simulation(num_samples_trt = 30, num_samples_control= 30,
delta = e, cor_matrix = corr_structure, method="lasso")
Multiple scenarios, variable sample sizes
set.alpha(0.05)
e <- effect_size(c(0, 0.7, 0.3))
corr_structure <- create_cor_matrix(3, med = 2)
effect_list <- c(e)
sample_size_list <- c(20, 30, 40, 50, 60, 70)
simulate_scenarios(effect_list, sample_size_list
cor_matrix = corr_structure, method="lasso")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.