sgpower: Power functions for Second-Generation p-Values

Description Usage Arguments Value References See Also Examples

View source: R/sgpower.R

Description

Calculate power and type I error values from significance testing based on second-generation p-values as the inferential metric.

Usage

1
sgpower(true, null.lo, null.hi, std.err = 1, interval.type, interval.level)

Arguments

true

The true value for the parameter of interest at which to calculate power. Note that this is on the absolute scale of the parameter, and not the standard deviation or standard error scale.

null.lo

The lower bound of the indifference zone (null interval) upon which the second-generation p-value is based

null.hi

The upper bound for the indifference zone (null interval) upon which the second-generation p-value is based

std.err

Standard error for the distribution of the estimator for the parameter of interest. Note that this is the standard deviation for the estimator, not the standard deviation parameter for the data itself. This will be a function of the sample size(s).

interval.type

Class of interval estimate used for calculating the SGPV. Options are confidence for a (1-α)100% confidence interval and likelihood for a 1/k likelihood support interval (credible not yet supported)

interval.level

Level of interval estimate. If interval.type is confidence, the level is α. If interval.type is likelihood, the level is 1/k (not k).

Value

A list containing the following components:

power.alt

Probability of SGPV = 0 calculated assuming the parameter is equal to true. That is, power.alt = P(SGPV = 0 | θ = true).

power.inc

Probability of 0 < SGPV < 1 calculated assuming the parameter is equal to true. That is, power.inc = P(0 < SGPV < 1 | θ = true).

power.null

Probability of SGPV = 1 calculated assuming the parameter is equal to true. That is, power.null = P(SGPV = 1 | θ = true).

`type I error summaries`

Named vector that includes different ways the type I error may be summarized for an interval null hypothesis. min is the minimum type I error over the range (null.lo, null.hi), which occurs at the midpoint of (null.lo, null.hi). max is the maximum type I error over the range (null.lo, null.hi), which occurs at the boundaries of the null hypothesis, null.lo and null.hi. mean is the average type I error (unweighted) over the range (null.lo, null.hi). If 0 is included in the null hypothesis region, then `type I error summaries` also contains at 0, the type I error calculated assuming the true parameter value θ is equal to 0.

References

Blume JD, Greevy RA Jr., Welty VF, Smith JR, Dupont WD (2019). An Introduction to Second-generation p-values. The American Statistician. 73:sup1, 157-167, DOI: https://doi.org/10.1080/00031305.2018.1537893

Blume JD, D’Agostino McGowan L, Dupont WD, Greevy RA Jr. (2018). Second-generation p-values: Improved rigor, reproducibility, & transparency in statistical analyses. PLoS ONE 13(3): e0188299. https://doi.org/10.1371/journal.pone.0188299

See Also

fdrisk, sgpvalue, plotsgpv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sgpower(true=2, null.lo=-1, null.hi=1, std.err=1, interval.type='confidence',
 'interval.level'=0.05)

sgpower(true=0, null.lo=-1, null.hi=1, std.err=1, interval.type='confidence',
 'interval.level'=0.05)

# plot the power curve
sigma = 5
n = 20
theta = seq(-10, 10, by=0.1)
power = sgpower(true=theta, null.lo=-1, null.hi=1, std.err=sigma/sqrt(n),
 interval.type='confidence', interval.level=0.05)$power.alt
plot(theta, power, type='l', ylab='power')

weltybiostat/sgpv documentation built on Nov. 23, 2020, 11:35 p.m.