本文整理汇总了Python中pyvttbl.DataFrame.anova1way方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.anova1way方法的具体用法?Python DataFrame.anova1way怎么用?Python DataFrame.anova1way使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvttbl.DataFrame
的用法示例。
在下文中一共展示了DataFrame.anova1way方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import anova1way [as 别名]
def test2(self):
R="""Anova: Single Factor on SUPPRESSION
SUMMARY
Groups Count Sum Average Variance
==============================================
AA 128 2048 16 148.792
AB 128 2510.600 19.614 250.326
LAB 128 2945.000 23.008 264.699
O'BRIEN TEST FOR HOMOGENEITY OF VARIANCE
Source of Variation SS df MS F P-value eta^2 Obs. power
============================================================================================
Treatments 1021873.960 2 510936.980 5.229 0.006 0.027 0.823
Error 37227154.824 381 97709.068
============================================================================================
Total 38249028.783 383
ANOVA
Source of Variation SS df MS F P-value eta^2 Obs. power
=========================================================================================
Treatments 3144.039 2 1572.020 7.104 9.348e-04 0.036 0.922
Error 84304.687 381 221.272
=========================================================================================
Total 87448.726 383
POSTHOC MULTIPLE COMPARISONS
Tukey HSD: Table of q-statistics
AA AB LAB
==============================
AA 0 2.749 ns 5.330 **
AB 0 2.581 ns
LAB 0
==============================
+ p < .10 (q-critical[3, 381] = 2.91125483514)
* p < .05 (q-critical[3, 381] = 3.32766157576)
** p < .01 (q-critical[3, 381] = 4.14515568451)"""
df = DataFrame()
df.read_tbl('data/suppression~subjectXgroupXageXcycleXphase.csv')
D=df.anova1way('SUPPRESSION', 'GROUP')
self.assertEqual(str(D),R)
示例2: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import anova1way [as 别名]
def test2(self):
R="""Anova: Single Factor on SUPPRESSION
SUMMARY
Groups Count Sum Average Variance
==============================================
AA 128 2048 16 148.792
AB 128 2510.600 19.614 250.326
LAB 128 2945.000 23.008 264.699
ANOVA
Source of SS df MS F P-value
Variation
===========================================================
Treatments 3144.039 2 1572.020 7.104 9.348e-04
Error 84304.687 381 221.272
===========================================================
Total 87448.726 383 """
df = DataFrame()
df.read_tbl('suppression~subjectXgroupXageXcycleXphase.csv')
aov=df.anova1way('SUPPRESSION','GROUP')
self.assertEqual(str(aov),R)
示例3: DataFrame
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import anova1way [as 别名]
# instantiate DataFrame object to hold data
df = DataFrame() # inherents a dict
# put data into a DataFrame object
df['data'] = data1+data2
# build dummy code column
df['conditions'] = ['A']*len(data1)+['B']*len(data2)
# visually verify data in DataFrame
print(df)
# run 1 way analysis of variance
# returns another dict-like object
aov = df.anova1way('data', 'conditions')
# print anova results
print(aov)
# this is just to show the data in the aov object
print(aov.keys())
# calculate omega-squared
aov['omega-sq'] = (aov['ssbn'] - aov['dfbn']*aov['mswn']) / \
(aov['ssbn'] + aov['sswn'] + aov['mswn'])
# you can access the results this way
print(aov['omega-sq'])
print(aov['f'])
print(aov['p'])