welch_test()welch_test()

计算 Welch-test 函数的 p_valueComputes the p_value of the Welch-test function

// 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

语法Syntax

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

参数Arguments

  • mean1:表示第一个序列的平均值的表达式mean1 : Expression that represents the mean (average) value of the first series
  • variance1:表示第一个序列的方差值的表达式variance1 : Expression that represents the variance value of the first series
  • count1:表示第一个序列中的值计数的表达式count1 : Expression that represents the count of values in the first series
  • mean2:表示第二个序列的平均值的表达式mean2 : Expression that represents the mean (average) value of the second series
  • variance2:表示第二个序列的方差值的表达式variance2 : Expression that represents the variance value of the second series
  • count2:表示第二个序列中的值计数的表达式count2 : Expression that represents the count of values in the second series

返回Returns

在统计学上,Welch t 检验是一种双样本位置检验,用于检验两个总体均值相等的假设。In statistics, Welch's t-test is a two-sample location test that's used to test the hypothesis that two populations have equal means. Welch t 检验是对学生 t 检验的一种改编,当两个样本的方差和样本大小不相等时,其可靠性更高。Welch's t-test is an adaptation of Student's t-test, and is more reliable when the two samples have unequal variances and unequal sample sizes. 这些检验通常称为“未配对”或“独立样本”t 检验。These tests are often referred to as "unpaired" or "independent samples" t-tests. 当比较的两个样本的统计单位不重叠时,通常会应用这些检验。The tests are typically applied when the statistical units underlying the two samples being compared are non-overlapping. Welch t 检验不如学生 t 检验常用,读者可能不太熟悉。Welch's t-test is less popular than Student's t-test, and may be less familiar to readers. 该检验也称为“Welch 不等方差 t 检验”或“不等方差 t 检验”。The test is also called "Welch's unequal variances t-test", or "unequal variances t-test".