Note

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

nilearn.glm.second_level.make_second_level_design_matrix

nilearn.glm.second_level.make_second_level_design_matrix(subjects_label, confounds=None)[source]

Set up a second level design.

Construct a design matrix with an intercept and subject specific confounds.

Parameters:
subjects_labellist of str

Contain subject labels to extract confounders in the right order, corresponding with the images, to create the design matrix.

confoundspandas.DataFrame or None, default=None

If given, contains at least two columns, subject_label and one confound. The subjects list determines the rows to extract from confounds thanks to its subject_label column. All subjects must have confounds specified. There should be only one row per subject.

Returns:
design_matrixpandas.DataFrame

The second level design matrix.

Examples using nilearn.glm.second_level.make_second_level_design_matrix

Example of second level design matrix

Example of second level design matrix