Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

studentTTest

studentTTest

導入バージョン: v21.1.0

2 つの母集団から得られたサンプルに対してスチューデントの t 検定を適用します。

両方のサンプルの値は sample_data カラムに格納されます。sample_index が 0 の場合、その行の値は 1 つ目の母集団のサンプルに属します。それ以外の場合は、2 つ目の母集団のサンプルに属します。 帰無仮説は、母集団の平均が等しいというものです。分散が等しい正規分布を仮定します。

関連項目

構文

studentTTest([confidence_level])(sample_data, sample_index)

パラメータ

  • confidence_level — 任意。信頼区間の計算に使用する信頼水準。Float

引数

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

戻り値

2 つまたは 4 つの要素を持つタプルを返します (任意の confidence_level が指定されている場合) 。計算された t 統計量、計算された p 値、[計算された信頼区間の下限]、[計算された信頼区間の上限]。Tuple(Float64, Float64) または Tuple(Float64, Float64, Float64, Float64)

基本的な使い方

CREATE TABLE student_ttest (sample_data Float64, sample_index UInt8) ENGINE = Memory;
INSERT INTO student_ttest VALUES (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.8385421208415734) │
└───────────────────────────────────────────┘

関連項目

Navigation