0todd0000 / spm1d

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

Can SPM be used to compare groups of different sizes? #137

Closed BiomechCorey closed 3 years ago

BiomechCorey commented 4 years ago

Hi there,

We are a clinical gait service in Australia and am very keen to use SPM on a project with kinematic data. We have a particular research question that asks if there is a difference between 5 groups of gait cycle kinematics. The question we have is, do we violate any assumptions if the groups are of different size? For example 1) n=10; 2) n = 5; 3) n= 25.

Many thanks,

Corey

jiku-pro commented 4 years ago

Hello Corey, thank you for this question.

Yes, SPM as a general methodology can handle different-sized groups, but unfortunately the software package spm1d currently supports arbitrary group sizes for only two designs:

  1. Two-sample t test
  2. One-way ANOVA (i.e., without repeated measures)

From your description it sounds like this is a one-way ANOVA, so I think you'll be able to use spm1d.

This won't violate group size assumptions, because neither equal group sizes nor equal group variance is assumed.

Todd

BiomechCorey commented 4 years ago

Brilliant! Thanks for the super quick response, Todd. Your expertise is much appreciated.

BiomechCorey commented 4 years ago

Hi again, Todd!

One further clarification on the violation of assumptions. Is it ok to treat individual legs as an independent observation? Most studies I have read on SPM don't have this sort of nuance to use as a guide.

For example, with our dataset, we want to treat legs independently because the kinematic gait pattern is different for each leg. So, we have one patient (001) but two series of data (left and right) for which the left is classed as A and the right is classed as B.

Patient Group 001_Left A
001_Right B
002_Left C 002_Right A

Ultimately, we want to know if the groups are different from each other across the gait cycle and where - which is why SPM so powerful.

Many thanks again,

Corey

0todd0000 commented 4 years ago

Hi Corey,

Is it ok to treat individual legs as an independent observation?

Strictly speaking: no, because contralateral limbs belong to the same individual and are therefore not independent by definition. However, this non-independence problem likely becomes smaller as sample size increases.

Here is a slightly longer answer:

When limbs are not of explicit empirical interest (e.g. injured vs. uninjured), there are a number of options:

  1. Model limb as a nuisance variable.
  2. Independently analyze limbs as a type of validation analysis.
  3. Double the number of dependent variables (e.g. knee moments would have 6 components, 3 per limb)
  4. Stack contralateral limbs end-to-end in time (i.e., 0-100% is one limb, 105-205% is the other limb; here there is a 5% gap between the limbs, but any non-zero gap is fine)

As far as I know, (1) is relatively common in the literature, and the other options are not common.

I personally prefer (2), because:

(3) and (4) are probably non-ideal because shuffling time around arbitrarily may introduce a variety of problems like dynamic inconsistency.

So I'm not sure what the best approach is, and perhaps it would be best to try all of the options to understand how different approaches affect the final results.

Todd