scipy.stats.mstats.

brunnermunzel#

scipy.stats.mstats.brunnermunzel(x, y, alternative='two-sided', distribution='t')[原始碼]#

計算樣本 x 和 y 的 Brunner-Munzel 檢定。

任何在 x 和/或 y 中的遺失值都會被捨棄。

Brunner-Munzel 檢定是一種非參數檢定,用於檢驗虛無假設:當從每個組別依序取值時,兩組中取得較大值的機率相等。與 Wilcoxon-Mann-Whitney U 檢定不同,此檢定不需要兩組之間等變性的假設。請注意,此檢定不假設分佈相同。此檢定適用於兩個獨立樣本,它們可能具有不同的大小。

參數:
x, yarray_like

樣本陣列,應為一維。

alternative‘less’, ‘two-sided’, 或 ‘greater’, optional

取得單尾假設(‘less’ 或 ‘greater’)或雙尾假設(‘two-sided’)的 p 值的選項。預設值為 ‘two-sided’ 。

distribution‘t’ 或 ‘normal’, optional

選擇使用 t 分佈或標準常態分佈來取得 p 值。預設值為 ‘t’ 。

回傳值:
statisticfloat

Brunner-Munzer W 統計量。

pvaluefloat

p 值,假設為 t 分佈。單尾或雙尾,取決於 alternativedistribution 的選擇。

參見

mannwhitneyu

在兩個樣本上進行 Mann-Whitney 秩和檢定。

註解

有關 brunnermunzel 的更多詳細資訊,請參閱 scipy.stats.brunnermunzel

範例

>>> from scipy.stats.mstats import brunnermunzel
>>> import numpy as np
>>> x1 = [1, 2, np.nan, np.nan, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1]
>>> x2 = [3, 3, 4, 3, 1, 2, 3, 1, 1, 5, 4]
>>> brunnermunzel(x1, x2)
BrunnerMunzelResult(statistic=1.4723186918922935, pvalue=0.15479415300426624)  # may vary