p_ecdf: Estimate p-value from simulations

Description Usage Arguments Details Value References

View source: R/p_ecdf.R

Description

Estimate p-value by comparing a score to its permutations.

Usage

1
2
p_ecdf(eval.v, score.mat, alternative = c("greater", "two.sided",
  "less"))

Arguments

eval.v

A vector of values where the cumulative distribution function should be evaluated.

score.mat

A matrix-like object with scores from original data and possibly permutations with rows corresponding to features and columns to simulations.

alternative

A character string specifying the alternative hypothesis.

Details

It's checked that rownames(score.mat)==names(eval.v). If a p-value is 1, it results in a z-score of -Inf, which can produce an error in downstream analysis, so we calculate a new p-value as 1 - 10^(-6).

Value

A matrix with two columns containing z-scores (larger is more significant) & p-values with nrow = length(eval.v).

References

Phipson B, Smyth GK. Permutation P-values should never be zero: calculating exact P-values when permutations are randomly drawn. Stat Appl Genet Mol Biol. 2010;9:Article39. doi: 10.2202/1544-6115.1585.


jdreyf/PANTS documentation built on July 18, 2019, 10:12 a.m.