0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
60 stars 21 forks source link

Extracting Cluster Data from 2 Way RM ANOVA #268

Closed jlit29 closed 7 months ago

jlit29 commented 9 months ago

Hi Todd,

I wish to extract the specific X axis coordinates where my 2 way RM anova SPM analysis found statistical significance. I used the following code to print the inference output: FF = spm1d.stats.anova2rm(Y, A, B, SUBJ) FFi = [F.inference(alpha=0.05) for F in FF] print(FFi) When I try to run print(FFi.clusters) I get an error. When I run: print(FFi.clusters for F in FF) I get "generator object at ....". I tried to convert the object to a string, list, and tuple but this didn't work either. Please let me know how I can access the cluster outputs. Thank you for your time.

0todd0000 commented 9 months ago

As a quick answer, try:

print( FFi[0].clusters )

or:

for Fi in FFi:
    print( Fi.clusters )


Notes: