Assessment of the probability of truly or falsely (depending on simulated scenario) rejecting the null hypothesis of interest for a given weight and evidence level, using simulated data as input.
Usage
oc_pos(
m,
se,
probs,
weights = seq(0, 1, by = 0.01),
map_prior,
sigma,
null_effect = 0,
direction_pos = T,
n_cores = 1,
eval_strategy = "sequential"
)
Arguments
- m
Numerical vector of simulated effect estimates.
- se
Numerical vector of simulated standard errors (
m
andse
need to have the same length).- probs
Vector of quantiles q, with 1 minus q representing an evidence level of interest (where positive effect estimate indicate a beneficial treatment).
- weights
Vector of weights of the informative component of the MAP prior (defaults to
seq(0, 1, by = 0.01)
).- map_prior
A MAP prior containing information about the trials in the source population, created using
RBesT
; a mixture of normal distributions is required.- sigma
Standard deviation of the weakly informative component of the MAP prior, recommended to be the unit-information standard deviation.
- null_effect
Numerical value, representing the null effect (defaults to 0).
- direction_pos
Logical value,
TRUE
(default) if effects greater that thenull_effect
indicate a beneficial treatment andFALSE
otherwise.- n_cores
Integer value, representing the number of cores to be used (defaults to 1); only applies if
eval_strategy
is not "sequential".- eval_strategy
Character variable, representing the evaluation strategy, either "sequential", "multisession", or "multicore" (see documentation of
future::plan
, defaults to "sequential").
Value
A 2-dimensional array containing probabilities, either of truly (probability of success) or falsely rejecting the null hypothesis of interest for a given weight and evidence level.
Examples
set.seed(123)
n_sims <- 5 # small number for exemplary application
sim_dat <- list(
"m" = rnorm(n = n_sims, mean = 1.15, sd = 0.1),
"se" = rnorm(n = n_sims, mean = 1.8, sd = 0.3)
)
results <- oc_pos(
m = sim_dat[["m"]],
se = sim_dat[["se"]],
probs = c(0.025, 0.05, 0.1, 0.2),
weights = seq(0, 1, by = 0.01),
map_prior = load_tipmap_data("tipmapPrior.rds"),
sigma = 16.23,
null_effect = 0,
direction_pos = TRUE,
eval_strategy = "sequential",
n_cores = 1
)
print(results)
#> q=0.025 q=0.05 q=0.1 q=0.2
#> w=0 0.0 0.0 0.0 0.2
#> w=0.01 0.0 0.0 0.0 0.2
#> w=0.02 0.0 0.0 0.0 0.4
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