0todd0000 / spm1d

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

spm1d FWHM #9

Closed bernard-liew closed 9 years ago

bernard-liew commented 9 years ago

Hello,

I am Bernard, a PhD student from Curtin, (Western Australia). I am new to python, programming and spm in general and need further help in understanding spm1d. The documentation at spm1d.org and papers on spm mentions smoothing a 1d curve. I would like to know what 'cut-off' is used to smooth the curve? Essentially, what determines the cut-off value?

Regards, Bernard

0todd0000 commented 9 years ago

Hi Bernard,

Before getting to your question note that there may be two relevant but separate issues:

  1. Smoothing (or filtering). This is a data processing step which is conducted somewhere between raw data sampling and statistical analysis. SPM assumes that the data have been properly smoothed prior to statistical analysis. Also, since smoothing parameters can affect the final results, it is usually a good idea to conduct a sensitivity analysis: vary the smoothing parameter(s) and re-run the statistical analyses. If the statistical results do not change qualitatively, then you can be more confident in the results.
  2. Smoothness. This refers to the 1D smoothness of the data. Smoothing can affect smoothness, but not the other way around. For the 1D case, a single scalar parameter (FWHM) describes 1D smoothness. The FWHM is the full-width at half-maximum of a Gaussian kernel which, when convolved with unorrelated Gaussian 1D data, yields smooth 1D Gaussian data with the same average gradient as the experimentally observed 1D residuals. For categorical designs like t tests and ANOVA, the "1D residuals" are simply the difference from the group mean 1D curve. spm1d estimates the FWHM based on the derivatives of the 1D residuals following the procedures described in Kiebel et al. (1999) (see reference below). Another way to think of the FWHM is as follows: to completely describe 0D Gaussian randomness one requires just two parameters (the mean and standard deviation) and to completely describe 1D Gaussian randomness just one additional parameter is needed: the FHWM. For 0D experimental data one estimates the population mean and population standard deviation using the sample mean and sample standard deviation. For 1D data one can estimate the population smoothness using the sample FWHM. Technical note: sometimes 1D data are not uniformly smooth across the whole 1D domain; there are procedures in the literature for dealing with such anisotropic smoothness, but these procedures are not yet implemented in spm1d.

Kiebel, S., Poline, J., Friston, K., Holmes, A., & Worsley, K. (1999). Robust smoothness estimation in statistical parametric maps using standardized residuals from the general linear model. NeuroImage, 10(6), 756–766.

Returning to your question:

Your question sounds like it refers to the first issue above. A "cutoff" is usually a parameter for low-pass or high-pass filtering. The smoothing functionality available in spm1d is currently limited to simple 1D Gaussian filtering. I'd therefore recommend smoothing your data with other software before conducting SPM analysis. One good option in Python is scipy.signal: http://docs.scipy.org/doc/scipy/reference/signal.html There are many filtering options including Butterworth filters which explicitly incorporate cutoffs (see the section: Matlab-style IIR filter design at the link above).

Regards, Todd

bernard-liew commented 9 years ago

Many Thanks Todd,

Actually I am referring to smoothness, but didn't realise that it is different from smoothing. I think I am slowly grasping the conceptual idea (maybe not the nuances.)

I do have other conceptual questions for SPM.

1) It is known that the statistical test drives the sample size calculation. How can one use spm to drive sample size calculations?

2) SPM is at a relative infancy and repeated measures SPM anova is in the works. If I have a single group undergoing say 6 repeated testings on gait kinematics, is it advisable to use multiple paired SPM t test with correction, or use traditional statistical measures on extracted scalar parameters?

Regards, Bernard

0todd0000 commented 9 years ago

Hi Bernard,

  1. Sample sizes can be calculated using standard power analysis. This is not yet implemented in spm1d, but the literature describes how typical (0-dimensional) power analysis extends to 1D, 2D and nD data. Here is a key reference: Friston, K. J., Holmes, A., Poline, J. B., Price, C. J., & Frith, C. D. (1996). Detecting activations in PET and fMRI: levels of inference and power. NeuroImage, 4(3 Pt 1), 223–235. http://doi.org/10.1006/nimg.1996.0074 http://www.sciencedirect.com/science/article/pii/S1053811996900749
  2. (Separated into sub-comments)

a. SPM is at a relative infancy and repeated measures SPM anova is in the works.

spm1d is indeed in its infancy, but note that SPM as a general methodology is fairly mature: Friston, K., Ashburner, J., Kiebel, S., Nichols, T., & Penny, W. (2007). Statistical Parametric Mapping: The Analysis of Functional Brain Images‎. Elsevier, London.

b. If I have a single group undergoing say 6 repeated testings on gait kinematics, is it advisable to use multiple paired SPM t test with correction...

Multiple paired t tests (with a correction for multiple comparisons) should yield identical results to repeated-measures ANOVA. This is true for both 1D data (using approaches like SPM) and standard 0D data. The main advantage of ANOVA is that it provides results compactly when there are no effects. When significant effects are present in ANOVA (i.e. F tests), one is usually obliged to report which groups differ in post hoc analyses (i.e. t tests). So you'd just be starting at the post hoc level and the only disadvantage is that this would be less clean than ANOVA in the case of no effects. Note that repeated-measures ANOVA will be available in the next major release of spm1d, coming later this year.

c. ... or use traditional statistical measures on extracted scalar parameters?

If your hypothesis pertains to 1D variables like kinematic trajectories then you should probably use a 1D methodology like SPM. If your hypothesis pertains to 0D variables (e.g. extracted scalars) then it would probably be best to (i) explicitly identify those 0D variables before conducting the experiment, (ii) measure only those 0D variables if possible, otherwise (iii) extract, analyze and report only those 0D variables.

Last, note that SPM is actually the same as traditional methodology (including both classical hypothesis testing and Bayesian inference); the only real difference is that SPM uses a model of 1D (or nD) randomness and traditional methods use a model of 0D randomness. That 1D model of randomness allows you conduct all traditional analyses (t tests, sample size calculations, etc.) at the 1D level.

Todd