0todd0000 / spm1d

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

Minimum Sample Size for 2 Way Repeated Measures ANOVA? #260

Closed jlit29 closed 7 months ago

jlit29 commented 1 year ago

Hi! I wanted to make sure my code would work before I collect on all my participants. I need to be using the 2 way repeated measures ANOVA as my participants are perform tasks with and without a brace, pre and post a fatigue protocol. My data is structures in a proper array, with all data in columns 1 and 2 being either a 1 or 0 to reflect the categorical condition, and column 3 contains their ID number. I wanted to test my code on just 2 participants, which means I have 8 rows of data. However, I keep getting this message: WARNING: Only one observation per subject found. When I print my subject vector, it prints out [1,1,1,1,2,2,2,2], so there are definitely 4 observations per subject. I've heard there may be a minimum sample size for the SPM to work, but I can't find it in the documentation. Any help would be appreciated. Thank you!

0todd0000 commented 1 year ago

Let's consider a two-way RM-ANOVA that consists of factors A and B, let's say with two levels of A (A1 and A2) and three levels of B (B1, B2 and B3). If one subject has just one observation in any particular combination (A1-B1, A1-B2, A1-B3, ...) then that warning will appear.

In your case it sounds like there are only two levels of each of A and B, so there are four combinations (A1-B1, A1-B2, A2-B1, A2-B2). From your description it sounds like there is just a single observation per combination. That is why the warning is triggered.

This warning message can be safely ignored. Here are two relevant posts: