nimare.correct.FWECorrector

class FWECorrector(method='bonferroni', n_iters=None, n_cores=1, **kwargs)[source]

Bases: Corrector

Perform family-wise error rate correction on a meta-analysis.

Parameters:
  • method ({'bonferoni', 'montecarlo'}) – The FWE correction to use. Note that the ‘montecarlo’ method is only available for a subset of Estimators. To determine what methods are available for the Estimator you’re using, use inspect().

  • voxel_thresh (float, optional) – Only used if method='montecarlo'. The uncorrected voxel-level threshold to use.

  • n_iters (int, default=5000) – Number of iterations to use for Monte Carlo correction. Default varies by Estimator. For publication-quality results, 5000 or more iterations are recommended.

  • n_cores (int, default=1) – Number of cores to use for Monte Carlo correction. Default is 1.

  • **kwargs – Keyword arguments to be used by the FWE correction implementation.

Methods

correct_fwe_bonferroni(p)

Perform Bonferroni FWE correction.

get_params([deep])

Get parameters for this estimator.

inspect(result)

Identify valid 'method' values for a MetaResult object.

load(filename[, compressed])

Load a pickled class instance from file.

save(filename[, compress])

Pickle the class instance to the provided file.

set_params(**params)

Set the parameters of this estimator.

transform(result)

Apply the multiple comparisons correction method to a MetaResult object.

correct_fwe_bonferroni(p)[source]

Perform Bonferroni FWE correction.

This correction is based on the one described in Bonferroni[1] and Shaffer[2].

Warning

Do not call this method directly. Call transform() with method='bonferroni' instead.

Added in version 0.0.12.

Parameters:

p (numpy.ndarray) – A 1D array of p values.

Returns:

  • p_corr (numpy.ndarray) – A 1D array of adjusted p values.

  • tables (dict) – A dictionary of DataFrames with summary information from the correction. This correction method does not produce any tables, so it will be an empty dict.

  • description_ (str) – A description of the correction procedure.

References

See also

nimare.stats.bonferroni

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params – Parameter names mapped to their values.

Return type:

dict

classmethod inspect(result)[source]

Identify valid ‘method’ values for a MetaResult object.

In addition to returning a list of valid values, this method will also print out those values, divided by the value type (Estimator or generic).

Parameters:

result (MetaResult) – Object for which valid correction methods (i.e., ‘method’ values) will be identified.

Returns:

List of valid ‘method’ values for the Corrector+Estimator combination, including both non-specific methods and Estimator-specific ones.

Return type:

list

classmethod load(filename, compressed=True)[source]

Load a pickled class instance from file.

Parameters:
  • filename (str) – Name of file containing object.

  • compressed (bool, default=True) – If True, the file is assumed to be compressed and gzip will be used to load it. Otherwise, it will assume that the file is not compressed. Default = True.

Returns:

obj – Loaded class object.

Return type:

class object

save(filename, compress=True)[source]

Pickle the class instance to the provided file.

Parameters:
  • filename (str) – File to which object will be saved.

  • compress (bool, optional) – If True, the file will be compressed with gzip. Otherwise, the uncompressed version will be saved. Default = True.

set_params(**params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Return type:

self

transform(result)[source]

Apply the multiple comparisons correction method to a MetaResult object.

Parameters:

result (MetaResult) – MetaResult generated by an Estimator to be corrected for multiple comparisons.

Returns:

result – MetaResult with new corrected maps, tables, and description added.

Return type:

MetaResult

Examples using nimare.correct.FWECorrector

Coordinate-based meta-analysis algorithms

Coordinate-based meta-analysis algorithms

Image-based meta-analysis algorithms

Image-based meta-analysis algorithms

The Corrector class

The Corrector class

Meta-analytic coactivation modeling analysis

Meta-analytic coactivation modeling analysis

Two-sample ALE meta-analysis

Two-sample ALE meta-analysis