title: pingouin.rm_anova, Repeated measure anova error. Python, Pandas
body: <p>I wanted to do repeated measure anova using pingouin rm_anova. My data is in long format, with different timepoints (time), each id is a subject, each subject repeated 3 times at 3 different timepoints. DV is weight_loss, IVs are group and time. The data looks like this:</p>
  <pre><code>    id  group   time    weight_loss
  0   1083    NOPE    b   0.000000
  1   1146    Placebo b   0.000000
  2   1214    Placebo b   0.000000
  3   1317    Placebo b   0.000000
  4   1318    NOPE    b   0.000000
  ... ... ... ... ...
  155 1805    NOPE    pm  0.042579
  156 1813    Placebo pm  -0.084606
  157 1819    Placebo pm  -0.073008
  158 1831    Placebo pm  -0.018574
  159 1837    NOPE    pm  -0.064956
  </code></pre>
  <p>Here is my code:</p>
  <pre><code>import pingouin as pg
  res = pg.rm_anova(dv = 'weight_loss', within = ['group', 'time'], data = sub, subject = 'id', detailed = True)
  res
  </code></pre>
  <p>But I got error message like this:</p>
  <pre><code>/python3.8/site-packages/numpy/lib/function_base.py:380: RuntimeWarning: Mean of empty slice.
    avg = a.mean(axis)
  /python3.8/site-packages/numpy/core/_methods.py:162: RuntimeWarning: invalid value encountered in true_divide
    ret = um.true_divide(
  /python3.8/site-packages/pandas/core/frame.py:8276: RuntimeWarning: Degrees of freedom &lt;= 0 for slice
    base_cov = np.cov(mat.T, ddof=ddof)
  /python3.8/site-packages/numpy/lib/function_base.py:2480: RuntimeWarning: divide by zero encountered in true_divide
    c *= np.true_divide(1, fact)
  /python3.8/site-packages/numpy/lib/function_base.py:2480: RuntimeWarning: invalid value encountered in multiply
    c *= np.true_divide(1, fact)
  /python3.8/site-packages/numpy/lib/function_base.py:380: RuntimeWarning: Mean of empty slice.
    avg = a.mean(axis)
  /python3.8/site-packages/numpy/core/_methods.py:162: RuntimeWarning: invalid value encountered in true_divide
    ret = um.true_divide(
  /python3.8/site-packages/pandas/core/frame.py:8276: RuntimeWarning: Degrees of freedom &lt;= 0 for slice
    base_cov = np.cov(mat.T, ddof=ddof)
  /python3.8/site-packages/numpy/lib/function_base.py:2480: RuntimeWarning: divide by zero encountered in true_divide
    c *= np.true_divide(1, fact)
  /python3.8/site-packages/numpy/lib/function_base.py:2480: RuntimeWarning: invalid value encountered in multiply
    c *= np.true_divide(1, fact)
  </code></pre>
  <p>I tried 'within' variable = ['time'] and it works, but it does not work for ['group'] variable alone or the combination. I also checked NAs and there is not NA nor 0. Does anyone know what's wrong and how to fix it?</p>
  <p>Thank you in advance!</p>