> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-1d264819.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> サンプルと既知の母平均に対して、1標本の Student の t 検定を実行します。

# studentTTestOneSample

<div id="studentTTestOneSample">
  ## studentTTestOneSample
</div>

導入バージョン: v25.10.0

1標本の スチューデントのt検定を適用して、サンプル平均が既知の母平均と異なるかどうかを判定します。

正規性を仮定します。帰無仮説は、サンプル平均が母平均に等しいことです。

オプションの `confidence_level` を指定すると、信頼区間を計算できます。

**注記:**

* 少なくとも 2 個の観測値が必要です。そうでない場合、結果は `(nan, nan)` になります (信頼区間を要求した場合は `nan`) 。
* 入力が一定、またはほぼ一定の場合も、標準誤差が 0 (または実質的に 0) になるため `nan` が返されます。

**関連項目**

* [スチューデントのt検定](https://en.wikipedia.org/wiki/Student%27s_t-test)
* [studentTTest 関数](/ja/reference/functions/aggregate-functions/studentTTest)

**構文**

```sql theme={null}
studentTTestOneSample([confidence_level])(sample_data, population_mean)
```

**パラメータ**

* `confidence_level` — 任意。信頼区間の信頼水準。(0, 1) の範囲の Float。[`Float*`](/ja/reference/data-types/float)

**引数**

* `sample_data` — サンプルデータ。[`Integer`](/ja/reference/data-types/int-uint) または [`Float`](/ja/reference/data-types/float) または [`Decimal`](/ja/reference/data-types/decimal)
* `population_mean` — 検定の比較対象となる既知の母平均 (通常は定数) 。[`(U)Int*`](/ja/reference/data-types/int-uint) または [`Float*`](/ja/reference/data-types/float) または [`Decimal`](/ja/reference/data-types/decimal)

**戻り値**

2 つ、または `confidence_level` が指定されている場合は 4 つの要素を持つタプルを返します。要素は、計算された t 統計量、計算された p 値 (両側) 、\[計算された信頼区間下限]、\[計算された信頼区間上限] です。信頼区間は、指定した信頼水準におけるサンプル平均に対するものです。[`Tuple(Float64, Float64)`](/ja/reference/data-types/tuple) または [`Tuple(Float64, Float64, Float64, Float64)`](/ja/reference/data-types/tuple)

**例**

**信頼区間なし**

```sql title=Query theme={null}
SELECT studentTTestOneSample()(value, 20.0) FROM t;
```

```response title=Response theme={null}
```

**95%信頼区間あり**

```sql title=Query theme={null}
SELECT studentTTestOneSample(0.95)(value, 20.0) FROM t;
```

```response title=Response theme={null}
```

**関連項目**

* [スチューデントのt検定](https://en.wikipedia.org/wiki/Student%27s_t-test)
* [studentTTest関数](/ja/reference/functions/aggregate-functions/studentTTest)
