mvsimstudy: mvsimstudy: A package for simulating the analysis of...

Description Details Notes See Also Examples

Description

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.

Details

Along with these functions there are also generate_data, analyze, and summary functions that are accessible if you would like to track intermediate states.

Notes

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.

See Also

set.alpha for additional information

single_scenario_simulation

simulate_scenarios

analyze for details on method parameter

p.adjust for p value adjustment arguments

Examples

 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")
  

emartchenko/mvsimstudy documentation built on May 24, 2019, 5:04 a.m.