AF_combine: AF Combination

Description Usage Arguments Value Examples

View source: R/AF_combine.R

Description

This function combines P-values using Adaptive Fisher (AF) method.

Usage

1
AF_combine(p, log = FALSE, weight = NULL, n0 = 1)

Arguments

p

P-values to be combined. A matrix with dimensions K by N. If an object of P-values from perm_score is used, N is the number of permutations plus 1.

log

Indicator of whether P-values are on the log scale.

weight

Weights given to the P-values. A vector with dimension K. Constant weights are used if it is not specified.

n0

Tuning parameter. Discard the first n0-1 P-values of each sample.

Value

A list object.

pv

P-value of AF test.

stat

AF statistic.

indexes

Indexes of P-values combined into the test statistic. Indexes are sorted so that P-values are in ascending order.

stat_all

AF statistics for all permuted samples.

pv_all

P-values of AF statistics for all permuted samples.

Examples

1
2
3
4
5
# Combine P-values of normally distributed test statistics
U <- matrix(rnorm(10 * 100), ncol=100)
p <- 2 * (1 - pnorm(abs(U)))
wt <- (1:10)/55
test <- AF_combine(p, weight = wt)

cxystat/AFb documentation built on June 17, 2021, 7:30 p.m.