9.6.1. Example of second level design matrix¶
This example shows how a second-level design matrix is specified: assuming that the data refer to a group of individuals, with one image per subject, the design matrix typically holds the characteristics of each individual.
This is used in a second-level analysis to assess the impact of these characteristics on brain signals.
This example requires matplotlib.
try: import matplotlib.pyplot as plt except ImportError: raise RuntimeError("This script needs the matplotlib library")
22.214.171.124. Create a simple experimental paradigm¶
We want to get the group result of a contrast for 20 subjects.
Next, we specify extra information about the subjects to create confounders. Without confounders the design matrix would correspond to a one sample test.
126.96.36.199. Create a second level design matrix¶
With that information we can create the second level design matrix.
/home/nicolas/GitRepos/nilearn-fork/nilearn/glm/first_level/design_matrix.py:475: UserWarning: Attention: Design matrix is singular. Aberrant estimates are expected.
Let’s plot it.
Total running time of the script: ( 0 minutes 2.468 seconds)
Estimated memory usage: 9 MB