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

meanZTest

導入バージョン: v22.2.0 2 つの母集団から得たサンプルに対して、平均値の z 検定を適用します。 両方のサンプルの値は sample_data カラムに格納されます。 sample_index が 0 の場合、その行の値は 1 つ目の母集団のサンプルに属します。 それ以外の場合は、2 つ目の母集団のサンプルに属します。 帰無仮説は、母集団の平均が等しいことです。 正規分布を仮定します。 母集団の分散は等しくない場合があり、分散は既知です。 構文
meanZTest(population_variance_x, population_variance_y, confidence_level)(sample_data, sample_index)
パラメータ
  • population_variance_x — 母集団 x の分散。Float*
  • population_variance_y — 母集団 y の分散。Float*
  • confidence_level — 信頼区間の計算に使用する信頼水準。Float*
引数
  • sample_data — サンプルデータ。(U)Int* または Float* または Decimal
  • sample_index — サンプルインデックス。(U)Int*
戻り値 4 つの要素を持つタプルを返します: 計算された z 統計量、計算された p 値、計算された信頼区間の下限、計算された信頼区間の上限。Tuple(Float64, Float64, Float64, Float64) 平均の Z 検定の例
Query
CREATE TABLE mean_ztest (sample_data Float64, sample_index UInt8) ENGINE = Memory;
INSERT INTO mean_ztest VALUES (20.3, 0), (21.9, 0), (22.1, 0), (18.9, 1), (19, 1), (20.3, 1);

SELECT meanZTest(0.7, 0.45, 0.95)(sample_data, sample_index) FROM mean_ztest;
Response
┌─meanZTest(0.7, 0.45, 0.95)(sample_data, sample_index)───────────────────────────────┐
│ (3.2841296025548123, 0.0010229786769086013, 0.8198428246768334, 3.2468238419898365) │
└─────────────────────────────────────────────────────────────────────────────────────┘
最終更新日 2026年6月10日