help > RE: modeling interaction with continuous predictors
Dec 22, 2021  09:12 PM | Andrew Zalesky
RE: modeling interaction with continuous predictors
Hi Marius,

The design matrix appears to be correct and your assertions are also correct.

You do not need to create a new design matrix to test for the main effects. The main effects can be tested using the same design matrix. However, the interpretation of the main effects in the presence of an interaction can change, compared to the case when the interaction effect is removed - this phenomenon is not specific to the NBS but a general property of linear models. I.e., the main effects will specifically relate to subjects which have the mean value of X and Z (which will be zero if you have standardized them) when the interaction effect is present.

Yes - it is also possible to test all of these effects using t-tests. This would allow you to determine whether the association is positive or negative, as you have indicated. However, the F-test will reveal the direction of the association.

You seem to be on the right track - good luck!

best,
Andrew
Originally posted by Marius Gruber:
Hello Andrew,
first of all thanks for the toolbox and also for your help here in the forum! I am using this thread from Hamed as my questions are on the same topic.

I am currently working on a study which aims to investigate the association between structural connectivity on one side and the interaction of two continuous variables x and z on the other side. We are interested in both the main effects of x and z and the interaction effect of x*z. So, after some research here on the forum, I have created the following design matrix that includes all three effects as well as several covariates. Our sample includes more than 900 subjects (MDD patients and HCs) from 3 study sites, and I z-standardized all continuous variables. For simplicity, I present only a subset of the data:
Intercept   Sex   Site_2   Site_3   Group_MDD   Age        X           Z            X*Z
1              0       0          0             1                     0.86      -1.86     -0.83       1.56
1              1       0          0             1                     0.16       1.10       1.17       1.30
1              1       0          0             0                    -0.83       2.59      -0.16     -0.42
1              0       1          0             0                     1.63      -0.46      -0.29      0.13
1              1       1          0             1                     1.55      -1.53      -0.17      0.26
1              1       0          1             1                    -1.30      -0.13      -1.17      0.15
1              0       0          1             0                    -0.99       1.02      -0.37     -0.38

Test: F-test

Contrasts:
Main effect X: [0,0,0,0,0,0,1,0,0]
Main effect Y: [0,0,0,0,0,0,0,1,0]
Interaction X*Y: [0,0,0,0,0,0,0,0,1]

I have the following questions regarding these analyses:
As I understand the above posts, I can test the interaction from X and Y with this design matrix and the contrast given above. If NBS finds a network, then the structural connectivity within that network is associated with the interaction effect of X and Y. Is this correct?

Can I reliably test the simple main effects of X and Y with this design matrix and the contrasts given above, or should I create new design matrices for this that include only the variables X or Y (without their interaction)?

To ease the interpretation of the identified networks, I would perform post-hoc t-tests, using the following contrasts:
Main effect X: [0,0,0,0,0,0,1,0,0] and [0,0,0,0,0,0,-1,0,0]
Main effect Y: [0,0,0,0,0,0,0,1,0] and [0,0,0,0,0,0,0,-1,0]
Interaction X*Y: [0,0,0,0,0,0,0,0,1] and [0,0,0,0,0,0,0,0,-1]

I would use sqrt(threshold of the F-test) as the threshold in each test.
Is it possible to test these effects using the t-tests?

Best,
Marius