estimate.fdr: Estimate FDR

Description Usage Arguments Value References See Also Examples

View source: R/hiertest.R

Description

Estimates False Discovery Rate (FDR) based on permutation scheme described in CHT paper (reference below).

Usage

1
estimate.fdr(x, y, lamlist, type = c("Fisher", "simple"), B = 100)

Arguments

x

n by p design matrix

y

binary (0 or 1) vector of length n indicating class

lamlist

a vector of cutoffs for the statistics

type

determines whether Fisher transform should be applied to interaction contrasts. Default: Fisher. See hiertest for more information.

B

number of permutations

Value

A estfdr object, which consists of

ncalled:

number of interactions called significant at each cutoff. Set to NA if 0.

null.ncalled:

total number, across all permutations, of (null) interactions rejected at each cutoff

fdr:

estimate of fdr for each cutoff in lamlist. Set to NA if no interactions are rejected at this cutoff

References

Bien, Simon, and Tibshirani (2015) Convex Hierarchical Testing of Interactions. Annals of Applied Statistics. Vol. 9, No. 1, 27-42.

See Also

hiertest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# generate some data accoring to the backward model:
set.seed(1)
n <- 200
p <- 50
y <- rep(0:1, each=n/2)
x <- matrix(rnorm(n*p), n, p)
colnames(x) <- c(letters,LETTERS)[1:p]
# make some interactions between several pairs of variables:
R <- matrix(0.3, 5, 5)
diag(R) <- 1
x[y==1, 1:5] <- x[y==1, 1:5] %*% R
# and a main effect for variables 1 and 3:
x[y==1, 1:5] <- x[y==1, 1:5] + 0.5
testobj <- hiertest(x=x, y=y, type="Fisher")
# look at test statistics
print(testobj)
plot(testobj)
## Not run: 
lamlist <- seq(5, 2, length=100)
estfdr <- estimate.fdr(x, y, lamlist, type="Fisher", B=200)
plot(estfdr)
print(estfdr)
# the cutoff lamlist[70] is estimated to have roughly 10% FDR:
estfdr$fdr[70]
# this allows us to reject this many interactions:
nrejected <- estfdr$ncalled[70]
# These are the interactions rejected:
interactions.above(testobj, lamlist[70])

## End(Not run)

hiertest documentation built on May 2, 2019, 11:12 a.m.