FDR_1D

FDR_1D(varargin)

FDR_1D Performs statistical comparisons between 1D vectors using a False Discover Rate (FDR) approach

Usage:

FDR_1D(group1, group2, <options>)

Input:
  • group1: Numeric 1D vector x <trials> array representing the first group of data.

  • group2: Numeric 1D vector x <trials> array representing the second group of data.

  • FDR: (Optional) False Discovery Rate (FDR) threshold for multiple testing correction. Default is 0.05.

  • method: (Optional) ‘dependent’ will use the Benjamini & Yekutieli (2001) procedure, and ‘independent’ will use the Benjamini & Hochberg (1995) procedure that assumes data are independent or positively dependent. Default is ‘dependent’

  • paired: (Optional) Boolean indicating whether the data in group1 and group2 are paired. Default is false.

  • nonparam: (Optional) Boolean indicating whether to use nonparametric test.

    For nonparametric tests, a ranksum test is use for unpaired an a signrank test is used for paired. Paired an unpaired t-tests are used otherwise Default is true.

  • ploton: (Optional) Boolean indicating whether to plot the results. Default is true.

Output:
  • sigbins: 1D vector indicating significant segments along the 1D dimension differing between group1 and group2.

  • p_adj: 1D Vector of adjusted p-values after multiple testing correction.

  • p_values: 1D vector of raw p-values.

Notes:

Missing data (NaN, and Inf which is converted to NaN on entry) is handled by complete-case deletion, which is what ranksum, signrank, ttest2 and ttest all do natively – NaNs are NOT imputed. A bin with nothing left to compare (no observations in one group, or for a paired test no position where both groups are observed) is untestable and returns a NaN p-value; fdr_bh drops those from the family, so they do not count toward m and cannot be flagged significant.

The effective n therefore varies from bin to bin. Thinly-observed bins still enter the family and inflate m; a rank test on few observations simply cannot reach a small p (n = 2 vs 2 bottoms out at p = 1/3), so this costs sensitivity rather than creating false positives. Mask low-coverage bins upstream if that matters for your analysis.

Example:

%Run FDR_1D() for demo data

See also:

FDR_2D, fdr_bh

Copyright 2024 Michael J. Prerau Laboratory. - http://www.sleepEEG.org