0todd0000 / spm1d

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

Normality of time series and response to reviewer #173

Closed Vernon-A-B closed 3 years ago

Vernon-A-B commented 3 years ago

Hello Dr. Pataky,

I'm returning to the field after a substantial time gap - in the time I've been away it seems the entire biomechanics community has moved to favour SPM rather than analysis of discrete points/peaks! I am a convert, and have recently submitted a paper about gait kinematics and kinetics using SPM analysis. I received a comment from a reviewer relating to SPM; asking if the data is normally distributed:

"Are the statistical assumptions fullfilled? Especially the normality assumption, as reviewing your outcomes not all can be viewed as normal (which may not be a reason for the assumption to be violated) but this should be demonstrated."

I've given an overview of the assumptions of SPM. I wonder if you had any recommendations on normality tests? I see there is a normality test within the SPM1d, should the test be part of the analysis workflow?

My original methodology was the 'old' method of analysing discrete data points. Each of these points were normally distributed (sharipo-wilk), so I have carried-over this assumption to SPM and performed parametric t-tests (my study design is comparing three groups).

Many thanks,

Vernon.

0todd0000 commented 3 years ago

Thank you for the feedback! Since SPM is grounded in the probabilistic behavior of smooth, random continua, I think it's a more natural fit to many type of biomechanical data than the discrete data point approach. If a researcher has an a priori hypothesis regarding a specific discrete variable, then discrete point methods would certainly be appropriate, but if instead the goal is to test for general trajectory effects, without a specific a priori hypothesis, then I think a whole-trajectory approach like SPM or FDA is a better choice as these methods control error rates (Type I and Type II) at the whole-trajectory level.

Normality tests could indeed be conducted, but I usually recommend that both parametric and nonparametric analyses be conducted. The former assumes normality and the latter doesn't. If the results agree qualitatively, then the former's assumption of normality is inconsequential, so no explicit normality test is needed. On the other hand, if the results disagree, then one should generally probe the data to find out why and remove problematic observations (i.e., outliers) and/or defer to the nonparametric results if no data problems are evident but still normality is violated.

All hypothesis tests in spm1d have both parametric and nonparametric implementations, for example:

So for the overall workflow I'd recommend:

Note that this workflow assumes that there is an adequate sample size for nonparametric procedures. In general there must be at least 5 observations per group in ANOVA-type designs, but 8 or more is better.

Note also: when the data are normally distributed and the sample size is large, the nonparametric results are expected to converge precisely to the parametric results.

To answer the question: "Are the statistical assumptions fullfilled?"... Normality tests can not prove that a normality assumption was met. The null hypothesis is that the data were drawn from a normal distribution, but failing to reject that hypothesis does not imply that the data are in fact normal. Instead it could mean that there is an insufficient number of observations to detect deviations from normality. Real data are never perfectly normal.

To me a more important question is: "Does an assumption of normality affect the final results?" So I'd suggest answering the assumptions question indirectly, using the parametric and nonparametric approach described above.

Vernon-A-B commented 3 years ago

My apologies my reply to this is so tardy. I just wanted to thank you for taking the time and giving a detailed reply; really helped understand the process and was very useful in responding to reviewers.

0todd0000 commented 3 years ago

No problem at all! I'll close this issue for now, but please feel free to reopen it or create a new issue if anything else comes up.