statsmodels.stats.weightstats._tstat_generic¶
-
statsmodels.stats.weightstats._tstat_generic(value1, value2, std_diff, dof, alternative, diff=
0)[source]¶ 基于汇总统计的通用t检验
- The test statistic is :
tstat = (value1 - value2 - diff) / std_diff
并且假设其服从自由度为
dof的 t 分布。- Parameters:¶
- value1
floatorndarray 第一个样本的值,例如均值。
- value2
floatorndarray 第二个样本的值,例如均值。
- std_diff
floatorndarray 差值 value1 - value2 的标准误差
- dof
intorfloat 自由度
- alternative
str 备择假设,H1,必须是以下之一
‘双侧’ : H1:
value1 - value2 - diff不等于 0。‘larger’ : H1:
value1 - value2 - diff > 0‘较小’ : H1:
value1 - value2 - diff < 0
- diff
float 在零假设下,差异值
value1 - value2
- value1
- Returns:¶
Last update:
Oct 16, 2024