corrections¶
Multiple comparison corrections and thresholding.
Methods:
| Name | Description |
|---|---|
fdr | Determine an FDR threshold for an array of p-values. |
holm_bonf | Compute Holm-Bonferroni-corrected p-values. |
multi_threshold | Threshold test image by multiple p-values from p image. |
threshold | Threshold test image by p-value from p image. |
Methods¶
fdr¶
fdr(p, q = 0.05)Determine an FDR threshold for an array of p-values.
Uses the desired false discovery rate q. Written by Tal Yarkoni.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p | (np.array) vector of p-values | required | |
q | (float) false discovery rate level | 0.05 |
Returns:
| Name | Type | Description |
|---|---|---|
fdr_p | (float) p-value threshold based on independence or positive dependence |
holm_bonf¶
holm_bonf(p, alpha = 0.05)Compute Holm-Bonferroni-corrected p-values.
This step-down procedure applies iteratively less correction to the highest p-values. It is a bit more conservative than FDR, but much more powerful than vanilla Bonferroni correction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p | (np.array) vector of p-values | required | |
alpha | (float) alpha level | 0.05 |
Returns:
| Name | Type | Description |
|---|---|---|
bonf_p | (float) p-value threshold based on bonferroni step-down procedure |
multi_threshold¶
multi_threshold(t_map, p_map, thresh)Threshold test image by multiple p-values from p image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t_map | (BrainData) BrainData instance of statistic metric (e.g., t-statistic, beta, etc) | required | |
p_map | (BrainData) BrainData instance of p-values | required | |
thresh | (list) list of p-values to threshold stat image | required |
Returns:
| Name | Type | Description |
|---|---|---|
out | Thresholded BrainData instance with cumulative map - Positive values indicate how many thresholds were passed for positive stats - Negative values indicate how many thresholds were passed for negative stats |
Note
This function provides unique cumulative threshold map functionality:
Creates a single map showing which thresholds were passed
Different from calling threshold() multiple times (which would give separate images)
Useful for visualizing threshold hierarchies
nilearn.threshold_img() does not support cumulative multi-threshold maps
threshold¶
threshold(stat, p, thr = 0.05, return_mask = False)Threshold test image by p-value from p image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stat | (BrainData) BrainData instance of arbitrary statistic metric (e.g., beta, t, etc) | required | |
p | (BrainData) BrainData instance of p-values | required | |
thr | (float) p-value threshold to apply | 0.05 | |
return_mask | (bool) optionally return the thresholding mask; default False | False |
Returns:
| Name | Type | Description |
|---|---|---|
out | Thresholded BrainData instance | |
mask | (optional) BrainData instance of thresholding mask if return_mask=True |
Note
This function provides unique functionality not available in nilearn:
Thresholds stat image based on p-values from separate p-value image
Neither nilearn.threshold_img nor BrainData.threshold() support this
BrainData.threshold() thresholds based on stat values themselves
nilearn.threshold_img() thresholds based on image intensity values