Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post hoc after non parametric 1d_anova1rm in Matlab #286

Closed
gingerkongen opened this issue Apr 30, 2024 · 3 comments
Closed

Post hoc after non parametric 1d_anova1rm in Matlab #286

gingerkongen opened this issue Apr 30, 2024 · 3 comments

Comments

@gingerkongen
Copy link

Hi, Todd

I want to conduct a post hoc following the non parametric 1d_anova1rm. however I struggle to find a good way to do this. Can you help?

The code I used for the anova is below. Y= knee flexion during three different conditions. Therefore the post hoc must compare the three conditions pairwise.

""
clear; clc

% Last inn data fra Excel-filene
Y = importdata('Matlab1.xlsx');
A = importdata('Matlab2.xlsx');
SUBJ = importdata('Matlab3.xlsx');

% Forbered en tom matrise for dobbeltverdier
Y_double = zeros(size(Y));

% Konverter strengene til dobbeltverdier
for i = 1:numel(Y)
Y_double(i) = str2double(Y{i});

end

%(1) Conduct non-parametric test:
rng(0)
alpha = 0.05;
iterations = 100;
snpm = spm1d.stats.nonparam.anova1rm(Y_double, A, SUBJ);
snpmi = snpm.inference(alpha, 'iterations', iterations);
disp('Non-Parametric results')
disp( snpmi )

%(2) Compare to parametric inference:
spm = spm1d.stats.anova1rm(Y_double, A, SUBJ);
spmi = spm.inference(alpha);
disp('Parametric results')
disp( spmi )
% plot:
close all

% Plot med x-aksen fra 0 til 100
figure;
spmi.plot();
hold on

% Begrens x-aksen til 0, 50 og 100
xticks([0, 25, 50, 75, 100]);
yticks([0, 60, 120, 180]);

title('SPM ANOVA', 'FontSize', 18);
xlabel('Time (%)');

% Plot med x-aksen fra 0 til 100
figure;
snpmi.plot();
hold on

% Begrens x-aksen til 0, 50 og 100
xticks([0, 25, 50, 75, 100]);
yticks([0, 60, 120, 180]);

title('SPM ANOVA', 'FontSize', 18);
xlabel('Time (%)');
""

Thank you

@0todd0000
Copy link
Owner

Apologies for the delay! I missed your question in my inbox. For anova1rm paired t tests are an appropriate post hoc procedure, so I suggest conducting paired post hoc tests using spm1d.stats.ttest_paired, and adjusting the critical p-value for the number of pairs.

@gingerkongen
Copy link
Author

Hi,

I am running some 2D SPM anovas on sEMG data

However, I noticed some pretty large F-values (F= 10), which i belive to be quite strict.

Do you recomend just sticking with the output from the spm-pack or should i try to adjust something?

@0todd0000
Copy link
Owner

  • F = 10 is not that big, and likely not too far over the critical threshold. It is not unusual to see F-values of 100 or greater so I recommend not being concerned about the F-value size.

  • Since spm1d does not directly support data processing prior to statistical analysis, I cannot comment on how the data should be processed. However, as a general rule: it is usually not a good idea to adjust data processing particulars with the goal of altering statistical results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants