get_calibrated_pvalues {aziztest}R Documentation

Use the calibration of p-values in a slow multi-hypothesis setting

Description

Compute the p-values from a single set of permutations obtained from calibrate_test. Useful if testing a large number of variables at once since it allows running permutations only once beforehand rather than for every variable. Used in conjunction with "calibrate_test"

Usage

get_calibrated_pvalues(calibration, es1, conservative = T)

Arguments

calibration

Output of function calibrate_test()

es1

Max Enrichment score given by function aziz.test() $es. A vector containing the max enrichment scores from many variables is acceptable

conservative

Default=TRUE. p-values = b+1/ (1+ #permutations) is the returned value. As described in Phibson 2010: "Permutation p-values should never be zero"

Value

calibrated p-value(s) corresponding to the max enrichment score(s) given

See Also

calibrate_test, aziz.test

Examples

y = c(rep(1,200),rep(0,200))
x = rnorm(400)
calibration = calibrate_test(y,rep=1000)
es = aziz.test(y,x,rep=0)$es #No need for permutations, p-values computed from calibration
get_calibrated_pvalues(calibration,es)
x[1:20]=x[1:20]-2;
es2 = aziz.test(y,x,rep=0)$es
get_calibrated_pvalues(calibration,es2)

[Package aziztest version 0.2.1 Index]