双向重复测量ANOVA python函数

DGM*_*C90 4 python statistics

预先感谢您的任何答复。我想在 python 中进行 2 路重复测量方差分析,其中一个 IV 有 5 个级别,其他 4 个级别,有一个 DV。我尝试查看 scipy 文档和一些在线博客,但似乎找不到任何东西。

Rap*_*ael 8

您可以使用Pingouin 包(我是其创建者)中的rm_anova函数,该函数直接与 pandas DataFrame 一起使用,例如:

import pingouin as pg

# Compute the 2-way repeated measures ANOVA. This will return a dataframe.
pg.rm_anova(dv='dv', within=['iv1', 'iv2'], subject='id', data=df)

# Optional post-hoc tests
pg.pairwise_ttests(dv='dv', within=['iv1', 'iv2'], subject='id', data=df)
Run Code Online (Sandbox Code Playgroud)