python 方差分析_使用Python的重复测量方差分析

本文介绍了如何在Python中进行重复测量方差分析,特别是使用了pyvttbl库。文章阐述了受试者内部设计的优势,并提供了使用pyvttbl进行方差分析的步骤,包括安装库、执行方差分析和进行主体内效应测试。此外,还讨论了pyvttbl在数据分析和结果提取方面的功能,尽管它可能不再被积极维护。
摘要由CSDN通过智能技术生成

python 方差分析

A common method in experimental psychology is within-subjects designs. One way to analysis the data collected using within-subjects designs are using repeated measures ANOVA. I recently wrote a post on how to conduct a repeated measures ANOVA using Python and rpy2. I wrote that post since the great Python package statsmodels do not include repeated measures ANOVA. However, the approach using rpy2 requires R statistical environment installed.  Recently, I found a python library called pyvttbl whith which you can do within-subjects ANOVAs.  Pyvttbl enables you to create multidimensional pivot tables, process data and carry out statistical tests. Using the method anova on pyvttbl’s DataFrame we can carry out repeated measures ANOVA using only Python.

实验心理学中的一种常见方法是受试者内部设计 。 分析使用受试者内部设计收集的数据的一种方法是使用重复测量方差分析 。 我最近写了一篇关于如何使用Python和rpy2进行重复测量方差分析的文章 。 我写这篇文章是因为出色的Python软件包statsmodels不包含重复测量方差分析。 但是,使用rpy2的方法需要安装R统计环境。 最近,我发现了一个名为pyvttbl的python库,您可以在主题内进行方差分析。 Pyvttbl使您可以创建多维数据透视表,处理数据并进行统计测试。 使用pyvttbl的DataFrame上的方差分析方法,我们可以仅使用Python进行重复测量方差分析。

为什么在主题设计中? (Why within subject designs?)

There are, at least, two of the advantages using within-subjects design. First, more information is obtained from each subject in a within-subjects design compared to a between-subjects design. Each subject is measured in all conditions, whereas in the between-subjects design, each subject is typically measured in one or more but not all conditions. A within-subject design thus requires fewer subjects to obtain a certain level of statistical power. In situations where it is costly to find subjects this kind of design is clearly better than a between-subjects design. Second, the variability in individual differences between subjects is removed from the error term. That is, each subject is his or her own control and extraneous error variance is reduced.

使用主题内设计至少有两个优点。 首先,与受试者之间的设计相比,受试者内部设计可从每个受试者获得更多信息。 在所有条件下对每个对象进行测量,而在对象间设计中,通常在一个或多个但不是所有条件下对每个对象进行测量。 因此,受试者内部的设计需要较少的受试者来获得一定水平的统计能力。 在找不到主题的成本很高的情况下,这种设计显然比主题间设计更好。 第二,从误差项中消除了受试者之间个体差异的变异性。 即,每个对象都是他或她自己的控制,并且减少了无关的误差方差。

Python中的重复测量方差分析 (Repeated measures ANOVA in Python)

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值