AF: Adaptive Fisher Test

Description Usage Arguments Value See Also Examples

View source: R/AF.R

Description

This function performs Adaptive Fisher (AF) test on GLM-based Score Statistics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
AF(
  Y,
  X,
  binary = FALSE,
  cov = NULL,
  nperm = 1000,
  adapt_perm = FALSE,
  cutoff = 2.5e-06,
  n0 = 1,
  seed = NULL
)

Arguments

Y

Response Variable. A vector or length n (the number of samples).

X

Explanatory Variables to be tested. A matrix with dimensions n by K (the number of explanatory variables to be tested).

binary

Indicator of whether Y is binary.

cov

Covariates. A matrix with dimensions n by J (the number of explanatory variables that are not to be tested).

nperm

Number of permutations. Also the starting number of permutations for "step-up" algorithm. Default is 1,000.

adapt_perm

Whether "step-up" algorithm is used for P-value calculation. If FALSE, function permutes nperm times and stops. If TRUE, nperm will be increased 10 times each round if P-value <= 5/nperm. Algorithm stops if P-value > 5/nperm or <= cutoff.

cutoff

Cutoff for "step-up" algorithm.

n0

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

seed

Specify the seed for permutations.

Value

An object of "AF" class.

pv

P-value of AF test.

stat

AF statisitc.

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.

method

Method used.

See Also

set.seed

Examples

1
2
3
4
5
Y <- bs_dense$trait
methyl <- bs_dense$methyl
pos <- bs_dense$pos
test <- AF(Y, methyl, binary = TRUE)
summary(test)

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

Related to AF in cxystat/AFb...