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.

3.3.3. nistats.design_matrix.make_second_level_design_matrix

nistats.design_matrix.make_second_level_design_matrix(subjects_label, confounds=None)

Sets up a second level design.

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

subjects_label: list of str

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

confounds: pandas DataFrame, optional

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.

design_matrix: pandas DataFrame

The second level design matrix Examples using nistats.design_matrix.make_second_level_design_matrix