This will create a QQ-plot for p-values, comparing them to a uniform distribution. We make our plot on the -log10 scale. We calculate simultaneous confidence bands by the Tail Sensitive approach of Aldor-Noiman et al (2013).

qqpvalue(
  pvals,
  method = c("ggplot2", "base"),
  band_type = c("ts", "pointwise"),
  conf_level = 0.95,
  return_plot = FALSE
)

Arguments

pvals

A vector of p-values.

method

Should we use base plotting or ggplot2 (if installed)?

band_type

Should we use the method of Aldor-Noiman et al (2013) or pointwise based on beta? Pointwise is not recommended since there is strong dependence between order statistics, and if one is beyond the pointwise bands, then likely lots are also beyond them.

conf_level

Confidence level for the bands.

return_plot

Should we return the plot? Only applicable if method == "ggplot2".

References

  • Aldor-Noiman, S., Brown, L. D., Buja, A., Rolke, W., & Stine, R. A. (2013). The power to see: A new graphical test of normality. The American Statistician, 67(4), 249-260.

See also

  • The qqPlot() function from the car package.

Author

David Gerard

Examples

set.seed(1)
pvals <- runif(100)
qqpvalue(pvals, band_type = "ts", method = "base")


if (FALSE) {
qqpvalue(pvals, band_type = "ts", method = "ggplot2")
}