StatsMcCorrection
Namespace: STSLIB · Library: Statistics Library
#include <sts/sts_correction.h>
class STSLIB::StatsMcCorrection
Multiple comparison correction methods.
Bonferroni, Holm-Bonferroni and Benjamini-Hochberg FDR adjustments for mass-univariate p-value maps.
MatrixXd pValues(1, 8);
pValues << 0.001, 0.008, 0.039, 0.041, 0.042, 0.06, 0.074, 0.205;
const MatrixXd pBonferroni = StatsMcCorrection::bonferroni(pValues);
const MatrixXd pHolm = StatsMcCorrection::holmBonferroni(pValues);
const MatrixXd pFdr = StatsMcCorrection::fdr(pValues); // Benjamini-Hochberg adjusted p-values
Static Methods
bonferroni(pValues, alpha, reject)
Bonferroni correction as mne.stats.bonferroni_correction: corrected_p = min(p * n, 1.0).
Parameters:
-
pValues : const Eigen::MatrixXd & Matrix of p-values.
-
alpha : double Significance level for
reject. -
reject : *RejectMask ** If not null, receives corrected_p < alpha.
Returns:
- Eigen::MatrixXd — Corrected p-values (same shape as input).
holmBonferroni(pValues)
Holm-Bonferroni step-down correction.
Parameters:
- pValues : const Eigen::MatrixXd & Matrix of p-values.
Returns:
- Eigen::MatrixXd — Corrected p-values (same shape as input).
fdr(pValues, alpha, method, reject)
False Discovery Rate correction as mne.stats.fdr_correction.
Parameters:
-
pValues : const Eigen::MatrixXd & Matrix of p-values.
-
alpha : double False discovery rate for
reject. -
method : FdrMethod Benjamini-Hochberg or Benjamini-Yekutieli.
-
reject : *RejectMask ** If not null, receives the hypotheses rejected by the step-up procedure.
Returns:
- Eigen::MatrixXd — Corrected p-values (same shape as input).
Example
- Full source:
src/examples/ex_sts_statistics/main.cpp - Build target:
ex_sts_statistics(runs under CTest)
Used in examples
ex_sts_statistics
Statistics library on small literal data sets with known answers.
MatrixXd pValues(1, 8);
pValues << 0.001, 0.008, 0.039, 0.041, 0.042, 0.06, 0.074, 0.205;
const MatrixXd pBonferroni = StatsMcCorrection::bonferroni(pValues);
const MatrixXd pHolm = StatsMcCorrection::holmBonferroni(pValues);
const MatrixXd pFdr = StatsMcCorrection::fdr(pValues); // Benjamini-Hochberg adjusted p-values
// mne.stats.bonferroni_correction / fdr_correction; Holm step-down closed form
ok &= expectRow(pBonferroni, {0.008, 0.064, 0.312, 0.328, 0.336, 0.48, 0.592, 1.0}, 1e-12, "Bonferroni = mne");
ok &= expectRow(pHolm, {0.008, 0.056, 0.234, 0.234, 0.234, 0.234, 0.234, 0.234}, 1e-12, "Holm = closed form");
ok &= expectRow(pFdr, {0.008, 0.032, 0.0672, 0.0672, 0.0672, 0.08, 0.08457142857142856, 0.205}, 1e-12, "FDR = mne");
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>