Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

8.12.1. nilearn.glm.Contrast

class nilearn.glm.Contrast(effect, variance, dim=None, dof=10000000000.0, contrast_type='t', tiny=1e-50, dofmax=10000000000.0)

The contrast class handles the estimation of statistical contrasts on a given model: student (t) or Fisher (F). The important feature is that it supports addition, thus opening the possibility of fixed-effects models.

The current implementation is meant to be simple, and could be enhanced in the future on the computational side (high-dimensional F constrasts may lead to memory breakage).

__init__(effect, variance, dim=None, dof=10000000000.0, contrast_type='t', tiny=1e-50, dofmax=10000000000.0)
Parameters:

effect : array of shape (contrast_dim, n_voxels)

the effects related to the contrast

variance : array of shape (n_voxels)

the associated variance estimate

dim: int or None,

the dimension of the contrast

dof : scalar

the degrees of freedom of the residuals

contrast_type: {‘t’, ‘F’}

specification of the contrast type

effect_size()

Make access to summary statistics more straightforward when computing contrasts

effect_variance()

Make access to summary statistics more straightforward when computing contrasts

p_value(baseline=0.0)

Return a parametric estimate of the p-value associated with the null hypothesis: (H0) ‘contrast equals baseline’

Parameters:

baseline : float, optional

baseline value for the test statistic

Returns:

p_values : 1-d array, shape=(n_voxels,)

p-values, one per voxel

stat(baseline=0.0)

Return the decision statistic associated with the test of the null hypothesis: (H0) ‘contrast equals baseline’

Parameters:

baseline : float, optional

Baseline value for the test statistic

Returns:

stat: 1-d array, shape=(n_voxels,)

statistical values, one per voxel

z_score(baseline=0.0)

Return a parametric estimation of the z-score associated with the null hypothesis: (H0) ‘contrast equals baseline’

Parameters:

baseline: float, optional,

Baseline value for the test statistic

Returns:

z_score: 1-d array, shape=(n_voxels,)

statistical values, one per voxel