help > RE: Design matrix and contrast for 2x2 design
Aug 5, 2017  12:08 AM | Andrew Zalesky
RE: Design matrix and contrast for 2x2 design
Hi David,what you have is a 2 x 2 ANOVA with repeated measure on both factors. So you will need to use exchange blocks in your design to account for the repeated measures.

Let's assume you only have two subjects (you can easily generalize my below suggestions to 12 subjects). Let's use P and D to denote placebo and drug. Let's use M and N to denote music and no music. So "PN1" means the no music placebo condition of Subject 1. Your design matrix should look like this:

PN1 0 0 0 1 0
PN2 0 0 0 0 1
PM1 0 1 0 1 0
PM2 0 1 0 0 1
DN1 1 0 0 1 0
DN2 1 0 0 0 1
DM1 1 1 1 1 0
DM2 1 1 1 0 1

The 1st column is the main effect of drug. 2nd column is main effect of music. 3rd column is the interaction between music and drug. Column 4 and 5 is the mean of subject 1 and 2, respectively.

You should be able to extend this design matrix for 12 subjects. Note that if you have 12 subjects, you should have 15 columns in total and 12 rows. 1 column for each subject  + 2 main effects + 1 interaction = 15 columns.

To test for main effect of drug, contrast is: [1 0 0 0 0] or [-1 0 0 0 0]

Main effect of music: [0 1 0 0 0] or [0 -1 0 0 0]

Interaction: [0 0 1 0 0] or [0 0 -1 0 0]

Choose: "t-test"

The exchange block should be:
[1 2 1 2 1 2 1 2]

So I have given you all the information for the case of 2 subjects. Now you should be able to generalize this to the case of 12 subjects.

Let me now if you need help to generalize from 2 to 12 subjects.


Using r or r-to-z usually makes no difference. Reviewers might bring it up - so you might as well use r-to-z.

Andrew




Originally posted by David de Wide:
Dear Dr. Zalesky,

Thank you to you and your collegues for the wonderful tools and toolboxes you have given the neuroscientific research community!

I've been working with the NBS toolbox for most of the day, and while I have made great progress in understanding what I am doing, I'm still unsure about which design matrix to use (I've made quite a few).
The help section for statistical model was very useful, but after creating several different matrices and analyses, I'm still unsure which is correct.

Simply put, I have 48 matrices belonging to 12 participants (within subjects design). They were tested on 2 seperate days (Placebo vs Drug) and had two resting state scans on each day (No music vs Music). The order of the matrices (90x90x48) is as follows:


S01 Placebo No-music (0 0)
till
S12 Placebo No-music (0 0)

S01 Placebo Music  (0 1)
till
S12 Placebo Music (0 1)

S01 Drug No-music (1 0)
till
S12 Drug No-music (1 0)

S01 Drug Music (1 1)
till
S12 Drug Music (1 1)

I am interested in the main effects of drug and music, but more specifically in the interaction effect between drug and music (and subsequently visualizing this in BrainNet). Using FDR there are barely any suriving edges, and the NBS seems perfect for situations like these.

My main issue has been the design matrix. As pictured above, I initially had a simple 48x2 with 1s and 0s (and later 1 and -1), but was consistently getting 1000s of significant edges for certain thresholds (so clearly not looking at the specific interaction). Could you tell me the dimensions of the required/recommended design matrix? I've attempted a 48x3 for A, B and AxB, 48x5 for A1, A2, B1, B2, AB, but am confused about the requirement of a column for each participant?

If someone here could provide me with some tips/pointers about the required dimensions for the matrix, the interaction contrast, and how the first line in the matrxi would look, I'm sure I can figure out the rest through deductive reasoning. Any help would be greatly appericiated.

Sincerely,

David

ps. Would you recommend using raw R values or Fisher Z transformed R values?

Threaded View

TitleAuthorDate
David de Wide Aug 3, 2017
yue zhang Jan 11, 2020
RE: Design matrix and contrast for 2x2 design
Andrew Zalesky Aug 5, 2017
Liam Nestor Sep 27, 2019
Andrew Zalesky Sep 28, 2019
Liam Nestor Sep 28, 2019
Andrew Zalesky Sep 28, 2019
Liam Nestor Sep 30, 2019
Andrew Zalesky Oct 1, 2019
Liam Nestor Oct 1, 2019
David de Wide Aug 6, 2017
Andrew Zalesky Aug 7, 2017
David de Wide Aug 7, 2017
Andrew Zalesky Aug 7, 2017
David de Wide Aug 11, 2017
Andrew Zalesky Aug 12, 2017
David de Wide Aug 18, 2017
Andrew Zalesky Aug 19, 2017