updateCutoffs: Update FDR by Permutation

View source: R/3-shared-updateCutoffs.R

updateCutoffsR Documentation

Update FDR by Permutation

Description

This function updates the FDR for each cutoff. By default, the set of cutoffs are determined based on the quantile of the data, so that the cutoffs are evenly spaced across the data. The FDR is calculated as the ratio between the number of permuted values beyond the cutoff and the number of true values beyond the the cutoff. When tails is set to 'right', the FDR is calculated only on the positive side of the data. When tails is set to 'both', the FDR is calculated on both sides of the data.

Usage

updateCutoffs(
  object,
  number_of_cutoffs = 100,
  custom_cutoffs = NA,
  tails = "right",
  ncores = 1
)

updateCutoffs.propr(
  object,
  number_of_cutoffs = 100,
  custom_cutoffs = NA,
  tails = "right",
  ncores = 1
)

updateCutoffs.propd(
  object,
  number_of_cutoffs = 100,
  custom_cutoffs = NA,
  ncores = 1
)

Arguments

object

A propr or propd object.

number_of_cutoffs

An integer. The number of cutoffs to test. Given this number, the cutoffs will be determined based on the quantile of the data. In this way, the cutoffs will be evenly spaced across the data.

custom_cutoffs

A numeric vector. When provided, this vector is used as the set of cutoffs to test, and 'number_of_cutoffs' is ignored.

tails

'right' or 'both'. 'right' is for one-sided on the right. 'both' for symmetric two-sided test. This is only relevant for propr objects, as propd objects are always one-sided and only have positive values. Default is 'right'.

ncores

An integer. The number of parallel cores to use.

Value

A propr or propd object with the FDR slot updated.

Methods

updateCutoffs.propr: Use the propr object to permute correlation-like metrics (ie. rho, phi, phs, cor, pcor, pcor.shrink, pcor.bshrink), across a number of cutoffs. Since the permutations get saved when the object is created, calling updateCutoffs will use the same random seed each time.

updateCutoffs.propd: Use the propd object to permute theta across a number of theta cutoffs. Since the permutations get saved when the object is created, calling updateCutoffs will use the same random seed each time.


tpq/propr documentation built on Feb. 3, 2025, 4:23 a.m.