Dear Matthew, I got it! Thank you so much for your kindly help! Best, Yuanqi -- From: FSL - FMRIB's Software Library <[log in to unmask]> on behalf of Matthew Webster <[log in to unmask]> Reply-To: FSL - FMRIB's Software Library <[log in to unmask]> Date: Tuesday, February 11, 2020 at 9:11 AM To: "[log in to unmask]" <[log in to unmask]> Subject: Re: [FSL] Design matrix for 2groups x 2levels analysis Dear Yuanqi, I missed that your covariates were age/gender - for values which aren’t session-specific, but constant for each subject, then those covariates are redundant, as the individual session EVs ( below EV3 to EV6 ) already explain this variance. Hope this helps, Kind Regards Matthew -------------------------------- Dr Matthew Webster FMRIB Centre John Radcliffe Hospital University of Oxford On 10 Feb 2020, at 22:31, Sun, Yuanqi <[log in to unmask]<mailto:[log in to unmask]>> wrote: Dear Matthew, Sorry to bother you again with those questions. I tried the ANOVA: 2-groups, 2-levels per subject (2-way Mixed Effect ANOVA) model you recommended, it works well! Thank you again for your advice! Then when I tried to add the adjusted covariates (such as age and gender) as an extra column, I received an error message: Problem with processing the model: warning at least one EV is (close to) a linear combination of the others. You probably need to alter your design. (Design matrix is rank deficient - ratio of min:max eigenvalues in SVD of matrix is 2.84e-17). Contrast involving these combinations will be zero. My design matrix and the contrast & F-tests part are showed below: EV1 EV2 EV3 EV4 EV5 EV6 EV7 EV8 Run Run x Group H_Sub1 H_Sub2 L_Sub3 L_Sub4 gender age H_session1_Subj1 -1 -1 1 0 0 0 1 -1.634339 H_session1_Subj2 -1 -1 0 1 0 0 -1 -0.719878 H_session2_Subj1 1 1 1 0 0 0 1 -1.634339 H_session2_Subj2 1 1 0 1 0 0 -1 -0.719878 L_session1_Subj3 -1 1 0 0 1 0 -1 0.506819 L_session1_Subj4 -1 1 0 0 0 1 -1 1.506155 L_session2_Subj3 1 -1 0 0 1 0 -1 0.506819 L_session2_Subj4 1 -1 0 0 0 1 -1 1.506155 Run effect 1 0 0 0 0 0 0 0 interaction 0 1 0 0 0 0 0 0 * In the ‘gender’ column, 1 = boy and -1 = girl * And age has been demeaned across all the subjects in all groups Is that because this model designed for subject-specific? I am so sorry to ask you these questions, as I just switched from EEG to the fMRI field one month ago, lots of things needed to learn. Thank you again for your kindly help! Best, Yuanqi -- From: FSL - FMRIB's Software Library <[log in to unmask]<mailto:[log in to unmask]>> on behalf of Matthew Webster <[log in to unmask]<mailto:[log in to unmask]>> Reply-To: FSL - FMRIB's Software Library <[log in to unmask]<mailto:[log in to unmask]>> Date: Friday, February 7, 2020 at 6:44 AM To: "[log in to unmask]<mailto:[log in to unmask]>" <[log in to unmask]<mailto:[log in to unmask]>> Subject: Re: [FSL] Design matrix for 2groups x 2levels analysis Dear Yuanqi, It is of course fine to add extra covariates - just demean the values and add as an extra column to the design. Kind Regards Matthew -------------------------------- Dr Matthew Webster FMRIB Centre John Radcliffe Hospital University of Oxford On 6 Feb 2020, at 18:58, Sun, Yuanqi <[log in to unmask]<mailto:[log in to unmask]>> wrote: Dear Matthew, Thank you so much! it’s really helpful! And can I add some demographic / behavioral data in this model as adjusted covariates? Like age or gender? Since this data is collected from youth brain, Ageing might cause changes to cognition. Many thanks! Best, Yuanqi From: FSL - FMRIB's Software Library <[log in to unmask]<mailto:[log in to unmask]>> on behalf of Matthew Webster <[log in to unmask]<mailto:[log in to unmask]>> Reply-To: FSL - FMRIB's Software Library <[log in to unmask]<mailto:[log in to unmask]>> Date: Thursday, February 6, 2020 at 10:21 AM To: "[log in to unmask]<mailto:[log in to unmask]>" <[log in to unmask]<mailto:[log in to unmask]>> Subject: Re: [FSL] Design matrix for 2groups x 2levels analysis USE CAUTION: External Message. Dear Yuanqi, It looks like this is a repeated measures design ( with each subject being scanned twice ). If you are running a FEAT analysis, then the correct design is given here: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/GLM#ANOVA:_2-groups.2C_2-levels_per_subject_.282-way_Mixed_Effect_ANOVA.29<https://urldefense.proofpoint.com/v2/url?u=https-3A__fsl.fmrib.ox.ac.uk_fsl_fslwiki_GLM-23ANOVA-3A-5F2-2Dgroups.2C-5F2-2Dlevels-5Fper-5Fsubject-5F.282-2Dway-5FMixed-5FEffect-5FANOVA.29&d=DwMFAg&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=3tYbk1aCXnGpF6HE2UjlQW7HdSoup10wtmHtSaue4fU&s=bmYqskukxvGOuHtJxJBzLQ3hrU3JYyiE72AR28fewYU&e=> Alternatively, if you are using randomise, then Anderson Winkler expands the above design to work with randomise here: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/GLM#ANOVA:_2-groups.2C_2-levels_per_subject_.282-way_Mixed_Effect_ANOVA.29<https://urldefense.proofpoint.com/v2/url?u=https-3A__fsl.fmrib.ox.ac.uk_fsl_fslwiki_GLM-23ANOVA-3A-5F2-2Dgroups.2C-5F2-2Dlevels-5Fper-5Fsubject-5F.282-2Dway-5FMixed-5FEffect-5FANOVA.29&d=DwMFAg&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=3tYbk1aCXnGpF6HE2UjlQW7HdSoup10wtmHtSaue4fU&s=bmYqskukxvGOuHtJxJBzLQ3hrU3JYyiE72AR28fewYU&e=> ( a critical change for randomise is the requirement of an exchangeability blocks file ). Hope this helps, Kind Regards Matthew -------------------------------- Dr Matthew Webster FMRIB Centre John Radcliffe Hospital University of Oxford On 4 Feb 2020, at 15:46, Sun, Yuanqi <[log in to unmask]<mailto:[log in to unmask]>> wrote: Dear FSL Experts, Hope this email finds you well. I have a quick question about the design matrix for 2groups x 2levels analysis. Our experiment has two group: High and Low, and each group has 2 sessions. We want to write a design matrix to find the main effects and interaction effect between these two group in two levels. The design matrix I wrote is shown below, but I am not sure if this matrix is correct or not. EV1 EV2 EV3 EV4 H_S1 H_S2 L_S1 L_S2 H_Sub1_1 1 0 0 0 H_Sub2_1 1 0 0 0 H_Sub1_2 0 1 0 0 H_Sub2_2 0 1 0 0 L_Sub1_1 0 0 1 0 L_Sub2_1 0 0 1 0 L_Sub1_2 0 0 0 1 L_Sub2_2 0 0 0 1 *H_S1 means high group session 1, H_S2 means high group session 2, L_S1 means low group session 1, L_S2 means low group session 2; H_Sub1_1 and H_Sub1_2 mean the 2 sessions subject 1 took in high group; And for the contrast & F-tests part: EV1 EV2 EV3 EV4 High (S1-S2) 1 -1 0 0 High (S2-S1) -1 1 0 0 Low (S1-S2) 0 0 1 -1 Low (S2-S1) 0 0 -1 1 S1 (H-L) 1 0 -1 0 S1 (L-H) -1 0 1 0 S2 (H-L) 0 1 0 -1 S2 (L-H) 0 -1 0 1 Group main effect 0.5 0.5 -0.5 -0.5 Session main effect 0.5 -0.5 0.5 -0.5 High (S1-S2)- Low (S1-S2) 1 -1 -1 1 My question is : do you think this design matrix will properly fit my purpose (the main effects and interaction effect between two group in two levels)? If I want to add some adjusted covariates, like age and gender, where should I add them? Thank you so much for your help, looking forward to hear from you! Many thanks! Best, Yuanqi ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMFAg&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=3tYbk1aCXnGpF6HE2UjlQW7HdSoup10wtmHtSaue4fU&s=y3LWAClL9zrfP803m5olxpcQ190QEkQDZF4IAZC9Pu0&e=> ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMFAg&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=3tYbk1aCXnGpF6HE2UjlQW7HdSoup10wtmHtSaue4fU&s=y3LWAClL9zrfP803m5olxpcQ190QEkQDZF4IAZC9Pu0&e=> ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMGaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=L82OxzAZN9nG4emkmB4we8VyD-Zgw1iRkprVNV8IBVw&s=oafRyRKF4kESmSYiZ95X_f99xJrNDWChXk0KZx1UQzs&e=> ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMGaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=L82OxzAZN9nG4emkmB4we8VyD-Zgw1iRkprVNV8IBVw&s=oafRyRKF4kESmSYiZ95X_f99xJrNDWChXk0KZx1UQzs&e=> ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMGaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=kYHchPlWlkRl_2A2I2qcK28XCfdOkqeQlDZOoY6iGDk&s=JIdlyQxMbmhSi2IoO8gNhNWR2pCbfErORuxthOWaGFg&e=> ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DFSL-26A-3D1&d=DwMGaQ&c=shNJtf5dKgNcPZ6Yh64b-A&r=Q9t7_-HDjtXxjH76N37H4V5Xbv5aX0gWGLoNUkn3HHY&m=kYHchPlWlkRl_2A2I2qcK28XCfdOkqeQlDZOoY6iGDk&s=JIdlyQxMbmhSi2IoO8gNhNWR2pCbfErORuxthOWaGFg&e=> ######################################################################## To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1