help > ANCOVA - contrast / hypothesis testing
Showing 1-9 of 9 posts
Display:
Results per page:
Dec 6, 2019  05:12 AM | Athina Aruldass - University of Cambridge
ANCOVA - contrast / hypothesis testing
Hi Andrew

I was able to perform 2-sample t-test by keeping to the manual (and snooping around the forum) with minimal issues (and heaps of fun). I think I have made some interesting finds with the functional connectivity group comparison and would now like to add covariate(s) to the GLM - I followed the ANCOVA design for this.

I would like to test the following hypothesis - inflammation ie. covariate, has a greater / stronger effect on MDD compared to HC . Partial design matrix below -

1 1 0.3
1 0 2.2
1 1 0.3

columns : 1st - intercept , 2nd - Group; MDD coded 1 (n=83) / HC coded 0 (n=46) , 3rd - inflammation index
contrast : [0 0 1] , stat test = two sample t-test

Questions -

(1) Is the above doing what I think it's doing ie. testing for the aforementioned hypothesis ? If so, contrast [0 0 -1] t-test would then be testing to see if inflammation had a weaker effect on MDD compared to HC ?

(2) When testing for a significant effect of a continuous cov. eg. my case, could one adjust the contrast or design matrix to test specifically for direction of slope ie. +ve or -ve ? Is this something one could infer from inspecting the output - if so, my apologies I have yet to turn over every rock there...

(3) Applying F-test is also appropriate here, bearing in mind that it is two-tailed ? Or is t-test opted for here because this is only testing for a single main effect ie. univariate hypothesis ?

(4) Is it then correct / ideal to test for multiple significant effects with a single contrast ? - for example, if I am also interested in testing for a significant group effect MDD < HC alongside a main inflammation effect, would contrast [0 -1 1] with F-test do the trick ? - just that, from combing through some queries on the forum, the interest mainly is on interaction effect or a single main effect i.e zero other entries in the contrast. Hence, I'm not sure if testing for multiple effects is simply ludicrous...

Apologies if my questions do not make any sense, also teeter between actual toolbox issues and stats help. I'm still trying to get my head around contrasts, stat tests and GLMs more broadly.

Please and thank you - Athina.
Dec 7, 2019  07:12 AM | Andrew Zalesky
RE: ANCOVA - contrast / hypothesis testing
Hi Athina,

1. [0 0 1] will test whether the inflammation score is positively correlated with connectivity, while controlling for the effect of diagnosis. In contrast, [0 0 -1] with test for a negative correlation. You might also want to test for an interaction between diagnosis and group, by adding a fourth column that is the multiplication of the 2nd and 3rd column. The contrast would then be [0 0 0 1] or [0 0 0 -1].

2. See above. [0 0 1] will test for a positive correlation when using t-test. [0 0 -1] will test for a negative correlation.

3. F-test is two-tailed and the only valid contrast is [0 0 1] for the F-test here. With the F-test, the subnetwork can include some connections that are +vely correlated with connectivity and some that are -vely correlated. With a t-test, the two alternative hypotheses can be tested separately.

4. I am not sure if I understand the question. I suggest testing each effect separately. Using [0 1 0] or [0 -1 0] to test the effect of diagnosis. I don't think that [0 -1 1] is sensible. To test for an interaction, see my above comment.

Andrew

Originally posted by Athina Aruldass:
Hi Andrew

I was able to perform 2-sample t-test by keeping to the manual (and snooping around the forum) with minimal issues (and heaps of fun). I think I have made some interesting finds with the functional connectivity group comparison and would now like to add covariate(s) to the GLM - I followed the ANCOVA design for this.

I would like to test the following hypothesis - inflammation ie. covariate, has a greater / stronger effect on MDD compared to HC . Partial design matrix below -

1 1 0.3
1 0 2.2
1 1 0.3

columns : 1st - intercept , 2nd - Group; MDD coded 1 (n=83) / HC coded 0 (n=46) , 3rd - inflammation index
contrast : [0 0 1] , stat test = two sample t-test

Questions -

(1) Is the above doing what I think it's doing ie. testing for the aforementioned hypothesis ? If so, contrast [0 0 -1] t-test would then be testing to see if inflammation had a weaker effect on MDD compared to HC ?

(2) When testing for a significant effect of a continuous cov. eg. my case, could one adjust the contrast or design matrix to test specifically for direction of slope ie. +ve or -ve ? Is this something one could infer from inspecting the output - if so, my apologies I have yet to turn over every rock there...

(3) Applying F-test is also appropriate here, bearing in mind that it is two-tailed ? Or is t-test opted for here because this is only testing for a single main effect ie. univariate hypothesis ?

(4) Is it then correct / ideal to test for multiple significant effects with a single contrast ? - for example, if I am also interested in testing for a significant group effect MDD < HC alongside a main inflammation effect, would contrast [0 -1 1] with F-test do the trick ? - just that, from combing through some queries on the forum, the interest mainly is on interaction effect or a single main effect i.e zero other entries in the contrast. Hence, I'm not sure if testing for multiple effects is simply ludicrous...

Apologies if my questions do not make any sense, also teeter between actual toolbox issues and stats help. I'm still trying to get my head around contrasts, stat tests and GLMs more broadly.

Please and thank you - Athina.
Dec 9, 2019  02:12 AM | Athina Aruldass - University of Cambridge
RE: ANCOVA - contrast / hypothesis testing
Many thanks for your clarifications Andrew - I do have a few follow-up questions.

I am indeed ultimately interested in modelling the simultaneous effect of group/diagnosis and inflammation on fxnal conn. ie. my wider hypothesis is - inflammation is indeed affecting FC in HC and MDD, but differently in both groups eg. completely different implicated subnetworks, and relationship with inflammation maybe opposite. (Hence, I thought of manipulating the contrast for both main effects instead of controlling for either...)

1) Double checking - is manipulating the interaction effect contrast under t-test, whilst controlling for group and inflammation main effects per your suggestion then testing for the above hypothesis ? 

2) Would it be redundant to test for main effect of inflammation in each group separately with NBS ?

3) If (2) is worthwhile, how would the design matrix look like given the regression model is FC ~ inflammation ? is one-sample t-test the stat test option here ?

Apologies in advance if my questions don't make sense again. Thank you for your time and input ! - Athina.
Dec 10, 2019  07:12 PM | Athina Aruldass - University of Cambridge
RE: ANCOVA - contrast / hypothesis testing
Hi again Andrew

Pls ignore my first 2 questions from above (I was very confused and my brain just broke...).

For Q3 - this is the design matrix I eventually came up with :
1 0.3
1 2.2
1 0.3
1 4
1 0.9

columns : 1st - intercept, 2nd - inflammation
contrast : [0 -1] , stat test : t-test (not one sample t-test)
Hyp : testing for negative correlation between inflammation score and FC


I went on to perform this over 3 groups with this design matrix (after being warned that my initial design was rank deficient) :

1 0 0.3
1 -1 2.2
1 0 0.3
1 1 4
1 0 0.9

columns : 1st - intercept, 2nd - group with 3 levels (g1 : -1, g2 : 0, g3 : 1), 3rd - inflammation
contrast : [0 0 -1] , stat test : t-test
Hyp : testing for negative correlation between inflammation score and FC whilst controlling for group


++++++++ Questions +++++++++

1) Are the above design matrices correct ?

2) If I were to add a group*inflammation interaction column for the 3-group design would the design matrix then look like this

1 0 0.3 0
1 -1 2.2 -2.2
1 0 0.3 0
1 1 4 4
1 0 0.9 0

columns : 1st - intercept, 2nd - group with 3 levels (g1 : -1, g2 : 0, g3 : 1), 3rd - inflammation , 4th - group*inflammation
contrast : [0 0 0 -1] , stat test : t-test (not one sample)

If this is correct - what could one then infer / hypothesise for ? I quoted your reply to another query on interaction effect (with 2 groups) posted on the forum -

" The contrast [0 0 0 1] whether the the slope of the age-connectivity relationship is steeper in the group coded with 1, whereas [0 0 0 -1] will tester whether the slope is less steep.
In other words it is testing whether the age effect is stronger or weaker in one of the particular groups. "

(i) Would the above translate to my exp. (with age = inflammation) ?
(ii) Could I infer anything more specific for groups coded 0 and -1 ?
(iii) Would I have to perform a post-hoc pairwise ie. with 2 groups, interaction effect analyses ?


Please and many thanks - Athina.
Dec 13, 2019  05:12 AM | Andrew Zalesky
RE: ANCOVA - contrast / hypothesis testing
Hi Athina,

The design matrix that you specify with two columns is correct. The corresponding contrast and your interpretation is also correct.

However, the three-column design matrix is incorrect. This will test for a parametric effect among the three groups. The 2nd column will test whether FC is smallest in grp1, biggest in grp 3, with FC in grp 2 sandwiched between grp 1 and 3. I am failry sure that you don't want to do this. 

If you simply want to control for the effect of diagnosis, the 2nd column should be replaced with a column of 0/1, where 1 indicates grp 1 individuals. You will then need to add an additional column of 0/1, where 1 indicates grp 2 individuals. So you would have 4 columns in total: intercept; 1's for grp 1, 0's elsewhere; 1's for grp 2, 0's elsewhere; inflammation score. Note that you do not need a column for grp 3, since this is covered by the intercept. The contrast would be [ 0 0 0 -1] and select t-test (NOT one-sample).

Happy to provide feedback on your revised design matrix.

To test for a group by inflammation interaction, you would add two additional columns to your design matrix representing the multiplication of the 2nd column x inflammation and the 3rd column by inflammation. Note that you would need a large sample size to test for such an interaction.

Before moving onto the interaction effect, I suggest that you get the simple case working first.

Andrew

Originally posted by Athina Aruldass:
Hi again Andrew

Pls ignore my first 2 questions from above (I was very confused and my brain just broke...).

For Q3 - this is the design matrix I eventually came up with :
1 0.3
1 2.2
1 0.3
1 4
1 0.9

columns : 1st - intercept, 2nd - inflammation
contrast : [0 -1] , stat test : t-test (not one sample t-test)
Hyp : testing for negative correlation between inflammation score and FC


I went on to perform this over 3 groups with this design matrix (after being warned that my initial design was rank deficient) :

1 0 0.3
1 -1 2.2
1 0 0.3
1 1 4
1 0 0.9

columns : 1st - intercept, 2nd - group with 3 levels (g1 : -1, g2 : 0, g3 : 1), 3rd - inflammation
contrast : [0 0 -1] , stat test : t-test
Hyp : testing for negative correlation between inflammation score and FC whilst controlling for group


++++++++ Questions +++++++++

1) Are the above design matrices correct ?

2) If I were to add a group*inflammation interaction column for the 3-group design would the design matrix then look like this

1 0 0.3 0
1 -1 2.2 -2.2
1 0 0.3 0
1 1 4 4
1 0 0.9 0

columns : 1st - intercept, 2nd - group with 3 levels (g1 : -1, g2 : 0, g3 : 1), 3rd - inflammation , 4th - group*inflammation
contrast : [0 0 0 -1] , stat test : t-test (not one sample)

If this is correct - what could one then infer / hypothesise for ? I quoted your reply to another query on interaction effect (with 2 groups) posted on the forum -

" The contrast [0 0 0 1] whether the the slope of the age-connectivity relationship is steeper in the group coded with 1, whereas [0 0 0 -1] will tester whether the slope is less steep.
In other words it is testing whether the age effect is stronger or weaker in one of the particular groups. "

(i) Would the above translate to my exp. (with age = inflammation) ?
(ii) Could I infer anything more specific for groups coded 0 and -1 ?
(iii) Would I have to perform a post-hoc pairwise ie. with 2 groups, interaction effect analyses ?


Please and many thanks - Athina.
Dec 18, 2019  08:12 PM | Athina Aruldass - University of Cambridge
RE: ANCOVA - contrast / hypothesis testing
Hello Andrew - thank you very much for your previous input ! Much to my dismay, I indeed have to put any further analyses on embargo (after some discussion with my Supervisor on my initial set of findings...).

I have some other questions for you now re the simple cases - mainly to gain a more understanding of what the contrast is doing -

(1) When testing for group differences (2 groups) / main group effect whilst controlling for inflammation - what is the difference between design matrices (a) and (b) below ? Are they testing for the same hypothesis ie FC is Lower in Patient group when controlling for inflammation ? Is design (a) incorrect when testing for this hypothesis - is this testing for negative correlation between FC and Group, how would you interpret this association ?

design matrix (a)
1 1 0.3
1 0 2.2
1 1 0.3
contrast : [0 -1 0] , t-test
cols : intercept ; Group - HC(0) and Pts(1) ; inflammation

design matrix (b)
1 1 0 0.3
1 0 1 2.2
1 1 0 0.3
contrast : [0 1 -1 0], t-test
cols : intercept ; HC ; Pts ; inflammation


(2) I understand that in linear model the intercept = dependent variable when explanatory variable = 0. In my ANCOVA design matrix below for example, when testing for the effect on inflammation on FC, the intercept models global mean FC when inflammation is 0 - true ? Also, with contrast notation [0 0 -1] for below - is this controlling for group AND global mean FC ?? What does setting intercept contrast to 0 denote / doing ?

1 1 0.3
1 0 2.2
1 1 0.3
cols : intercept ; Group - HC(0) and Pts(1) ; inflammation


(3) Why and when is demeaning a variable (dependent and/or explanatory) necessary for NBS ? Is demeaning here equivalent to mean centering eg. standard scoring, Fisher r-z transformation, log transformation ? My FC matrices are already r-z transformed but the inflammation index is in mg/L ie both not in comparable scale - would/ should this have any effect on output ... ?? I repeated my analyses with log-transformed inflammation - did not see any difference ie still no significant network ?


(4) I would also like to try restricting testing to specific ROIs / a functional module. Based on you explanation below to another question on the forum - you have indicated that this would reduce number of multiple comparisons. Could this then yield a different outcome compared to when inputing full connectivity matrix ? If so / not - why ?

"If a connection is 0 for all subjects, then the NBS will automatically ignore that connection during statistical testing.
In other words, if the connectivity value for a given connection is zero in all connectivity matrices, that specific connection is ignored by default and the number of multiple comparisons reduced accordingly."


Hope my queries make sense - sorry, please and many thanks again - Athina.
Dec 19, 2019  07:12 AM | Andrew Zalesky
RE: ANCOVA - contrast / hypothesis testing
Hi Athina,

1. Design matrix (b) is rank deficient and will give you an error/warning. Design matrix (a) is the correct one. Matrix (a) with the contrast given will test whether patients have lower connectivity compared to HC, while controlling for the effect of inflammation.

2. I don't fully follow your question. The contrast of [0 0 -1] will test for a negative correlation between FC and inflammation, while controlling for the effect of diagnosis. Yes - it will also technically "control" for the intercept, but you would generally not say that the intercept is controlled for. 

3. The GLM inherent to the NBS is no different from the standard GLM. So if you would demean in a standard GLM, you would be justified in doing it for the NBS. The NBS does not use any kind of special GLM. In general, if you include the intercept term, it does not matter if you demean FC or the inflammation score. Log-transformation is not equivalent to de-meaning and log-transformation could indeed change the results. 

4. Yes - the result can be different if you remove certain regions beforehand. If you remove regions, then you won't be able to detect effects at these regions. So clearly the results can change.

Andrew

Originally posted by Athina Aruldass:
Hello Andrew - thank you very much for your previous input ! Much to my dismay, I indeed have to put any further analyses on embargo (after some discussion with my Supervisor on my initial set of findings...).

I have some other questions for you now re the simple cases - mainly to gain a more understanding of what the contrast is doing -

(1) When testing for group differences (2 groups) / main group effect whilst controlling for inflammation - what is the difference between design matrices (a) and (b) below ? Are they testing for the same hypothesis ie FC is Lower in Patient group when controlling for inflammation ? Is design (a) incorrect when testing for this hypothesis - is this testing for negative correlation between FC and Group, how would you interpret this association ?

design matrix (a)
1 1 0.3
1 0 2.2
1 1 0.3
contrast : [0 -1 0] , t-test
cols : intercept ; Group - HC(0) and Pts(1) ; inflammation

design matrix (b)
1 1 0 0.3
1 0 1 2.2
1 1 0 0.3
contrast : [0 1 -1 0], t-test
cols : intercept ; HC ; Pts ; inflammation


(2) I understand that in linear model the intercept = dependent variable when explanatory variable = 0. In my ANCOVA design matrix below for example, when testing for the effect on inflammation on FC, the intercept models global mean FC when inflammation is 0 - true ? Also, with contrast notation [0 0 -1] for below - is this controlling for group AND global mean FC ?? What does setting intercept contrast to 0 denote / doing ?

1 1 0.3
1 0 2.2
1 1 0.3
cols : intercept ; Group - HC(0) and Pts(1) ; inflammation


(3) Why and when is demeaning a variable (dependent and/or explanatory) necessary for NBS ? Is demeaning here equivalent to mean centering eg. standard scoring, Fisher r-z transformation, log transformation ? My FC matrices are already r-z transformed but the inflammation index is in mg/L ie both not in comparable scale - would/ should this have any effect on output ... ?? I repeated my analyses with log-transformed inflammation - did not see any difference ie still no significant network ?


(4) I would also like to try restricting testing to specific ROIs / a functional module. Based on you explanation below to another question on the forum - you have indicated that this would reduce number of multiple comparisons. Could this then yield a different outcome compared to when inputing full connectivity matrix ? If so / not - why ?

"If a connection is 0 for all subjects, then the NBS will automatically ignore that connection during statistical testing.
In other words, if the connectivity value for a given connection is zero in all connectivity matrices, that specific connection is ignored by default and the number of multiple comparisons reduced accordingly."


Hope my queries make sense - sorry, please and many thanks again - Athina.
Jan 6, 2020  02:01 AM | Athina Aruldass - University of Cambridge
RE: ANCOVA - contrast / hypothesis testing
Hi again Andrew - many thanks for your clarification ! I do however have a couple of follow-up questions re Q1 and Q4.

Q1 - The reason I queried this was because NBS did not actually generate a rank deficient warning / error when I performed the analysis with design matrix (b). I have appended the full .txt for you to inspect. Should it actually be complaining ?

Q4 - I was thinking perhaps a change in results more from no significant network to potentially an emergent subnetwork after restricting number of ROIs - Is this a possibility following reduction in multiple comparisons ? Please correct me, I think I am not understanding the mechanics of NBS - but is the likelihood of finding a statistically significant cluster dependent at all on the size of input correlation matrices / number of individual edges ? Is the statistical testing not performed on the resultant component ie cluster with each permutation, circumventing the multiple comparisons issue entirely ? Or would it actually effect outcome if size of cluster is set to extent instead of intensity (what I have been using) ?

Please advise. Sorry and many thanks (also Happy New Year) - Athina.
Jan 6, 2020  11:01 PM | Andrew Zalesky
RE: ANCOVA - contrast / hypothesis testing
Hi Athina,

1. The matrix in the text file is not full rank. The first column is clearly a linear combination of the second and third column. I don't think that this is a valid design matrix. One of the first three columns should be omitted - it does not matter which one.

4. Yes - removing ROIs from the network can certainly change the results. The effect of removing ROIs is difficult to predict a priori. If you remove a node the comprises the effect, this size of the subnetwork will shrink and this can potentially cause a loss of significance. If you remove a node that does not comprise the effect, this can potentially reduce the potential for large components to form as a matter of chance. 

So, it is difficult to unequivocally say that removing ROIs will result improve power.

Andrew


Originally posted by Athina Aruldass:
Hi again Andrew - many thanks for your clarification ! I do however have a couple of follow-up questions re Q1 and Q4.

Q1 - The reason I queried this was because NBS did not actually generate a rank deficient warning / error when I performed the analysis with design matrix (b). I have appended the full .txt for you to inspect. Should it actually be complaining ?

Q4 - I was thinking perhaps a change in results more from no significant network to potentially an emergent subnetwork after restricting number of ROIs - Is this a possibility following reduction in multiple comparisons ? Please correct me, I think I am not understanding the mechanics of NBS - but is the likelihood of finding a statistically significant cluster dependent at all on the size of input correlation matrices / number of individual edges ? Is the statistical testing not performed on the resultant component ie cluster with each permutation, circumventing the multiple comparisons issue entirely ? Or would it actually effect outcome if size of cluster is set to extent instead of intensity (what I have been using) ?

Please advise. Sorry and many thanks (also Happy New Year) - Athina.