pval_correct: Calculate p-value corrections

View source: R/pval_correct.R

pval_correctR Documentation

Calculate p-value corrections

Description

Internal function to calculate various p-value corrections for use within the rrs and lotrrs functions.

Usage

pval_correct(
  input,
  type = c("FDR", "correlated Sidak", "correlated Bonferroni", "uncorrelated Sidak",
    "uncorrelated Bonferroni", "Adler and Hasofer", "Friston"),
  alpha = 0.05,
  nbc = NULL
)

Arguments

input

An object of class 'rrs' from the rrs or lotrrs function.

type

Character string specifying which correction for multiple comparisons. Options include a False Discovery Rate p_correct = "FDR", a spatially dependent Sidak correction p_correct = "correlated Sidak", a spatially dependent Bonferroni correction p_correct = "correlated Bonferroni", an independent Sidak correction p_correct = "uncorrelated Sidak", an independent Bonferroni correction p_correct = "uncorrelated Bonferroni", a Adler and Hasofer equation for the maximum of a Gaussian random field p_correct = "Adler and Hasofer", and a Friston et al. equation for the maximum of a Gaussian random field p_correct = "Friston".

alpha

Numeric. The two-tailed alpha level for significance threshold (default in rrs and lotrrs functions is 0.05).

nbc

Integer. The number of bins. Similar to nbclass argument in modified.ttest function. The default is 30.

Details

This function provides functionality for multiple testing correction in five ways:

  1. Computes a False Discovery Rate by Benjamini and Hochberg doi: 10.1111/j.2517-6161.1995.tb02031.x (p_correct = "FDR") by: 1) sorting the p-values (p_i) of each knot in ascending order (p_1 <= p_2 <= ... <= p_m), 2) starting from p_m find the first p_i for which p_i <= (i/m) * alpha.

  2. Computes an independent Sidak correction doi: 10.2307/2283989 (p_correct = "uncorrelated Sidak") by 1 - (1 - alpha) ^ (1 / total number of gridded knots across the estimated surface). The default in the risk function is a resolution of 128 x 128 or n = 16,384 knots and a custom resolution can be specified using the resolution argument within the risk function.

  3. Computes an independent Bonferroni correction (p_correct = "uncorrelated Bonferroni") by alpha / total number of gridded knots across the estimated surface. The default in the risk function is a resolution of 128 x 128 or n = 16,384 knots and a custom resolution can be specified using the resolution argument within the risk function.

  4. Computes a spatially dependent Sidak correction (p_correct = "correlated Sidak") by taking into account the spatial correlation of the relative risk surface values (if using the rrs function for a single condition gate) or the ratio of relative risk surfaces values (if using the lotrrs function for a two condition gate). The correction uses the minimum number of knots that are not spatially correlated instead of the total number of knots. The minimum number of knots that are not spatially correlated is computed by counting the knots that are a distance apart that exceeds the minimum distance of non-significant spatial correlation based on a correlogram using the modified.ttest function.

  5. Computes a spatially dependent Bonferroni correction (p_correct = "correlated Bonferroni") by taking into account the spatial correlation of the relative risk surface values (if using the rrs function for a single condition gate) or the ratio of relative risk surfaces values (if using the lotrrs function for a two condition gate). The correction uses the minimum number of knots that are not spatially correlated instead of the total number of knots. The minimum number of knots that are not spatially correlated is computed by counting the knots that are a distance apart that exceeds the minimum distance of non-significant spatial correlation based on a correlogram using the modified.ttest function.

  6. Computes a critical p-value based on Random Field Theory and the Adler and Hasofer equation (p_correct = "Euler A&H") doi: 10.1214/aop/1176996176 and p.111 of doi: 10.1137/1.9780898718980. The correction uses the number of knots that are independent based on the bandwidth used in the kernel density estimation of the spatial relative risk function.

  7. Computes a critical p-value based on Random Field Theory and the Friston et al. equation (p_correct = "Euler Friston") doi: 10.1038/jcbfm.1991.122 which differs from Adler and Hasofer's equation by a factor of 0.79. The correction uses the number of knots that are independent based on the bandwidth used in the kernel density estimation of the spatial relative risk function.

Value

An object of class 'numeric' with the corrected alpha level.


gateR documentation built on Feb. 16, 2023, 5:24 p.m.