メインコンテンツへスキップ

welchTTest

導入バージョン: v21.1.0 2 つの母集団から得られたサンプルに対して、Welch の t 検定を適用します。 両方のサンプルの値は sample_data カラムに格納されます。 sample_index が 0 の場合、その行の値は 1 つ目の母集団のサンプルに属します。 それ以外の場合は、2 つ目の母集団のサンプルに属します。 帰無仮説は、母集団の平均が等しいことです。 正規分布を仮定します。 母集団の分散は等しくない場合があります。 構文
welchTTest([confidence_level])(sample_data, sample_index)
パラメータ
  • confidence_level — 任意。信頼区間の計算に使用する信頼水準。Float
引数
  • sample_data — サンプルデータ。Int* または UInt* または Float* または Decimal*
  • sample_index — サンプルインデックス。Int* または UInt*
戻り値 2 つまたは 4 つの要素を持つ Tuple を返します (任意の confidence_level が指定されている場合) 。内容は、計算された t 統計量、計算された p 値、さらに必要に応じて計算された信頼区間の下限と上限です。Tuple(Float64, Float64) または Tuple(Float64, Float64, Float64, Float64) 基本的な Welch’s t 検定
Query
CREATE TABLE welch_ttest (sample_data Float64, sample_index UInt8) ENGINE = Memory;
INSERT INTO welch_ttest VALUES (20.3, 0), (22.1, 0), (21.9, 0), (18.9, 1), (20.3, 1), (19, 1);

SELECT welchTTest(sample_data, sample_index) FROM welch_ttest;
Response
┌─welchTTest(sample_data, sample_index)──────┐
│ (2.7988719532211235, 0.051807360348581945) │
└────────────────────────────────────────────┘
信頼水準付き
Query
SELECT welchTTest(0.95)(sample_data, sample_index) FROM welch_ttest;
Response
┌─welchTTest(0.95)(sample_data, sample_index)─────────────────────────────────────────┐
│ (2.7988719532211235, 0.05180736034858519, -0.026294346671631885, 4.092961013338302) │
└─────────────────────────────────────────────────────────────────────────────────────┘
関連項目
最終更新日 2026年6月10日