help > Mixed AN(C)OVA Models
Showing 1-21 of 21 posts
Display:
Results per page:
Oct 17, 2013  07:10 AM | Emanuele Pravata'
Mixed AN(C)OVA Models
Hi All,
I need to test the effect of time on a longitudinal FC-MRI dataset composed of 3 sessions, and 3 groups, and to correct for a Covariate.

Is it possible to apply to CONN a model with 3 groups and 3 time-points?

Thank you!
Oct 31, 2013  01:10 AM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models
Hi Emanuele,

Yes, the three subject groups can be defined in the 'Setup->Covariates->Second-level' tab (e.g. creating three covariates, on for each group of subjects, and each covariate simply containing 1/0's identifying the subjects in that group), and the three time-points can be defined in the 'Setup->Conditions' tab (e.g. creating three conditions, one for each time-point, associating each condition with the corresponding session number) 

In general, for any mixed within- between- subject model, within-subject effects are defined as 'conditions' and between-subject effects are defined as 'second-level covariates'. After running the analyses, in the 'second-level results' tab you will be able to select any combination of within- and between- subject effects and define an appropriate univariate or multivariate contrast to test your effects of interest (e.g. if you want to look at the interaction of session- by group- differences, you could select all three conditions and enter a 'between-condition' contrast of [1 -1 0; 0 1 -1] and select all three groups and enter a 'between-subjects' contrast of [1 -1 0; 0 1 -1]; for this example ROI-level analyses will use a multivariate Wilks' lambda test and voxel-level analyses will use an F-test combined with ReML estimation of covariance components)

Hope this helps
Alfonso



Originally posted by Emanuele Pravata':
Hi All,
I need to test the effect of time on a longitudinal FC-MRI dataset composed of 3 sessions, and 3 groups, and to correct for a Covariate.

Is it possible to apply to CONN a model with 3 groups and 3 time-points?

Thank you!
Nov 28, 2013  08:11 AM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
Thank you Alfonso. it really helps!
 
Now I'm trying to estimate the average connectivity within a given network and between networks.
I'm currently doing this by manually rearranging the concatenated subjects correlation data in the first-level results (ie subjects roi-roi correlations), and then doing statistics with SPSS: but his is really time consuming....  Is there a way to obtain the average connectivity within a set of ROI in a given Group and in a given condition in conn?
 
Thank you again!
 
Best
 
Emanuele
Nov 29, 2013  06:11 AM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models
Hi Emanuele,

Well, that functionality is not exactly there yet, if in the 'Results' tab you select your subset of ROIs in the 'sources' list and enter the contrast [1 1 ... 1]/n (where n is the number of ROIs), that will test the average connectivity between your selected ROIs and each of the other ROIs, which is related to but not exactly what you want (if I am understanding correctly).

In any way, since this was an interesting suggestion I am attaching a little function that will allow you to perform tests on the average connectivity within- and between two subsets/networks of ROIs. To run this you need to have your conn project open, then go to the 'Second-level Results' tab and define there the particular test that you want to run (any desired combination of between-subject and between-condition effects, like you would do for a normal ROI-to-ROI analysis). Once you do this you may call the attached function conn_withinbetweenROItest, it will prompt you to select two sets of ROIs and it will then perform the chosen analyses but averaging first the connectivity values within- each network of ROIs (within-network analyses), and also averaging first the connectivity values between- the two networks of ROIs (between-network analyses). Let me know if you would like me to clarify this functionality.

Hope this helps
Alfonso
Originally posted by Emanuele Pravata':
Thank you Alfonso. it really helps!
 
Now I'm trying to estimate the average connectivity within a given network and between networks.
I'm currently doing this by manually rearranging the concatenated subjects correlation data in the first-level results (ie subjects roi-roi correlations), and then doing statistics with SPSS: but his is really time consuming....  Is there a way to obtain the average connectivity within a set of ROI in a given Group and in a given condition in conn?
 
Thank you again!
 
Best
 
Emanuele
Dec 2, 2013  03:12 PM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
Hi Alonso,
it works, thank you!

One question: does this script save matrices sorted by single subjects between and within correlation to be exported (for exmample to get graphs, scaterplots, or other tests etc?).

Thank you again!!

Emanuele
Dec 4, 2013  12:12 AM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models
Hi Emanuele,

The attached version of the previous script will also save the data (within- and between- network average connectivity) as well as the stats results to a .csv file.

Hope this helps
Alfonso

Originally posted by Emanuele Pravata':
Hi Alonso,
it works, thank you!

One question: does this script save matrices sorted by single subjects between and within correlation to be exported (for exmample to get graphs, scaterplots, or other tests etc?).

Thank you again!!

Emanuele
Dec 4, 2013  04:12 PM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
It's working beautifully, thank you!

Emanuele
Dec 10, 2013  09:12 PM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
Hi again,
I understand that the following: "'between-condition' contrast of [1 -1 0; 0 1 -1] and select all three groups and enter a 'between-subjects' contrast of [1 -1 0; 0 1 -1]" will detect any interaction group*condtion, a 3x3 ANOVA. I would like to do the same with 2 groups and 2 conditions (temporal points): should I enter the following contrasts: [1 -1; -1 1] or [1 0; 0 1] or any other?
Thank you again!

E
Dec 11, 2013  02:12 AM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models
Hi Emanuele,

For a 2x2 group*condition interaction, simply select both groups in the 'subject effects' list and both conditions in the 'conditions' list, and then enter [1 -1] in both the 'between-conditions contrast' field as well as in the 'between-subjects contrasts' field.

This is going to look at whether the difference between conditionI and conditionII is larger in groupI compared to groupII (take the two-sided results instead, if you do not have an a priori hypothesis about the directionality of this interaction)

Best
Alfonso
Originally posted by Emanuele Pravata':
Hi again,
I understand that the following: "'between-condition' contrast of [1 -1 0; 0 1 -1] and select all three groups and enter a 'between-subjects' contrast of [1 -1 0; 0 1 -1]" will detect any interaction group*condtion, a 3x3 ANOVA. I would like to do the same with 2 groups and 2 conditions (temporal points): should I enter the following contrasts: [1 -1; -1 1] or [1 0; 0 1] or any other?
Thank you again!

E
Dec 11, 2013  05:12 PM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
Thank you again, it's very clear! Now, if I understand,  I would estimate an 3x2 mixed ANOVA I should use the following contrast:

[1 -1 0; 0 1 -1] and [1 -1]

right?

Thank you!!

Best


E
Dec 18, 2013  11:12 PM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models
Yes, exactly right (that will be testing the interaction term of the 3x2 anova)

Best
Alfonso
Originally posted by Emanuele Pravata':
Thank you again, it's very clear! Now, if I understand,  I would estimate an 3x2 mixed ANOVA I should use the following contrast:

[1 -1 0; 0 1 -1] and [1 -1]

right?

Thank you!!

Best


E
Dec 20, 2013  09:12 AM | Emanuele Pravata'
RE: Mixed AN(C)OVA Models
Thank you!

E
Mar 31, 2025  03:03 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

I have a quick follow-up question: For 2 groups with 2-within subjects (pre, post intervention) model, I have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast?


Thank you,


Lihong


Originally posted by Alfonso Nieto-Castanon:


Hi Emanuele, For a 2x2 group*condition interaction, simply select both groups in the 'subject effects' list and both conditions in the 'conditions' list, and then enter [1 -1] in both the 'between-conditions contrast' field as well as in the 'between-subjects contrasts' field. This is going to look at whether the difference between conditionI and conditionII is larger in groupI compared to groupII (take the two-sided results instead, if you do not have an a priori hypothesis about the directionality of this interaction) Best Alfonso Originally posted by Emanuele Pravata':
Hi again, I understand that the following: "'between-condition' contrast of [1 -1 0; 0 1 -1] and select all three groups and enter a 'between-subjects' contrast of [1 -1 0; 0 1 -1]" will detect any interaction group*condtion, a 3x3 ANOVA. I would like to do the same with 2 groups and 2 conditions (temporal points): should I enter the following contrasts: [1 -1; -1 1] or [1 0; 0 1] or any other? Thank you again! E

 

Mar 31, 2025  04:03 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

We have two groups with total n=20, each subject had pre and post MRI scans. I controled for age, sex, and mean headmotion. I modeled [1 -1 0 0 0] for betwee-subjects, and [1 -1] for within-subjects contrasts. With this model, I got F(2,30)>8.64 for significant functional connectivity pair with seed-to-voxel analysis. The review questioned why the group df was 2 not (2-1)*(2-1)=1, and why the subjects df=30?


Lihong


Originally posted by Lihong Wang:



I have a quick follow-up question: For 2 groups with 2-within subjects (pre, post intervention) model, I have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast?


Thank you,


Lihong


Originally posted by Alfonso Nieto-Castanon:


Hi Emanuele, For a 2x2 group*condition interaction, simply select both groups in the 'subject effects' list and both conditions in the 'conditions' list, and then enter [1 -1] in both the 'between-conditions contrast' field as well as in the 'between-subjects contrasts' field. This is going to look at whether the difference between conditionI and conditionII is larger in groupI compared to groupII (take the two-sided results instead, if you do not have an a priori hypothesis about the directionality of this interaction) Best Alfonso Originally posted by Emanuele Pravata':
Hi again, I understand that the following: "'between-condition' contrast of [1 -1 0; 0 1 -1] and select all three groups and enter a 'between-subjects' contrast of [1 -1 0; 0 1 -1]" will detect any interaction group*condtion, a 3x3 ANOVA. I would like to do the same with 2 groups and 2 conditions (temporal points): should I enter the following contrasts: [1 -1; -1 1] or [1 0; 0 1] or any other? Thank you again! E

 



 

Apr 8, 2025  03:04 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

Dear Alfonso,


I 've posted a question regarding the  2 groups with 2-within subjects (pre, post intervention) model we used. We have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast? The results indicate a significant functional connectivity between seed mPFC and inslua with F(2,30)=8.xxx in Conn results page. The reviewer questioned the first df and pointed out that it should be 1 (2-1)*(2-1)=1 instead of 2. The reviewer also questioned the calculation of the second df =30 with n=20. It seems that with n=20, df should be 20*2(pre, post) - 3covariates*2=34. Is it possible that Conn also regressed out other covariates that we aren't aware of? Any thoughts? Thank you.


 


--Lihong

Apr 8, 2025  04:04 PM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models

Dear Lihong


That is strange indeed, with 20 subjects a second-level of the form: 


Subject effects: GroupA, GroupB, ControlVariable1, ControlVariable2, ControlVariable3


Between-subjects contrast: [1 -1 0 0 0]


Conditions: Pre, Post


Between-conditions contrast: [-1 1]


would typically result in statistics of the form T(15) for a SBC (seed-based connectivity) analysis in CONN, so I am not totally sure what the F(2,30) indicates. Could you please send me a screenshot of where exactly the F(2,30) stats are shown so I can better understand what they represent? (see in the example images attached the typical places where you would see reported the stats associated with SBC group-level analyses, and where I would expect to see the "T(15)" indication for your analysis)


Hope this helps


Alfonso


Originally posted by Lihong Wang:



Dear Alfonso,


I 've posted a question regarding the  2 groups with 2-within subjects (pre, post intervention) model we used. We have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast? The results indicate a significant functional connectivity between seed mPFC and inslua with F(2,30)=8.xxx in Conn results page. The reviewer questioned the first df and pointed out that it should be 1 (2-1)*(2-1)=1 instead of 2. The reviewer also questioned the calculation of the second df =30 with n=20. It seems that with n=20, df should be 20*2(pre, post) - 3covariates*2=34. Is it possible that Conn also regressed out other covariates that we aren't aware of? Any thoughts? Thank you.


 


--Lihong



 

Apr 8, 2025  06:04 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

Thank you so much Alfonso for your prompt response. I attached the snapshot.


I guess you are right, in the model figure, it did say F(2,14), but as you can see from the overlayed image, it indicated F(2,30). Also, why the first df is 2 instead of 1?


Thank you.


--Lihong


Originally posted by Alfonso Nieto-Castanon:



Dear Lihong


That is strange indeed, with 20 subjects a second-level of the form: 


Subject effects: GroupA, GroupB, ControlVariable1, ControlVariable2, ControlVariable3


Between-subjects contrast: [1 -1 0 0 0]


Conditions: Pre, Post


Between-conditions contrast: [-1 1]


would typically result in statistics of the form T(15) for a SBC (seed-based connectivity) analysis in CONN, so I am not totally sure what the F(2,30) indicates. Could you please send me a screenshot of where exactly the F(2,30) stats are shown so I can better understand what they represent? (see in the example images attached the typical places where you would see reported the stats associated with SBC group-level analyses, and where I would expect to see the "T(15)" indication for your analysis)


Hope this helps


Alfonso


Originally posted by Lihong Wang:



Dear Alfonso,


I 've posted a question regarding the  2 groups with 2-within subjects (pre, post intervention) model we used. We have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast? The results indicate a significant functional connectivity between seed mPFC and inslua with F(2,30)=8.xxx in Conn results page. The reviewer questioned the first df and pointed out that it should be 1 (2-1)*(2-1)=1 instead of 2. The reviewer also questioned the calculation of the second df =30 with n=20. It seems that with n=20, df should be 20*2(pre, post) - 3covariates*2=34. Is it possible that Conn also regressed out other covariates that we aren't aware of? Any thoughts? Thank you.


 


--Lihong



 



 

Attachment: snapshot.jpg
Apr 8, 2025  08:04 PM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models

Hi Lihong,


I think the F(2,14) instead of T(15) is arising from having selected possibly a between-conditions contrast of [1 0; 0 1] instead of [-1 1]. That would be looking at any differences between the two groups either pre or post intervention, instead of looking at a group-by-intervention interaction. Can you please double-check?


Best


Alfonso


Originally posted by Lihong Wang:



Thank you so much Alfonso for your prompt response. I attached the snapshot.


I guess you are right, in the model figure, it did say F(2,14), but as you can see from the overlayed image, it indicated F(2,30). Also, why the first df is 2 instead of 1?


Thank you.


--Lihong


Originally posted by Alfonso Nieto-Castanon:



Dear Lihong


That is strange indeed, with 20 subjects a second-level of the form: 


Subject effects: GroupA, GroupB, ControlVariable1, ControlVariable2, ControlVariable3


Between-subjects contrast: [1 -1 0 0 0]


Conditions: Pre, Post


Between-conditions contrast: [-1 1]


would typically result in statistics of the form T(15) for a SBC (seed-based connectivity) analysis in CONN, so I am not totally sure what the F(2,30) indicates. Could you please send me a screenshot of where exactly the F(2,30) stats are shown so I can better understand what they represent? (see in the example images attached the typical places where you would see reported the stats associated with SBC group-level analyses, and where I would expect to see the "T(15)" indication for your analysis)


Hope this helps


Alfonso


Originally posted by Lihong Wang:



Dear Alfonso,


I 've posted a question regarding the  2 groups with 2-within subjects (pre, post intervention) model we used. We have three variables to be controlled. Is it correct to model [ 1 -1 0 0 0] for between-subjects and [1 -1] within-subjects contrast? The results indicate a significant functional connectivity between seed mPFC and inslua with F(2,30)=8.xxx in Conn results page. The reviewer questioned the first df and pointed out that it should be 1 (2-1)*(2-1)=1 instead of 2. The reviewer also questioned the calculation of the second df =30 with n=20. It seems that with n=20, df should be 20*2(pre, post) - 3covariates*2=34. Is it possible that Conn also regressed out other covariates that we aren't aware of? Any thoughts? Thank you.


 


--Lihong



 



 



 

Apr 9, 2025  01:04 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

Dear Alfoso,


How can I check the F or T of the group x intervention interaction effect? 


 


Thank you,


--Lihong


 

Apr 12, 2025  04:04 PM | Alfonso Nieto-Castanon - Boston University
RE: Mixed AN(C)OVA Models

Dear Lihong,


Simply use a model of the form:


  Subject effects: GroupA, GroupB, ControlVariable1, ControlVariable2, ControlVariable3


  Between-subjects contrast: [1 -1 0 0 0]


  Conditions: Pre, Post


  Between-conditions contrast: [-1 1]


 


From your design plot it seems you were using instead a model of the form:


  Subject effects: GroupA, GroupB, ControlVariable1, ControlVariable2, ControlVariable3


  Between-subjects contrast: [1 -1 0 0 0]


  Conditions: Pre, Post


  Between-conditions contrast: [1 0; 0 1]


 


Hope this helps


Alfonso


Originally posted by Lihong Wang:



Dear Alfoso,


How can I check the F or T of the group x intervention interaction effect? 


 


Thank you,


--Lihong


 



 

Apr 13, 2025  11:04 PM | Lihong Wang
RE: Mixed AN(C)OVA Models

Thank you so much Alfonso for your precise detection. I didn't realize that I accidently used [1 0, 0 1] for the pre post contrast. You are absolutely correct. After I changed the pre post constrast to [1 -1], it became T15 instead of F(2,30). Thanks again for your advice. 


All the best,


--Lihong