0todd0000 / spm1d

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

Normality test discrete vs SPM #135

Closed AlbertoNTC closed 4 years ago

AlbertoNTC commented 4 years ago

Hello. I want to compare a discrete 2-way ANOVA with continuous waveform data SPM 2-way ANOVA too.

My question is: Do I need to test normality in both discrete and continuous data? Or, for instance, if I test on discrete data, would this be enough for continuous data too?

Finally, Is there an option in SPM for Friedman's test (equivalent to 2-way ANOVA RM for non-parametric data)?

Thank you, -Alberto

0todd0000 commented 4 years ago

Hello Alberto,

Do I need to test normality in both discrete and continuous data? Or, for instance, if I test on discrete data, would this be enough for continuous data too?

It depends what the purpose of the analysis is... If the goal is to check the distribution, as a marker for parametric test suitability, then passing a discrete test may indeed be suitable. However, since the discrete test does not pertain to the whole continuous domain, it may be safest to also consider normality for the continuous data. I personally think the best strategy is to conduct both parametric and non-parametric analyses, and to compare the results. If the results qualitatively agree, then the parametric approach's assumption of normality is a reasonable one.

Finally, Is there an option in SPM for Friedman's test (equivalent to 2-way ANOVA RM for non-parametric data)?

There is a non-parametric test for 2-way RM-ANOVA, but it is not Friedman's test. It is instead a permutation test. It is available in: spm1d.stats.nonparam.anova2rm

Todd

AlbertoNTC commented 4 years ago

Hello Profesor Pataky,

To double-check I got this right, for the normality test on the continuous data, I would need to conduct both parametric and non-parametric 2-way ANOVA RM, and compare these results (if SnPM{F} inference list and SPM{F} inference list give the same results in accepting or rejecting h0)?

And another question, What would be the practical difference in interpretation of the non-parametric 2-way ANOVA compared to Friedman's test?

Thank you again for the great support, -Alberto

0todd0000 commented 4 years ago

I would need to conduct both parametric and non-parametric 2-way ANOVA RM, and compare these results (if SnPM{F} inference list and SPM{F} inference list give the same results in accepting or rejecting h0)?

Yes, if there is a difference in the null rejection decision this would certainly be a sign that the distribution might be non-normal. You could also compare the threshold heights. The parametric and non-parametric threshold heights are generally different, but if similar clusters emerge then there is little practical difference between the two thresholds for that particular dataset. This implies that, even if the data are non-normal, an assumption of normality has little effect on the interpretation.

What would be the practical difference in interpretation of the non-parametric 2-way ANOVA compared to Friedman's test?

The Friedman test is a rank test, but spm1d's non-parametric test is a permutation test. The practical difference is difficult to say, because it depends on the sample size and nature of the distributions. One potentially practical difference is that different tests tend to have different powers for different sample sizes and effect sizes. Perhaps an indirect answer is: as the data distribution approaches normality, and as the sample size increases, all three types of tests converge to the same answer (parametric, permutation and rank tests). Conversely, as sample size decreases, one needs to be increasingly more cautious when interpreting results because different techniques' results tend to diverge. See the article below that considers the similarities and differences amongst a variety of non-parametric tests. This is not a very comprehensive article, but still provides a nice summary of the different perspectives of different tests. What's the difference? : An Overview of Non-Parametric Tests

AlbertoNTC commented 4 years ago

Thank you very much, Professor Pataky. This has been very helpful.

0todd0000 commented 4 years ago

You're welcome!

11mhs commented 1 year ago

Hello, I have a series of joint angle data taken from two control and experimental groups in the pre-test and post-test conditions. What is the normality of the data and how is it analyzed? Can I use post hoc to check the conditions? Should I check the group and between groups to find the difference? What do you think of the appropriate test? Thank you

0todd0000 commented 1 year ago

For a two-sample t test a normality test can be conducted using:

results = spm1d.stats.normality.ttest2(yA, yB).inference(alpha)




A similar interface exists for all other tests, so if your hypothesis test is conducted using a function called test_name as in:

spm1d.stats.test_name

then the corresponding normality test can be conducted using:

spm1d.stats.normality.test_name




Here is a full example script for the two-sample case.

Find more normality examples for additional tests here.