qqplot.pvalues: QQ plot of p-values

View source: R/qqplot.pvalues.r

qqplot.pvaluesR Documentation

QQ plot of p-values

Description

Draws a QQ plot of p-values

Usage

 qqplot.pvalues(p, col.abline = "red", CB = TRUE, col.CB = "gray80", 
                       CB.level = 0.95, thinning = TRUE, ...) 

Arguments

p

A vector of p-values, or a data.frame with a column named p

col.abline

Color of the line of slope 1. Set to NA to suppress.

CB

Logical. If TRUE, a confidence band is included in the plot.

col.CB

The color of the confidence band.

CB.level

The level of the confidence band.

thinning

Logical. If TRUE, not all points are displayed.

...

Graphical parameters to be passed to plot and points

Details

The QQ plot is on the -log10 scale, as is usual when reporting GWAS results.

The confidence band is not a global confidence region: it is the mere juxtaposition of confidence intervals for each quantile. Moreover it assumes independance of the p-values, an hypothesis hich is false for the p-values resulting from an association test in presence of linkage disequilibrium. Therefore, the probability that some of the points lie outsite of this band is greater that CB.level.

The thinning procedure suppress some points to avoid generating too heavy graphs. The user should check that setting thinning = FALSE does not change the final aspect of the QQ plot.

See Also

association.test, manhattan, qqplot, plot.default, points.default

Examples

# a vector of uniform p-values
p <- runif(1e6)
qqplot.pvalues(p)
# if we don't thin the points, using pch = "." is advised
qqplot.pvalues(p, pch = ".", cex = 2, thinning = FALSE)

gaston documentation built on Dec. 28, 2022, 1:30 a.m.