本文簡要介紹 python 語言中 scipy.stats.mstats.compare_medians_ms
的用法。
用法:
scipy.stats.mstats.compare_medians_ms(group_1, group_2, axis=None)#
沿給定軸比較兩個獨立組的中位數。
使用中位數標準誤差的McKean-Schrader 估計值進行比較。
- group_1: array_like
第一個數據集。大小必須 >=7。
- group_2: array_like
第二個數據集。大小必須 >=7。
- axis: 整數,可選
估計中位數的軸。如果沒有,則數組被展平。如果軸不是無,則 group_1 和 group_2 應該具有相同的形狀。
- compare_medians_ms: {浮點數,ndarray}
如果axis為None,則返回一個浮點數,否則返回一個一維ndarray,其長度等於group_1沿軸的長度。
參數 ::
返回 ::
參考:
[1]約瑟夫·W·麥基恩和羅納德·M·施拉德。 “樣本中位數學生化方法的比較。” Statistics-Simulation 中的通信和計算 13.6 (1984):751-773。
例子:
>>> from scipy import stats >>> a = [1, 2, 3, 4, 5, 6, 7] >>> b = [8, 9, 10, 11, 12, 13, 14] >>> stats.mstats.compare_medians_ms(a, b, axis=None) 1.0693225866553746e-05
該函數被矢量化以沿給定軸計算。
>>> import numpy as np >>> rng = np.random.default_rng() >>> x = rng.random(size=(3, 7)) >>> y = rng.random(size=(3, 8)) >>> stats.mstats.compare_medians_ms(x, y, axis=1) array([0.36908985, 0.36092538, 0.2765313 ])
相關用法
- Python SciPy mstats.count_tied_groups用法及代碼示例
- Python SciPy mstats.chisquare用法及代碼示例
- Python SciPy mstats.trim用法及代碼示例
- Python SciPy mstats.winsorize用法及代碼示例
- Python SciPy mstats.argstoarray用法及代碼示例
- Python SciPy mstats.trima用法及代碼示例
- Python SciPy mstats.tmin用法及代碼示例
- Python SciPy mstats.tmax用法及代碼示例
- Python SciPy mstats.kruskalwallis用法及代碼示例
- Python SciPy mstats.sem用法及代碼示例
- Python SciPy mstats.zscore用法及代碼示例
- Python SciPy mstats.zmap用法及代碼示例
- Python SciPy mstats.mode用法及代碼示例
- Python SciPy mstats.hmean用法及代碼示例
- Python SciPy mstats.variation用法及代碼示例
- Python SciPy mstats.gmean用法及代碼示例
- Python SciPy mstats.pearsonr用法及代碼示例
- Python SciPy mstats.kruskal用法及代碼示例
- Python SciPy mstats.tmean用法及代碼示例
- Python SciPy mstats.mquantiles用法及代碼示例
- Python SciPy mstats.describe用法及代碼示例
- Python SciPy mstats.sen_seasonal_slopes用法及代碼示例
- Python SciPy mstats.find_repeats用法及代碼示例
- Python SciPy matlab.loadmat用法及代碼示例
- Python SciPy misc.ascent用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.stats.mstats.compare_medians_ms。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。