0todd0000 / spm1d

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

Clarification regarding normality and non parametric tests #270

Closed Pravina030821 closed 7 months ago

Pravina030821 commented 8 months ago

Hello Sir,

I would like to check with you if I am using the normality tests and nonparametric tests correctly.

Firstly, I take my datasets and run the normality tests, after which if I reject the H0 (normality is followed), I would go on to perform the non-parametric T-tests. However, if I do not reject H0 then I will go on to use the variance test followed by the parametric T-test. Is that the correct way of using it ?

Thank you for your kind assistance.

0todd0000 commented 8 months ago

Yes, that sounds like the general recipe that the literature follows, with one minor exception:

if I reject the H0 (normality is followed)

H0 is that the data come from a normal distribution, so rejecting H0 suggests that the data may not be normally distributed. (Other than this minor point your recipe sounds correct.)

However, I personally prefer a different recipe because I believe it is more informative:

  1. Conduct both parametric and nonparametric tests
  2. If the results agree qualitatively then the parametric approach's assumption of normality is a negligible one; in this case stick with the parametric result
  3. If the results disagree, then probe the data to discover the source of the difference (e.g. outliers, actually non-normal distribution, etc.); report nonparametric results and the data characteristics causing non-normality; optionally also report parametric results for transparency and to show what would happen under an assumption of normality

I believe that this approach is more insightful than using explicit normality tests because differences between parametric and nonparametric results are often small; they will only differ qualitatively when effects are relatively small, but in the case of small effect sizes one should interpret the results cautiously regardless of the procedure. More briefly, conducting both parametric and nonparametric analysis tends to reveal more about both the data and the consequences of assuming normality than does the standard recipe.

Pravina030821 commented 8 months ago

Thank you so much for the detailed explanation. I would also like to ask when I am comparing two samples (using two sample T-test) that are not independent of each other, how do I account for that using the current version of the code? Thank you.

0todd0000 commented 7 months ago

You can use a paired t test: spm1d.stats.ttest_paired