qq_plot | R Documentation |
Downsampling reduces the number of points to be plotted. Since QQ-plots are on a logarithmic scale, near the origin (approaching 1) is very dense and most points are plotted over each other. However, the end of the distribution (approaching 0) is sparse. In order to make plotting more efficient by not plotting redundant points and also not lose information, there are two parameters needed for downsampling. The first is the proportion of points to randomly remove (-downsample). The second is the threshold (-pdown) for which points will be downsampled. For example, the options "-downsample 0.01 -pdown 10e-3" would random choose 1 p-values < 0.001 would be plotted. For one million tests, this reduces the number of points plotted to 10990 ((1,000,000*(1-0.001)*.01)+ (1,000,000*0.001)).
qq_plot(p, pdown = 3, downsample = 0.01, pch = 1, col = "grey20",
cex = 0.1, qpoints = FALSE, ci.level = 0.9, ci.color = "grey70",
highlight = NULL, cex.highlight = 1.2, max.axis = NULL)
p |
vector of p-values |
pdown |
p-value threshold (on a log10 scale) for plot downsampling |
downsample |
proportion of points to plot |
pch |
plotting 'character' (i.e., symbol) to use. See
|
col |
color code or name, see |
cex |
character (or symbol) expansion: a numerical vector. This works as
a multiple of |
qpoints |
logical, should the points be added to an existing plot? |
ci.level |
confidence level between 0 and 1. Set |
ci.color |
color of confidence interval band |
highlight |
p-values above this (log10) threshold will be plotted with
points whose size is determined by |
cex.highlight |
the magnification applied to points above the
|
max.axis |
maximum range (on a log10 scale) of the X and Y axes |
qq_plot(runif(1e5))
if (requireNamespace("pgcxd")) {
data("scz", package = "pgcxd")
qq_plot(scz$pval, highlight = 6)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.