Learn R Programming

QQperm (version 1.0.1)

estlambda2: Estimate the inflation factor for a distribution of observed P-values or 1-df chi-square test.

Description

Estimate the inflation factor for a distribution of P-values or 1-df chi-square test using a permutation-based NULL distribution of P-values provided by the package/user. The implementation is similar to the default (estlambda) implementation in R package GenABEL but here it does not assume the NULL distribution of P-values to be uniform. Rather it estimates lambda inflation factor by comparing to the permutation-based expected NULL distribution as described for QQ plots. This is thus more representative of the true NULL distribution of Fisher's Exact p-values for the given case-control configuration in a study.

Usage

estlambda2(p.o, p.e, plot = FALSE, filter = TRUE, adjust.xy = FALSE, ...)

Arguments

p.o
Observed P-values from the data (true case/control assignments).
p.e
Expected P-values from the NULL distribution, usually obtained through label permutations of the matrix data.
plot
Indicate if a plot should be produced.
filter
Indicate if the filter should be applied. This parameter behaves the same as in estlambda in GenABEL.
adjust.xy
Indicate if the x-axis and y-axis should be adjusted to their own range.
...
Additional arguments passed to the plot function.

Value

Returns a list containing the permutation-based estimated lambda value (estimate) and its standard error (se).

Examples

Run this code
#load pre-computed p-values for IGM dataset
library(QQperm)
data("example.Ps")

#print output to pdf file only if not running in interactive mode
if (!interactive()) {
 pdf("lambda.pdf")
}

#estimate inflation factor and generate plot.
lambda <-estlambda2(example.Ps$observed,example.Ps$perm, plot = TRUE, adjust.xy = TRUE)

if (!interactive()) {
 dev.off()
}

Run the code above in your browser using DataLab