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

studentTTest

studentTTest

導入バージョン: v21.1

2つの母集団からの標本に対して、スチューデントの t 検定 (Student's t-test) を適用します。

両方の標本の値は 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 つの要素、または(省略可能な confidence_level が指定されている場合は)4 つの要素を持つタプルを返します。内容は、計算された t 統計量、計算された p 値、[計算された信頼区間の下限]、[計算された信頼区間の上限] です。Tuple(Float64, Float64) または Tuple(Float64, Float64, Float64, Float64)

基本的な使用方法

SELECT studentTTest(sample_data, sample_index) FROM student_ttest;
┌─studentTTest(sample_data, sample_index)───┐
│ (-0.21739130434783777,0.8385421208415731) │
└───────────────────────────────────────────┘

関連項目