0todd0000 / spm1d

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

ANOVA2onerm or ttest2 #86

Closed MichaelS703 closed 6 years ago

MichaelS703 commented 6 years ago

Hi Todd, I have two questions: a) I would like to investigate whether there are gender specific differences in the pelvis-shoulders coupling (assessed using continuous relative phase) among experienced young golfers (boys and girls, about 16 years old). I have six boys and six girls each hitting a driver 10 times. In general, is it better to use a two sample t-test in this case or to use a two-way repeated measures ANOVA with repeated measurements on one factor?

b) I tried both., However, I get quite different results (significance for the t-test; no significance for the ANOVA). Thus, I tried the ANOVA2onerm with one of the examples included in the spm1d package. I took the ex_anova2onerm.py, commented in the 2x3 dataset and get the following warning (which I get for my data too): "WARNING: Only one observation per subject found. Residuals and inference will be approximate. To avoid approximate residuals: (a) Add multiple observations per subject and per condition, and (b) ensure that all subjects and conditions have the same number of observations." What am I doing wrong? I took your example and did not change anything other than changing the dataset that should be used.

I'd highly appreciate your thoughts on this.

Best regards, Michael

0todd0000 commented 6 years ago

Hi Michael,

a) It sounds like there is just one experimental factor (GENDER) in which case a two-sample test is appropriate. Repeated-measures (RM) (i.e. a paired t test or RM-ANOVA) is not appropriate unless it's possible to pair across participants in a hypothesis-relevant manner (e.g. by golf handicap index, BMI, etc.). I don't think two-way ANOVA is possible unless there is another experimental factor.

b) When there are just two groups (i.e. boys vs. girls), a two-sample t test (spm1d.stats.ttest2) with two-tailed inference is equivalent to one-way ANOVA (spm1d.stats.anova1); the F statistic from ANOVA will be the squared value of the t statistic, and p values should be identical. Similarly, a paired t test (spm1d.stats.ttest_paired) is equivalent to one-way RM ANOVA (spm1d.stats.anova1rm). If this is not what you see for your dataset please tell me.

Please see issue #43 for a discussion regarding the residuals warning message.

Todd

MichaelS703 commented 6 years ago

Hi Todd,

a) Yes, you understood it right. There is only one experimental factor (GENDER).

b) I calculated the two-sample t test as well as the one-way ANOVA and exactly receive the results expected, F values are the squared t values.

Thank you for your quick and helpful response! Michael