Trouble Plotting SPM1D Paired t-Test Results in MATLAB: 'Unrecognized Method' Warning
25 views (last 30 days)
Show older comments
I have installed SPM version 12, and subsequently, I installed spm1d version M.0.4.10 (dated September 23, 2022). I used the following code to perform a paired t-test:
spm = spm1d.stats.ttest_paired(Ext_D, Ext_F);
spmi = spm.inference(0.05, 'two_tailed', true);
spm.plot();
The spmi object is successfully created, but when I attempt to plot it in MATLAB, I encounter a warning: 'Unrecognized method, property, or field 'plot' for class 'spm1d.stats.spm.SPM0D'.'
I'm seeking assistance to resolve this issue. Can someone please help me?
Accepted Answer
Takeda Ryutaro
on 27 Sep 2023
Sorry, I posted this in the comments section by mistake.
spm1d.plot.plot_meanSD(YA,'color','r');
hold on;
spm1d.plot.plot_meanSD(YB,'color','b');
title('Data','FontSize',18);
legend({'YA','YA SD','YB','YB SD'});
%(1) Conduct SPM analysis:
spm = spm1d.stats.ttest2(YA, YB);
spmi = spm.inference(0.05, 'two_tailed',true, 'interp',true);
% disp(spmi);
%(2) Plot:
subplot(1,2,2);
spmi.plot();
spmi.plot_threshold_label();
spmi.plot_p_values();
title('SPM analysis','FontSize',18);
4 Comments
Takeda Ryutaro
on 4 Oct 2023
Hi!
Seeing your data, you data size is [250,1].
Does the row represent time point?
If you want to do SPM1d, the size of the data should be [subject, timepoint].
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!