Skip to content
R package for calculating second-generation p-values and associated measures.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
R remove wrong function name Mar 12, 2019
data Delete .Rapp.history Mar 13, 2019
man Delete .DS_Store Mar 13, 2019
LICENSE add package files Oct 25, 2018
NAMESPACE add function to plot confidence intervals Mar 7, 2019
sgpv.Rproj add package files Oct 25, 2018


The sgpv package contains functions to calculate the second-generation p-value in R, its associated delta-gap, power functions, and the false discovery risk or false confirmation risk for an alternative or null finding (sgpv = 0 or sgpv = 1) when assumptions are made about the distributions over the null and alternative spaces.


Version now includes a function to plot the intervals colored by SGPV status, as found in Blume et al. (2018) and Blume et al. (2019)


# install.packages("devtools")


The sgpvalue() function calculates the second-generation p-value and delta-gap (if applicable) for uncertainty intervals with lower bounds est.lo and upper bounds est.hi and an indifference zone (i.e. interval null hypothesis) of (null.lo, null.hi). Note that this example is in terms of odds ratios, and the second-generation p-value should be calculated on the "symmetric" scale, i.e. log odds ratios in this case.

lb = log(c(1.05, 1.3, 0.97))
ub = log(c(1.8, 1.8, 1.02))
sgpvalue(est.lo = lb, est.hi = ub, null.lo = log(1/1.1), null.hi = log(1.1))

# $
# [1] 0.1220227 0.0000000 1.0000000

# $
# [1]       NA 1.752741       NA


Paper appearing in the upcoming special issue of The American Statisician:

Blume JD, Greevy RA Jr., Welty VF, Smith JR, Dupont WD (2019). An Introduction to Second-generation p-values. The American Statistician. In press.

Original proposal appearing in PLoS ONE:

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.

You can’t perform that action at this time.