メインコンテンツまでスキップ
メインコンテンツまでスキップ

studentTTest

二つの母集団からのサンプルに対して、Student の t 検定を適用します。

構文

studentTTest([confidence_level])(sample_data, sample_index)

両方のサンプルの値は sample_data カラムにあります。もし sample_index が 0 であれば、その行の値は最初の母集団からのサンプルに属します。それ以外の場合は、第二の母集団からのサンプルに属します。 帰無仮説は、母集団の平均が等しいというものです。等しい分散の正規分布が仮定されています。

引数

  • sample_data — サンプルデータ。 IntegerFloat、または Decimal
  • sample_index — サンプルインデックス。 Integer

パラメータ

  • confidence_level — 信頼区間を計算するための信頼レベル。 Float

返される値

Tuple で、二つまたは四つの要素(オプションの confidence_level が指定されている場合)を持ちます:

  • 計算された t 統計量。 Float64
  • 計算された p 値。 Float64
  • [計算された信頼区間の下限。 Float64。]
  • [計算された信頼区間の上限。 Float64。]

入力テーブル:

┌─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) │
└───────────────────────────────────────────┘

参照