Learn R Programming

gap (version 1.6)

gcontrol2: genomic control based on p values

Description

genomic control based on p values

Usage

gcontrol2(p, col = palette()[4], lcol = palette()[2], ...)

Value

A list containing:

  • x the expected \(\chi^2\) statistics.

  • y the observed \(\chi^2\) statistics.

  • lambda the inflation factor.

Arguments

p

a vector of observed p values.

col

colour for points in the Q-Q plot.

lcol

colour for the diagonal line in the Q-Q plot.

...

other options for plot.

Author

Jing Hua Zhao

Details

The function obtains 1-df \(\chi^2\) statistics (observed) according to a vector of p values, and the inflation factor (lambda) according to medians of the observed and expected statistics. The latter is based on the empirical distribution function (EDF) of 1-df \(\chi^2\) statstics.

It would be appropriate for genetic association analysis as of 1-df Armitage trend test for case-control data; for 1-df additive model with continuous outcome one has to consider the compatibility with p values based on z-/t- statistics.

References

Devlin B, Roeder K (1999) Genomic control for association studies. Biometrics 55:997-1004

Examples

Run this code
if (FALSE) {
x2 <- rchisq(100,1,.1)
p <- pchisq(x2,1,lower.tail=FALSE)
r <- gcontrol2(p)
print(r$lambda)
}

Run the code above in your browser using DataLab