p_from_perms_or_gfit: p_from_perms_or_gfit

View source: R/gamma_funs.r

p_from_perms_or_gfitR Documentation

p_from_perms_or_gfit

Description

calculates a P-value either from permutations (via the regular quantile approach) or from a fit_gamma_fwd_rev() fit.

Usage

p_from_perms_or_gfit(
  emp,
  perm = NULL,
  gfit = NULL,
  fallback = 1,
  tails = 1,
  threshold = 30
)

Arguments

emp

an empirical value (a quantile).

perm

numeric vector of values (use this OR gfit, not both. default: NULL).

gfit

object returned by fit_gamma_fwd_rev() (use this OR perm, not both. default: NULL).

fallback

anything. what to return if gfit failed (default: 1)

tails

integer, 1, 2, or 3. 1 means left tail, 2 means both tails, 3 means right (default: 1).

threshold

integer. minimum number of perms required to return a P-value (default: 30).

Value

either a single value (a P-value), or fallback.

Author(s)

John L. Darcy


darcyj/specificity documentation built on Aug. 1, 2023, 8 a.m.