0todd0000 / spm1dmatlab

One-Dimensional Statistical Parametric Mapping in Matlab.
GNU General Public License v3.0
28 stars 13 forks source link

Plotting results from 3way ANOVA with critical F value #175

Closed freddybrown1984 closed 2 years ago

freddybrown1984 commented 2 years ago

Hi (again) Dr. Pataky!

This is Freddy who’s been hassling you on the GitHub forum RE a 3way2rm ANOVA in MATALAB. Thanks so much for all your help.

It appears that the ANOVA is working, but I just need to then link it up with the plot function to show the critical F value. So far I can run the ANOVA and print a graphic with:

t = spm1d.stats.anova3tworm(Y, A, B, C, SUBJ); t.plot(); Fig1NOFVALUE BUT… this doesn’t give me results regarding the null hypothesis, nor plot against the critical F value. The original script I downloaded (don’t worry… I’ve cleared this from my MATLAB path, now!) had:

spmlist = spm1d.stats.anova3tworm(Y, A, B, C, SUBJ); spmilist = spmlist.inference(0.05); disp_summ(spmilist) close all spmilist.plot();

which I can mofify to: t = spm1d.stats.anova3tworm(Y, A, B, C, SUBJ); tlist = t.inference(0.05); disp_summ(tlist) close all tlist.plot();

but the “list = function.inference (0.05)” part kills it and gives me the error message: _Unrecognized function or variable 'spm_uc'. Error in spm1d.rft1d.RFTCalculatorResels/isf (line 52) [u] = spm_uc(alpha, self.df, self.STAT, self.resels, self.n, self.Q); Error in spm1d.rft1d.f.isf_resels (line 46) u = calc.isf(alpha); Error in spm1d.stats.spm.SPM/get_critical_threshold (line 159) zstar = spm1d.rft1d.f.isf_resels(a, v, res, 'withBonf',withBonf, 'nNodes',n); Error in spm1d.stats.spm.SPM/inference (line 90) zstar = self.get_criticalthreshold(pstar, withBonf); Error in spm1d.stats.spm.SPMFList/inference (line 21) spmi = spm.inference(alpha); Error in spm1d.stats.spm.ASPMFList/subsref (line 40) spm = builtin('subsref', self, s); Error in Untitled (line 2) tlist = t.inference(0.05);

Is there anything you can do to help!?

0todd0000 commented 2 years ago

From the the code at the beginning of your posting:

t = spm1d.stats.anova3tworm(Y, A, B, C, SUBJ);
t.plot();

it is clear that inference has not yet been conducted. You need to conduct inference and then plot the inference results like this:

FF  = spm1d.stats.anova3tworm(Y, A, B, C, SUBJ);
FFi = FF.inference(0.05);
FFi.plot();

If calling inference raises an Unrecognized function or variable 'spm_uc' error, it means that the MATLAB path has not been set correctly. Ensure that you use the "add with subfolders" command as described in the MATLAB installation documentation.