本文整理匯總了Python中statsmodels.stats.weightstats.DescrStatsW.confint_mean方法的典型用法代碼示例。如果您正苦於以下問題:Python DescrStatsW.confint_mean方法的具體用法?Python DescrStatsW.confint_mean怎麽用?Python DescrStatsW.confint_mean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類statsmodels.stats.weightstats.DescrStatsW
的用法示例。
在下文中一共展示了DescrStatsW.confint_mean方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_weightstats_ddof_tests
# 需要導入模塊: from statsmodels.stats.weightstats import DescrStatsW [as 別名]
# 或者: from statsmodels.stats.weightstats.DescrStatsW import confint_mean [as 別名]
def test_weightstats_ddof_tests(self):
# explicit test that ttest and confint are independent of ddof
# one sample case
x1_2d = self.x1_2d
w1 = self.w1
d1w_d0 = DescrStatsW(x1_2d, weights=w1, ddof=0)
d1w_d1 = DescrStatsW(x1_2d, weights=w1, ddof=1)
d1w_d2 = DescrStatsW(x1_2d, weights=w1, ddof=2)
#check confint independent of user ddof
res0 = d1w_d0.ttest_mean()
res1 = d1w_d1.ttest_mean()
res2 = d1w_d2.ttest_mean()
# concatenate into one array with np.r_
assert_almost_equal(np.r_[res1], np.r_[res0], 14)
assert_almost_equal(np.r_[res2], np.r_[res0], 14)
res0 = d1w_d0.ttest_mean(0.5)
res1 = d1w_d1.ttest_mean(0.5)
res2 = d1w_d2.ttest_mean(0.5)
assert_almost_equal(np.r_[res1], np.r_[res0], 14)
assert_almost_equal(np.r_[res2], np.r_[res0], 14)
#check confint independent of user ddof
res0 = d1w_d0.confint_mean()
res1 = d1w_d1.confint_mean()
res2 = d1w_d2.confint_mean()
assert_almost_equal(res1, res0, 14)
assert_almost_equal(res2, res0, 14)