studentTTest
对两个总体的样本应用t检验。
语法
studentTTest(sample_data, sample_index)
两个样本的值都在 sample_data 列中。如果 sample_index 等于 0,则该行的值属于第一个总体的样本。 反之属于第二个总体的样本。
零假设是总体的均值相等。假设为方差相等的正态分布。
参数
返回值
元组,有两个元素:
示例
输入表:
┌─sample_data─┬─sample_index─┐
│        20.3 │            0 │
│        21.1 │            0 │
│        21.9 │            1 │
│        21.7 │            0 │
│        19.9 │            1 │
│        21.8 │            1 │
└─────────────┴──────────────┘
查询:
SELECT studentTTest(sample_data, sample_index) FROM student_ttest;
结果:
┌─studentTTest(sample_data, sample_index)───┐
│ (-0.21739130434783777,0.8385421208415731) │
└───────────────────────────────────────────┘
参见