welch_test()

計算 Welch-test 函數的 p_value

語法

welch_test(mean1,variance1,count1,mean2,variance2,count2)

深入瞭解 語法慣例

參數

名稱 類型 必要 Description
mean1 real 或 long ✔️ 第一個數列的平均 (平均) 值。
variance1 real 或 long ✔️ 第一個數列的變異值。
count1 real 或 long ✔️ 第一個數列中的值計數。
mean2 real 或 long ✔️ 平均 (第二個數列的平均) 值。
variance2 real 或 long ✔️ 第二個數列的變異值。
count2 real 或 long ✔️ 第二個數列中的值計數。

傳回

維基百科

在統計資料中,Welch 的 t-test 是雙樣本位置測試,用來測試兩個人口是否相等的假設。 Welch 的 t-test 是學生的 t-test 調整,而且當兩個樣本具有不相等的變異數和不相等的樣本大小時更可靠。 這些測試通常稱為「不成對」或「獨立範例」的 t-test。 測試通常會在兩個要比較之樣本的基礎單位不重疊時套用。 Welch 的 t-test 比學生的 t-test 更受歡迎,而且讀者可能較不熟悉。 測試也稱為「Welch 的不相等變異數 t-test」或「不相等的差異 t-test」。

範例

// s1, s2 values are from https://en.wikipedia.org/wiki/Welch%27s_t-test
print
    s1 = dynamic([27.5, 21.0, 19.0, 23.6, 17.0, 17.9, 16.9, 20.1, 21.9, 22.6, 23.1, 19.6, 19.0, 21.7, 21.4]),
    s2 = dynamic([27.1, 22.0, 20.8, 23.4, 23.4, 23.5, 25.8, 22.0, 24.8, 20.2, 21.9, 22.1, 22.9, 20.5, 24.4])
| mv-expand s1 to typeof(double), s2 to typeof(double)
| summarize m1=avg(s1), v1=variance(s1), c1=count(), m2=avg(s2), v2=variance(s2), c2=count()
| extend pValue=welch_test(m1,v1,c1,m2,v2,c2)
// pValue = 0.021