Learn R Programming

qch (version 2.1.0)

qch.test: Perform composite hypothesis testing.

Description

Perform any composite hypothesis test by specifying the configurations 'Hconfig.H1' corresponding to the composite alternative hypothesis among all configurations 'Hconfig'.

Usage

qch.test(res.qch.fit, Hconfig, Hconfig.H1 = NULL, Alpha = 0.05, threads_nb = 0)

Value

A list with the following elements:

Rejectiona matrix providing for each item the result of the composite hypothesis test, after adaptive Benjamin-Höchberg multiple testing correction.
lFDRa matrix providing for each item its local FDR estimate.
Pvaluesa matrix providing for each item its p-value of the composite hypothesis test.

Arguments

res.qch.fit

The result provided by the qch.fit() function.

Hconfig

A list of all possible combination of \(H_0\) and \(H_1\) hypotheses generated by the GetHconfig() function.

Hconfig.H1

An integer vector (or a list of such vector) of the Hconfig index corresponding to the composite alternative hypothesis configuration(s). Can be generated by the GetH1AtLeast() or GetH1Equal() functions. If NULL, the composite hypothesis tests of being associated with "at least \(q\)" simple tests, for q=1,..Q are performed.

Alpha

the nominal Type I error rate for FDR control. Default is 0.05.

threads_nb

The number of threads to use. The number of thread will set to the number of cores available by default.

Details

By default, the function performs the composite hypothesis test of being associated with "at least \(q\)" simple tests, for \(q=1,..Q\).

See Also

qch.fit(), GetH1AtLeast(),GetH1Equal()

Examples

Run this code
data(PvalSets_cor)
PvalMat <- as.matrix(PvalSets_cor[, -3])
Truth <- PvalSets[, 3]

## Build the Hconfig objects
Q <- 2
Hconfig <- GetHconfig(Q)

## Infer the posteriors
res.fit <- qch.fit(pValMat = PvalMat, Hconfig = Hconfig, copula = "gaussian")

## Run the test procedure with FDR control
H1config <- GetH1AtLeast(Hconfig, 2)
res.test <- qch.test(res.qch.fit = res.fit, Hconfig = Hconfig, Hconfig.H1 = H1config)
table(res.test$Rejection$AtLeast_2, Truth == 4)

Run the code above in your browser using DataLab