- MNE-Python version: 0.21.0
- operating system: Windows 11 Home

Hi,

I am trying to do rm-ANOVA with 1 factor that has three levels.

My function:

```
def computeStatistic(*args):
print('comparing 3 groups')
stats_array = np.zeros((3,n_vertices_fsave))
pval_array = np.zeros((3,n_vertices_fsave))
stats, pval= f_mway_rm(np.swapaxes(args, 1, 0), factor_levels=[3],
effects='A', return_pvals=True)#subjectx x condition x observations
stats_array = stats
pval_array = pval
return stats_array, pval_array
```

However, when I call it I get an error with the dot function, as it understands my factors as (3,3) instead of just 3 or (1,3):

```
stc_fsave_all_real_avg = np.mean(X, axis=2)
a=np.swapaxes(stc_fsave_all_real_avg, 1, 0)
for i in range(n_vertices_fsave):
#print('vertex ind: ', i)
fvalues_r, pvalues_r = computeStatistic(stc_fsave_all_real_avg[:,:,i])
```

My data is in shape (21, 3, 20484), meaning subjects (21) x conditions (3) x vertices (20484), and the error I get is:

```
--> 398 y = np.dot(data, c_)
399 b = np.mean(y, axis=1)[:, np.newaxis, :]
400 ss = np.sum(np.sum(y * b, axis=2), axis=1)
<__array_function__ internals> in dot(*args, **kwargs)
ValueError: shapes (21,3,1) and (3,3) not aligned: 1 (dim 2) != 3 (dim 0)
```

Any clue what is going on there, or if Iâ€™m declaring my factors in a wrong way?

Thanks a lot!

Please edit or remove the above text before submitting your posting.