Presentation is loading. Please wait.

Presentation is loading. Please wait.

2nd level analysis – design matrix, contrasts and inference Deborah Talmi & Sarah White.

Similar presentations


Presentation on theme: "2nd level analysis – design matrix, contrasts and inference Deborah Talmi & Sarah White."— Presentation transcript:

1 2nd level analysis – design matrix, contrasts and inference Deborah Talmi & Sarah White

2 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

3 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

4 Fixed effects Fixed effect: A variable with fixed values Fixed effect: A variable with fixed values E.g. levels of an experimental variable. E.g. levels of an experimental variable. Random effect: A variable with values that can vary. Random effect: A variable with values that can vary. E.g. the effect ‘list order’ with lists that are randomized per subject E.g. the effect ‘list order’ with lists that are randomized per subject The effect ‘Subject’ can be described as either fixed or random The effect ‘Subject’ can be described as either fixed or random Subjects in the sample are fixed Subjects in the sample are fixed Subjects are drawn randomly from the population Subjects are drawn randomly from the population Typically treated as a random effect in behavioural analysis Typically treated as a random effect in behavioural analysis

5 Fixed effects analysis The factor ‘subject’ treated like other experimental variable in the design matrix. Within-subject variability across condition onsets represented across rows. Between-subject variability ignored Case-studies approach: Fixed-effects analysis can only describe the specific sample but does not allow generalization. Experimental conditions S1 S2 S3 S4 S5 Constants RegressorsCovariates

6 Random effects analysis Generalization to the population requires taking between-subject variability into account. Generalization to the population requires taking between-subject variability into account. The question: Would a new subject drawn from this population show any significant activity? The question: Would a new subject drawn from this population show any significant activity? Mixed models: the experimental factors are fixed but the ‘subject’ factor is random. Mixed models: the experimental factors are fixed but the ‘subject’ factor is random. Mixed models take into account both within- and between- subject variability. Mixed models take into account both within- and between- subject variability.

7 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

8 Relationship between 1 st & 2 nd levels 1 st -level analysis: Fit the model for each subject using different GLMs for each subject. 1 st -level analysis: Fit the model for each subject using different GLMs for each subject. Typically, one design matrix per subject Typically, one design matrix per subject Define the effect of interest for each subject with a contrast vector. Define the effect of interest for each subject with a contrast vector. The contrast vector produces a contrast image containing the contrast of the parameter estimates at each voxel. The contrast vector produces a contrast image containing the contrast of the parameter estimates at each voxel. 2 nd -level analysis: Feed the contrast images into a GLM that implements a statistical test. 2 nd -level analysis: Feed the contrast images into a GLM that implements a statistical test.

9 1 st level X values Convolved with HRF Convolution with the HRF changes the onsets we enter (1,0) to a gradient of values Convolution with the HRF changes the onsets we enter (1,0) to a gradient of values X values are then ordered on the x-axis to predict BOLD data on the Y axis. X values are then ordered on the x-axis to predict BOLD data on the Y axis.

10 1 st level parameter estimate = ŷ, predicted value intercept ŷ = ax + b ε = residual error = y i, true value slope (beta) Mean activation Y=data

11 Contrasts = combination of beta values Vowel = con = Vowel beta = Tone beta2 = con = Vowel - baseline Tone - baseline Vowel - baseline 11

12 Tone - baselineVowel - Tone Contrast images for the two classes of stimuli vs. baseline and vs. each other (linear combination of all relevant betas)

13 Difference from behavioral analysis The ‘1 st level analysis’ typical to behavioural data is relatively simple: The ‘1 st level analysis’ typical to behavioural data is relatively simple: A single number: categorical or frequency A single number: categorical or frequency A summary statistic, resulting from a simple model of the data, typically the mean. A summary statistic, resulting from a simple model of the data, typically the mean. SPM 1 st level is an extra step in the analysis, which models the response of one subject. The statistic generated (β) then taken forward to the GLM. SPM 1 st level is an extra step in the analysis, which models the response of one subject. The statistic generated (β) then taken forward to the GLM. This is possible because βs are normally distributed. This is possible because βs are normally distributed. A series of 3-D matrices (β values, error terms) A series of 3-D matrices (β values, error terms)

14 Both use the GLM model/tests and a similar SPM machinery Both use the GLM model/tests and a similar SPM machinery Both produce design matrices. Both produce design matrices. The columns in the design matrices represent explanatory variables: The columns in the design matrices represent explanatory variables: 1 st level: All conditions within the experimental design 1 st level: All conditions within the experimental design 2 nd level: The specific effects of interest 2 nd level: The specific effects of interest The rows represent observations: The rows represent observations: 1 st level: Time (condition onsets); within-subject variability 1 st level: Time (condition onsets); within-subject variability 2 nd level: subjects; between-subject variability 2 nd level: subjects; between-subject variability Similarities between 1st & 2nd levels

15 The same tests can be used in both levels (but the questions are different) The same tests can be used in both levels (but the questions are different).Con images: output at 1 st level, both input and output at 2 nd level.Con images: output at 1 st level, both input and output at 2 nd level There is typically only 1 1 st -level design matrix per subject, but multiple 2 nd level design matrices for the group – one for each statistical test. There is typically only 1 1 st -level design matrix per subject, but multiple 2 nd level design matrices for the group – one for each statistical test.

16 Multiple 2 nd level analyses 1-sample t-tests: 1-sample t-tests: Vowel vs. baseline [1 0] Vowel vs. baseline [1 0] Tone vs. baseline [0 1] Tone vs. baseline [0 1] Vowel > Tone [1 -1] Vowel > Tone [1 -1] Vowel or tone >baseline [1 1] Vowel or tone >baseline [1 1] Vowel Tone

17 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test Masking Masking Covariates Covariates 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

18 1-Sample t-test Enter 1.con image per subject All subjects weighted equally – all modeled with a ‘1’

19 2 nd level design matrix for 1-sample t-test Values from the design matrix Y = data (parameter estimates) 1 ŷ = 1*x +β 0 The question: is mean activation significantly greater than zero?

20 Estimation and results

21 1-Sample t-test figures These data (e.g. beta values) are available in the workspace – useful to create more complex figures

22 Statistical inference: imaging vs. behavioural data Inference of imaging data uses some of the same statistical tests as used for analysis of behavioral data: Inference of imaging data uses some of the same statistical tests as used for analysis of behavioral data: t-tests, t-tests, ANOVA ANOVA The effect of covariates for the study of individual-differences The effect of covariates for the study of individual-differences Some tests are more typical in imaging: Some tests are more typical in imaging: Conjunction analysis Conjunction analysis Multiple comparisons poses a greater problem in imaging Multiple comparisons poses a greater problem in imaging

23 Masking Implicit mask: the default, excluding voxels with ‘NaN’ or ‘0’ values Threshold masking: Images are thresholded at a given value and only voxels at which all images exceed the threshold Explicit mask: only user-defined voxels are included in the analysis

24 Explicit masks Group maskSingle subject mask ROI mask Segmentation of structural images

25 Covariates in 1-Sample t-test An additional regressor in the design matrix specifying subject-specific information (e.g. age). Nuisance covariates, covariate of interest: Included in the model in the same way. Nuisance: Contrast [1 0] focuses on mean, partialing out activation due to a variable of no interest Covariate of interest: contrast [0 1] focuses on the covariate. The parameter estimate represents the magnitude of correlation between task-specific activations and the subject-specific measure.

26 Covariate options Entering single number per subject. Centering: the vector will be mean- corrected

27 Covariate results Covariate Parameter estimate Slope: Parameter estimate of 2 nd level covariate Mean activation Centred covariate mean

28 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

29 Factorial design First…back to first level analysis First…back to first level analysis here, 2 factors with 2/3 levels making 6 conditions here, 2 factors with 2/3 levels making 6 conditions For each subject we could create a number of effects of interest, eg. For each subject we could create a number of effects of interest, eg. each condition separately each condition separately each level separately each level separately contrast between levels within a factor contrast between levels within a factor interaction between factors interaction between factors A1 B1 A2 B B3 3 6 [1,-1,0,-1,1,0,0] [1,1,1,-1,-1,-1,0] [1,0,0,0,0,0,0] [1,1,1,0,0,0,0]

30 Paired t-tests This is when we start being interested in contrasts at 2nd level This is when we start being interested in contrasts at 2nd level Within group Within group between subject variance is greater than within subject variance between subject variance is greater than within subject variance better use of time to have more subjects for shorter scanning slots than vice versa better use of time to have more subjects for shorter scanning slots than vice versa

31 Paired t-tests This is when we start being interested in contrasts at 2nd level This is when we start being interested in contrasts at 2nd level Within group Within group whether, across subjects, one effect of interest (A1) is significantly greater than another effect of interest (A2) whether, across subjects, one effect of interest (A1) is significantly greater than another effect of interest (A2) contrast vector [1,-1] contrast vector [1,-1] one-tailed / directional one-tailed / directional asks specific Q, eg. is A1>A2? asks specific Q, eg. is A1>A2? You could equally do this same analysis by creating the contrast at the 1st level analysis and then running a one-sample t-test at the 2nd level You could equally do this same analysis by creating the contrast at the 1st level analysis and then running a one-sample t-test at the 2nd level A1 A2 A1 B1 A2 B B3 3 6

32 Factorial design This is when we start being interested in contrasts at 2nd level This is when we start being interested in contrasts at 2nd level Within group Within group whether, across subjects, one effect of interest (A1) is significantly greater than another effect of interest (A2) whether, across subjects, one effect of interest (A1) is significantly greater than another effect of interest (A2) contrast vector [1,1,1,-1,-1,-1] contrast vector [1,1,1,-1,-1,-1] one-tailed / directional one-tailed / directional asks specific Q, eg. is A1>A2? asks specific Q, eg. is A1>A2? A1 B1 A2 B B3 3 6

33 Factorial design Conjunction analysis Conjunction analysis Simple example within group Simple example within group whether, across subjects, those voxels significantly activated in one contrast are also significantly activated in another whether, across subjects, those voxels significantly activated in one contrast are also significantly activated in another eg. whether the difference between A1 and A2 is significant across all three conditions B1, B2 and B3 eg. whether the difference between A1 and A2 is significant across all three conditions B1, B2 and B3 contrast vector ??? contrast vector ??? [1,1,1,-1,-1, -1] given [1,0,0,-1,0,0] & [0,1,0,0,-1,0] and [0,0,1,0,0,-1] [1,1,1,-1,-1, -1] given [1,0,0,-1,0,0] & [0,1,0,0,-1,0] and [0,0,1,0,0,-1] basically testing whether there is a main effect in the absence of an interaction basically testing whether there is a main effect in the absence of an interaction A1 B1 A2 B B3 3 6

34 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

35 Two sample t-tests This is a contrast again This is a contrast again but can’t be done at the 1st level of analysis this time but can’t be done at the 1st level of analysis this time Between groups Between groups both groups must have same design matrix both groups must have same design matrix

36 Two sample t-tests This is a contrast again This is a contrast again but can’t be done at the 1st level but can’t be done at the 1st level Between groups Between groups whether, across conditions, the difference between two groups of subjects (M & F) is significant whether, across conditions, the difference between two groups of subjects (M & F) is significant one-tailed / directional one-tailed / directional asks specific Q, eg. is M>F? asks specific Q, eg. is M>F? contrast vector [1,-1] contrast vector [1,-1] Unlike the paired samples t-test, there’s no other way to do this analysis as you haven’t been able to collapse data across subjects before Unlike the paired samples t-test, there’s no other way to do this analysis as you haven’t been able to collapse data across subjects before A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6 M F

37 Factorial design This is a contrast again This is a contrast again but can’t be done at the 1st level but can’t be done at the 1st level Between groups Between groups whether, across conditions, the difference between two groups of subjects (M & F) is significant whether, across conditions, the difference between two groups of subjects (M & F) is significant one-tailed / directional one-tailed / directional asks specific Q, eg. is M>F? asks specific Q, eg. is M>F? contrast vector [1,1,1,1,1,1,-1,-1,-1,-1,-1,-1] contrast vector [1,1,1,1,1,1,-1,-1,-1,-1,-1,-1] M F A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6

38 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: F-tests 2 nd level analysis: F-tests Multiple comparisons Multiple comparisons

39 F-tests This is for multiple contrasts This is for multiple contrasts Within and between groups Within and between groups whether, across conditions and/or subjects, a number of different contrasts are significant whether, across conditions and/or subjects, a number of different contrasts are significant gives differences in both directions (+ve & -ve) gives differences in both directions (+ve & -ve) equivalent to lots of 2-tailed t-test equivalent to lots of 2-tailed t-test asks general question: A1 ≠ A2 asks general question: A1 ≠ A2 contrast vector for main effect of A: contrast vector for main effect of A:[1,-1,0,0][0,0,1,-1] A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6 M F A1 A2

40 F-tests This is for multiple contrasts This is for multiple contrasts Within and between groups Within and between groups whether, across conditions and/or subjects, a number of different contrasts are significant whether, across conditions and/or subjects, a number of different contrasts are significant gives differences in both directions (+ve & -ve) gives differences in both directions (+ve & -ve) equivalent to lots of 2-tailed t-test equivalent to lots of 2-tailed t-test asks general question: A1 ≠ A2 asks general question: A1 ≠ A2 contrast vector for main effect of A: contrast vector for main effect of A:[1,0,0,-1,0,0,0,0,0,0,0,0][0,1,0,0,-1,0,0,0,0,0,0,0][0,0,1,0,0,-1,0,0,0,0,0,0][0,0,0,0,0,0,1,0,0,-1,0,0][0,0,0,0,0,0,0,1,0,0,-1,0][0,0,0,0,0,0,0,0,1,0,0,-1] A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6 M F

41 F-tests This is for multiple contrasts This is for multiple contrasts Within and between groups Within and between groups whether, across conditions and/or subjects, a number of different contrasts are significant whether, across conditions and/or subjects, a number of different contrasts are significant gives differences in both directions (+ve & -ve) gives differences in both directions (+ve & -ve) equivalent to lots of 2-tailed t-test equivalent to lots of 2-tailed t-test asks general question: M ≠ F asks general question: M ≠ F contrast vector for main effect of sex: contrast vector for main effect of sex:[1,0,0,1,0,0,0,0,0,0,0,0][0,1,0,0,1,0,0,0,0,0,0,0][0,0,1,0,0,1,0,0,0,0,0,0][0,0,0,0,0,0,-1,0,0,-1,0,0][0,0,0,0,0,0,0,-1,0,0,-1,0][0,0,0,0,0,0,0,0,-1,0,0,-1] A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6 M F

42 F-tests This is for multiple contrasts This is for multiple contrasts Within and between groups Within and between groups whether, across conditions and/or subjects, a number of different contrasts are significant whether, across conditions and/or subjects, a number of different contrasts are significant gives differences in both directions (+ve & -ve) gives differences in both directions (+ve & -ve) equivalent to lots of 2-tailed t-test equivalent to lots of 2-tailed t-test asks general question: M(A1-A2) ≠ F(A1-A2) asks general question: M(A1-A2) ≠ F(A1-A2) contrast vector for interaction between A and sex: contrast vector for interaction between A and sex:[1,0,0,-1,0,0,0,0,0,0,0,0][0,1,0,0,-1,0,0,0,0,0,0,0][0,0,1,0,0,-1,0,0,0,0,0,0][0,0,0,0,0,0,-1,0,0,1,0,0][0,0,0,0,0,0,0,-1,0,0,1,0][0,0,0,0,0,0,0,0,-1,0,0,1] A1 B1 A2 B B3 3 6 A1 B1 A2 B B3 3 6 M F

43 Overview Fixed, random, and mixed models Fixed, random, and mixed models From 1 st to 2 nd level analysis From 1 st to 2 nd level analysis 2 nd level analysis: 1-sample t-test 2 nd level analysis: 1-sample t-test 2 nd level analysis: Paired t-test 2 nd level analysis: Paired t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: 2-sample t-test 2 nd level analysis: ANOVA 2 nd level analysis: ANOVA Multiple comparisons Multiple comparisons

44 Multiple comparisons we’re still doing these comparisons for each voxel involved in the analysis (even though we’ve collapsed across time) -> lots of comparisons we’re still doing these comparisons for each voxel involved in the analysis (even though we’ve collapsed across time) -> lots of comparisons also multiple contrasts also multiple contrasts problem of false positives problem of false positives correction for multiple comparisons correction for multiple comparisons cf talk on random field theory cf talk on random field theory

45 References Previous MFD presentations Previous MFD presentations SPM5 Manual, The FIL Methods Group (2007) SPM5 Manual, The FIL Methods Group (2007) Poline, Kherif, Pallier & Penny, Chapter 9, Statistical Parametric Mapping (2007) Poline, Kherif, Pallier & Penny, Chapter 9, Statistical Parametric Mapping (2007) Penny & Holmes, Chapter 12, Human Brain function (2 nd edition) Penny & Holmes, Chapter 12, Human Brain function (2 nd edition)


Download ppt "2nd level analysis – design matrix, contrasts and inference Deborah Talmi & Sarah White."

Similar presentations


Ads by Google