tramarobin / fctSnPM

Using spm1d package (v.0.4.3), compute anova and post-hoc tests from anova1 to anova3rm, with a non-parametric approach (permutation tests)
GNU General Public License v3.0
2 stars 2 forks source link

3x3 two-way ANOVA post-hoc data oragnization #12

Closed jinhee615 closed 3 years ago

jinhee615 commented 3 years ago

Hello.

I'm trying to make Group x Conditions (3x3) two-way repeated ANOVA design. I have Three Groups, A,B,C and Conditions I/N/O. (3x3) So, I have data set like below.

AN, AI, AO / BN, NI, NO / CN, CI, CO (All data size is 101x12) Y1=[AI ; AN ; AO ; BI ; BN ; BO ; CI ; CN ; CO]; > Y1 size is 108x101. After I ran 2way repeated ANOVA, I want to run post hoc.

But As I observed Examples, I think Dataset should be changed its form. I think dataset should be changed its form like below image. image

So build a code Y2=[ AI AN AO ; BI BN BO ; CI CN CO];

Is this a right arrangement? If its so, How Can I change in a structure?

jinhee615 commented 3 years ago

I added code like below.

for i=1:size(NN,1) PatientsdatagroupA{i,1}=AI(i,:)'; PatientsdatagroupA{i,2}=AN(i,:)'; PatientsdatagroupA{i,3}=AO(i,:)'; PatientsdatagroupB{i,1}=BI(i,:)'; PatientsdatagroupB{i,2}=BN(i,:)'; PatientsdatagroupB{i,3}=BO(i,:)'; PatientsdatagroupC{i,1}=CI(i,:)'; PatientsdatagroupC{i,2}=CN(i,:)'; PatientsdatagroupC{i,3}=CO(i,:)'; end Y2=[PatientsdatagroupA ; PatientsdatagroupB ; PatientsdatagroupC];

spmAnalysis2=fctSPMS(Y2,independantEffects,repeatedMeasuresEffects,'effectsNames',effectNames);

and error occured. It written as "Reference of Erased variables Combi." image

Any wrong about data stacking? Thanks in advance :)

tramarobin commented 3 years ago

I think your data organisation is correct.

It appears that the end a loop was to soon and erased the variable combi. It did not appear in my example as it was ok when one post hoc was performed.

The code was modified and it should work now. you can can download the entier code or just fctPostHoc1dS.m.

jinhee615 commented 3 years ago

I downloaded fctPostHoc1ds.m , and Error disappeard. But another problem occured. It means : Index exceeded array factor number(3). image

I changed colorLine{1}=[rgb('red'); rgb('black')]; colorLine{2}=[rgb('magenta'); rgb('cyan')]; But it still same error appears. 'Cause I have 3x3 design or problem of my code?

tramarobin commented 3 years ago

It was a known error that was modified 20 hours ago in fctPostHoc1d.m. When indepedantEffects or repeatedMeasuresEffects had similar writings the code wasn't able to recognize which post hoc tests display on the graph.

Can you retry it with a new download of the repository ? I tried with the same design as you (3X3 with the same effect and modalities names) and the function worked fine.

jinhee615 commented 3 years ago

Yes I tried again after Redownloaded fctPostHoc1d.m

And I ran Posthoc, I'm looking a result graph, I have further quesitons. image I wonder how to interpret Post-hoc. Above graph is Group x Condition ; Condition graph. Graph Does not seems Over Threshold, But Lined like Significance cluster.

image Above Graph is Post hoc > Group > SPM grpah. Graph acrossed Threshold line, But it does not Lined Blue Significance cluster.

How Can I interpret those graphs ? Or do I need to refer other Graphs?

Thanks a lot :)

tramarobin commented 3 years ago

Nice to see it worked.

Complicated to tell without the entire analysis but :

For the first graph : I think you have a condition effect in which Intoed and Outtoed are different whatever the Group. If there is no interaction effect at the same location (I think % of stance in your case), the main group effect is represented in blue.

For the second graph: Does the Group effect of the ANOVA significant ? It might have a significant t-test but if the ANOVA is not significant the clusters are not displayed as significant. However, the amplitude of differences is great and I wonder why the ANOVA was not significant in this case.

How Can I interpret those graphs ? Or do I need to refer other Graphs?

I prefer using the graphs with the means + sd with the SPM analysis below as they offer a wider view with the results of the ANOVA and post-hoc tests.

jinhee615 commented 3 years ago

Thank you for your kind answer. It helped me a lot. I have further questions about post hoc interpretation, I think Its' better to open new issue