GLMFlex to GLMFlexFast

72 views
Skip to first unread message

Haris Styliadis

unread,
May 31, 2019, 2:12:03 PM5/31/19
to Aaron's fMRI matlab tools.
Hello Aaron, you recently suggested updating my script to use GLMFlexFast instead of GLMFlex.

I have read several discussion and followed every example I came across.

I would really appreciate it if you had a look at what I have prepared. I am attaching both the new code. The aim here is to model a 2(Group1 and Group2)x2(high valence and low valence)x2(high arousal and low arousal) anova and estimate the following effects and interactions.

  1. Group by Valence by Arousal -------------------------F-test 
  2. Valence by Arousal Group1----------------------------F-test for Group1
  3. Valence by Arousal Group2----------------------------F-test for Group2
  4. Valence by Arousal---------------------------------------F-test
  5. Group by Arousal ----------------------------------------F-test
  6. Arousal Group1-------------------------------------------t-test for Group1
  7. Arousal Group2-------------------------------------------t-test for Group2
  8. Arousal Effect---------------------------------------------t-test 
  9. Group by Valence ---------------------------------------F-test
  10. Valence Group1------------------------------------------t-test for Group1
  11. Valence Group2------------------------------------------t-test for Group2
  12. 'Valence Effect -------------------------------------------t-test 
I am a bit confident for the valence and arousal main effects (F and T-tests) but need help for the interactions. 

I have run only the comparisons for the valence and arousal main effects but I get the following error message
Index exceeds matrix dimensions. at line 19


          

             
              




new_glm_flex.m

Haris Styliadis

unread,
May 31, 2019, 2:17:01 PM5/31/19
to Aaron's fMRI matlab tools.
Thanks for the support!

Aaron Schultz

unread,
Jun 3, 2019, 12:34:27 PM6/3/19
to fmri_mat...@googlegroups.com
If I look at your I.data structure, the size of the variables doesn't match:


fn: {68×1 cell}
Group: {116×1 cell}
Valence: {58×1 cell}
Arousal: {58×1 cell}
SS: {116×1 cell}

You have 68 input files, but 116 entries for Group and SS and then
only 58 for Group and Arousal. They should all be the sample length
(68 if there are 68 input files).
> --
> You received this message because you are subscribed to the Google Groups "Aaron's fMRI matlab tools." group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fmri_matlab_to...@googlegroups.com.
> To post to this group, send email to fmri_mat...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fmri_matlab_tools/c2e68a37-e09a-42d1-b5e2-525d97726a07%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Haris Styliadis

unread,
Jun 3, 2019, 3:38:48 PM6/3/19
to Aaron's fMRI matlab tools.
Hi Aaron, I have corrected the size of the variables for 116 input files.

Now I get the following error message
Error using char
Cell elements must be character arrays.

Error in ANOVA_APS (line 304)
    spacer = size(char([ModelTerms 'Error' posthocs(:,1)']),2)+4;

Error in GLM_Flex_Fast4 (line 52)
    MOD = ANOVA_APS(I.Data,I.Model,I.PostHocs,0,1,1);

Error in new_glm_flex (line 613)
GLM_Flex_Fast4(I);


Any ideas?  
Please have a look at the script (attached) and/or the workspace (attached) when you are available and guide me through tackling the error. Your advice on defining the post hocs will be highly appreciated.

Thank you for your time and support

Best,

Haris
> To unsubscribe from this group and stop receiving emails from it, send an email to fmri_mat...@googlegroups.com.
haris.mat
new_glm_flex.m
Reply all
Reply to author
Forward
0 new messages