本文整理汇总了Python中pyvttbl.DataFrame.ttest方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.ttest方法的具体用法?Python DataFrame.ttest怎么用?Python DataFrame.ttest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvttbl.DataFrame
的用法示例。
在下文中一共展示了DataFrame.ttest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import ttest [as 别名]
def test1(self):
R="""\
t-Test: One Sample for means
SUPPRESSION
=====================================
Sample Mean 19.541
Hypothesized Pop. Mean 17
Variance 228.326
Observations 384
df 383
t Stat 3.295
alpha 0.050
P(T<=t) one-tail 5.384e-04
t Critical one-tail 1.966
P(T<=t) two-tail 0.001
t Critical two-tail 1.649
P(T<=t) two-tail 0.001
Effect size d 0.168
delta 3.295
Observed power one-tail 0.950
Observed power two-tail 0.908 """
df = DataFrame()
df.read_tbl('data/suppression~subjectXgroupXageXcycleXphase.csv')
D=df.ttest('SUPPRESSION', pop_mean=17.)
self.assertEqual(str(D),R)
示例2: test4
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import ttest [as 别名]
def test4(self):
R="""t-Test: Paired Two Sample for means
PRE POST
=========================================
Mean 87.250 87.083
Variance 1207.659 1166.629
Observations 12 12
Pearson Correlation 0.995
df 11
t Stat 0.163
P(T<=t) one-tail 0.437
t Critical one-tail 1.796
P(T<=t) two-tail 0.873
t Critical two-tail 2.201 """
df = DataFrame()
df.read_tbl('example2_prepost.csv')
ttest = df.ttest('PRE','POST',paired=True)
self.assertEqual(str(ttest),R)
示例3: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import ttest [as 别名]
def test1(self):
R="""t-Test: One Sample for means
SUPPRESSION
====================================
Sample Mean 19.541
Hypothesized Pop. Mean 0
Variance 228.326
Observations 384
df 383
t Stat 25.341
P(T<=t) one-tail 3.347e-84
t Critical one-tail 1.649
P(T<=t) two-tail 6.694e-84
t Critical two-tail 1.966 """
df = DataFrame()
df.read_tbl('suppression~subjectXgroupXageXcycleXphase.csv')
ttest=df.ttest('SUPPRESSION')
self.assertEqual(str(ttest),R)
示例4: test4
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import ttest [as 别名]
def test4(self):
R = """t-Test: Paired Two Sample for means
PRE POST
=============================================
Mean 87.250 87.083
Variance 1207.659 1166.629
Observations 12 12
Pearson Correlation 0.995
df 11
t Stat 0.163
alpha 0.050
P(T<=t) one-tail 0.437
t Critical one-tail 2.201
P(T<=t) two-tail 0.873
t Critical two-tail 1.796
P(T<=t) two-tail 0.873
Effect size dz 0.047
delta 0.163
Observed power one-tail 0.068
Observed power two-tail 0.035 """
df = DataFrame()
df.read_tbl("data/example2_prepost.csv")
D = df.ttest("PRE", "POST", paired=True)
self.assertEqual(str(D), R)