qqpvalue: QQ-plot for p-values

View source: R/plots.R

qqpvalueR Documentation

QQ-plot for p-values

Description

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).

Usage

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".

Author(s)

David Gerard

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.

Examples

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

## Not run: 
qqpvalue(pvals, band_type = "ts", method = "ggplot2")

## End(Not run)


hwep documentation built on May 31, 2023, 9:06 p.m.