| sgpower {sgpv} | R Documentation |
Power functions for Second-Generation p-Values
Description
Calculate power and type I error values from significance testing based on second-generation p-values as the inferential metric.
Usage
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 |
interval.level |
Level of interval estimate. If |
Value
A list containing the following components:
power.altProbability of SGPV = 0 calculated assuming the parameter is equal to
true. That is,power.alt= P(SGPV = 0 | \theta =true).power.incProbability of 0 < SGPV < 1 calculated assuming the parameter is equal to
true. That is,power.inc= P(0 < SGPV < 1 | \theta =true).power.nullProbability of SGPV = 1 calculated assuming the parameter is equal to
true. That is,power.null= P(SGPV = 1 | \theta =true).`type I error summaries`Named vector that includes different ways the type I error may be summarized for an interval null hypothesis.
minis the minimum type I error over the range (null.lo,null.hi), which occurs at the midpoint of (null.lo,null.hi).maxis the maximum type I error over the range (null.lo,null.hi), which occurs at the boundaries of the null hypothesis,null.loandnull.hi.meanis the average type I error (unweighted) over the range (null.lo,null.hi). If0is included in the null hypothesis region, then`type I error summaries`also containsat 0, the type I error calculated assuming the true parameter value\thetais equal to0.
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
Examples
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')