plotsgpower {sgpv} | R Documentation |
Plot power curves for Second-Generation p-Values
Description
This function calculates power and type I error values from significance testing based on second-generation p-values as the inferential metric and plots the power curve to visualize the operating charateristics of the inferential procedure.
Usage
plotsgpower(
null.lo,
null.hi,
std.err,
alt = NA,
x.lim = NA,
interval.type,
interval.level = 0.05,
plot.option = 1,
null.col = rgb(208, 216, 232, maxColorValue = 255),
pow.col = c("cornflowerblue", "firebrick3", "green4"),
pow.lty = c(1, 1, 1),
title.lab = "",
x.lab = "Parameter",
y.lab = "Probability",
legend.on = TRUE,
null.pt = NA,
acc = 100
)
Arguments
null.lo |
A scalar representing the lower bound of the null interval hypothesis (indifference zone) upon which the second-generation p-value is based. |
null.hi |
A scalar representing the upper bound of the null interval hypothesis (indifference zone) 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). |
alt |
Optional scalar or vector of alternative value(s) for the parameter of interest. Default is |
x.lim |
Optional numeric vector of length two giving the lower and upper bounds of the x-axis for the power curve. Default is |
interval.type |
Class of interval estimate used for calculating the SGPV. Options are |
interval.level |
Level of interval estimate. If |
plot.option |
Used to specify the type of plot desired. If |
null.col |
Coloring of shading for the null interval hypothesis (indifference zone) region. Default is Hawkes Blue: |
pow.col |
Vector of length three specifying the colors for the the three power curves given when |
pow.lty |
Vector of length three specifying the line types ( |
title.lab |
Title text. |
x.lab |
x-axis label. |
y.lab |
y-axis label. |
legend.on |
Toggle for plotting the legend. Default is |
null.pt |
Optional numeric scalar representing a point null hypothesis. Default is |
acc |
Optional parameter specifying the resolution of the x-axis. Default is |
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
sigma = 5
n = 20
plotsgpower(alt = NA, null.lo = -1, null.hi = 1,
std.err = sigma/sqrt(n), x.lim = c(-8,8),
interval.type = 'confidence', interval.level = 0.05,
plot.option = 2, null.pt = 0)
plotsgpower(alt = c(-4,2),
null.lo = -1, null.hi = 1, std.err = sigma/sqrt(n),
x.lim = NA, interval.type = 'confidence',
interval.level = 0.05, plot.option = 2)
plotsgpower(alt = NA, null.lo = -1, null.hi = 1,
std.err = sigma/sqrt(n), x.lim = NA,
interval.type = 'confidence', interval.level = 0.05,
plot.option = 1, null.pt = NA)
plotsgpower(alt = c(-4,2), null.lo = -1, null.hi = 1,
std.err = 1, x.lim = NA, interval.type = 'likelihood',
interval.level = 0.05, plot.option = 1, null.pt = 0)