0todd0000 / spm1d

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

Averaging trials: ANOVA or ttests? #101

Closed 0todd0000 closed 4 years ago

0todd0000 commented 5 years ago

(Copied from a previously closed issue: #2}

I was hoping to compare two independent groups using a continuous data; a comparison of knee flexion angle (normalized to a 0-100% of the motion) between an intervention group and a control group. I would like to identify if and where during the normalized motion there is a statistical difference between the groups. Each subject have repeated the motion between 3-5 times. I have previously used mixed-model to take into account repeated measures for these kind of cases - but I believe SPM would be more ideal to avoid the multiple testing issue and falsified results. I could average these repeated trials and apply a two-sample mean t-test (spm1d.stats.ttest2), but then I will lose valuable information. Is it possible to include repeated measures in the "ttest2" and how, or can you recommend a different approach.

0todd0000 commented 5 years ago

I think it would be fine to average within-subjects, then conduct a two-sample t test. Averaging only discards within-subject variability, but this variability is largely irrelevant to the two-group comparison.

As an aside, note that multiple measurements per subject does not necessarily imply repeated measures. "Repeated measures" only exist if the same subject performs multiple tasks or conditions. The experiment you describe sounds like a multilevel design, and not a repeated measures design. Here is a relevant discussion: Which stats method for multivariate repeated measures with multiple trials?

Currently, spm1d does not directly support multilevel designs. However, it indirectly supports multilevel (hierarchical, random effects) modeling as described here: Overview of random effects analysis in spm1d For the experiment you describe above, multilevel modeling can be achieved by (1) estimating subject means, then (2) conducting a two-sample test, exactly as you suggest.

Todd