Learn R Programming

DBpower (version 0.1.0)

Finite Sample Power Calculations for Detection Boundary Tests

Description

Calculates lower bound on power, upper bound on power, and exact power (small sets only) for detection boundary tests (e.g. Berk-Jones, Generalized Berk-Jones, innovated Berk-Jones) used in set-based inference studies. These detection boundary tests are described in Sun et al., (2019) .

Copy Link

Version

Install

install.packages('DBpower')

Monthly Downloads

65

Version

0.1.0

License

GPL-3

Maintainer

Ryan Sun

Last Published

February 10th, 2022

Functions in DBpower (0.1.0)

GBJ_bound1_root

Internal function - put this function into uniroot to find the magnitude of the largest test statistic that will give a p-value of alpha.
performIntegralUpper1

Apply this function over 1:J to calculate each portion of the integral we need for the upper bound.
performIntegralUpper2

Apply this function over all m, j not equal (order matters) to calculate each portion of the integral we need for the lower bound for calc_b2.
calcb2

calc_b2.R
calcb1

calc_b1.R
checkBoundsUpper2

Internal function to check if test statistics fall within the region used for b2 upper bound, 1 minus the result of this is the upper bound on the power.
createMj

Create the matrix that linearly transforms the vector of test statistics into a quantity amenable for pmvnorm.
createMjk

Create the matrix that linearly transforms the vector of test statistics into a quantity amenable for pmvnorm.
set_BJ_bounds

set_BJ_bounds.R
checkBoundsUpper1

Internal function to check if test statistics fall within the region used for b1 uupper bound, 1 minus the result of this is the upper bound on the power.
set_GBJ_bounds

set_GBJ_bounds.R
sim_b1

sim_R1.R
sim_power_mvn

sim_power_mvn.R
sim_b2

sim_b2.R
sim_stats_mef

sim_power_indiv.R
BJ_func

Internal function - the BJ objective function minus the observed value, put it into uniroot to find the test statistic magnitude bound at order statistic k of d that will give the observed BJ value.
performIntegralLower2

Apply this function over all m, j not equal (order matters) to calculate each portion of the integral we need for the lower bound for calc_b2.
performIntegralLower1

Apply this function over 1:J to calculate each portion of the integral we need for the lower bound.
checkBoundsCross

Internal function to check if bounds are violated. Bounds should be smallest to largest.
calc_exact_power

calc_exact_power.R
checkBoundsLower2

Internal function to check if test statistics fall within the region used for b2 lower bound, 1 minus the result of this is the lower bound on the power.
checkBoundsLower1

Internal function to check if test statistics fall within the region used for b1 lower bound, 1 minus the result of this is the lower bound on the power..
sim_stats_mo

Simulate power starting from individual-level data for multiple outcomes setting.