python Python - 重复测量ANOVA

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python Python - 重复测量ANOVA相关的知识,希望对你有一定的参考价值。

# between subjects factors still not implemented as of 2019-02-27
from statsmodels.stats.anova import AnovaRM
aovrm = AnovaRM(df, depvar="rt", subject="id", within=["iv"])
fit = aovrm.fit()
fit.summary()
%load_ext rpy2.ipython

from rpy2.robjects import pandas2ri
R_data = pandas2ri.py2ri(final_data)

# switch_conditions is repeated, rest are between
%%R -i R_data -o afex_model
library(afex)
# Convert to numeric, due to pandas converting everything to strings
R_data <- transform(R_data, participant = as.numeric(participant))
R_data <- transform(R_data, ratings = as.numeric(ratings))
R_data <- transform(R_data, switch_conditions = as.numeric(switch_conditions))
afex_model <- aov_ez(
    "participant",
    "ratings",
    R_data,
    between=c("question_conditions", "complexity"),
    within=c("switch_conditions"),
    type=3, #type of sum squares to use; default is 3
    anova_table = list(es = "pes") # partial eta-squared; default is ges (generalized eta-squared)
)

以上是关于python Python - 重复测量ANOVA的主要内容,如果未能解决你的问题,请参考以下文章

Python包装脚本来测量另一个python文件的执行时间[重复]

如何在python中测量算法的运行时间[重复]

在 Python 中测量脚本运行时间 [重复]

python函数 一

重复附加到一个大列表(Python 2.6.6)

python+opencv实现机器视觉基础技术(宽度测量,缺陷检测,医学处理)