scenario_sim {ionr}R Documentation

Simulate SONE values for scenario.

Description

A wrapper that takes a scenario, and produces the Significance Of iNdicator Exclusion (SONE) values for each exclusion and calculates efficacy. Used by optimal_p.

Usage

scenario_sim(sizes, n_sim, to_n, tn_n = 8 - to_n, ...)

Arguments

sizes

An array of sample sizes to be simulated. Can be single value.

n_sim

number of simulations. 1000 is a start, 10000 was used in paper, but takes a long time

to_n

Number of indicators in a Trait relating to Outcome

tn_n

Number of indicators in a Trait Not relating to outcome.

...

further tweaking of the scale simulator, see scale_sim for details.

Value

Returns a list of SONE values and related efficacy. See example for details

  1. SONE results. Feed this to scenario_plot or scenario_plot80 (see examples)

  2. Summary efficacy. Such data comprises Table 1 in Vainik, Mottus et al., 2015 EJP

  3. Full efficacy data.

Examples


#A scenario with 8 items relating to outcome, testing 2 different samples
sizes=c(250,500)
n_sim=100
to_n=8
scen1=scenario_sim(sizes,n_sim,to_n)  # takes a few seconds..
scenario_plot80(scen1[[1]],sizes,n_sim)

# A scenario with 2 out of 8 items relating to outcome, 2 different samples
to_n=2
scen2=scenario_sim(sizes,n_sim,to_n)  # takes a few seconds..
scenario_plot(scen2[[1]],sizes,n_sim,to_n)


[Package ionr version 0.3.0 Index]