studentTTest

Applies Student’s t-test to samples from two populations.

Syntax

  1. studentTTest(sample_data, sample_index)

Values of both samples are in the sample_data column. If sample_index equals to 0 then the value in that row belongs to the sample from the first population. Otherwise it belongs to the sample from the second population.
The null hypothesis is that means of populations are equal. Normal distribution with equal variances is assumed.

Arguments

Returned values

Tuple with two elements:

Example

Input table:

  1. ┌─sample_data─┬─sample_index─┐
  2. 20.3 0
  3. 21.1 0
  4. 21.9 1
  5. 21.7 0
  6. 19.9 1
  7. 21.8 1
  8. └─────────────┴──────────────┘

Query:

  1. SELECT studentTTest(sample_data, sample_index) FROM student_ttest;

Result:

  1. ┌─studentTTest(sample_data, sample_index)───┐
  2. (-0.21739130434783777,0.8385421208415731)
  3. └───────────────────────────────────────────┘

See Also

Original article