Documentation/Calc Functions/TTEST

From The Document Foundation Wiki
Jump to navigation Jump to search


Function name:

TTEST

Category:

Statistical Analysis

Summary:

Calculates the probability associated with a Student's t-test. The function gives the p-value of a 2-sample t-test.

Syntax:

TTEST(Data1; Data2; Mode; Type)

Returns:

Returns a real number which is the probability associated with a Student's t-Test for the given arguments. It returns values in the range [0,1].

Arguments:

Data1 is the dependent array or range of data for the first record.

Data2 is the dependent array or range of data for the second record.

Mode = 1 to perform a one-tailed test, Mode = 2 to perform a two-tailed test

Type is the kind of t-test to perform. Type 1 means paired. Type 2 means two samples, equal variance (homoscedastic). Type 3 means two samples, unequal variance (heteroscedastic).

  • If Mode is less than 1 or greater than or equal to 3 then the function returns an error value.
  • If Mode or Type is a non-integer value then the function uses its floor value, i.e. it is truncated to an integer.
  • If Type is less than 1 or greater than or equal to 4 then the function returns an error value.
  • If the dimensions of Data1 and Data2 are different, then the function returns an error value.

Additional details:

  • For more details on Student's t-Test, visit Wikipedia.

Examples:

Data1 Data2
1 195 200
2 151 180
3 148 178
4 189 165
5 183 192
6 154 144
Formula Description Returns
=TTEST(A1:A6;B1:B6;1.5;2.9) The function calculates the Student's t-test for the given data passed as reference to a list of cells. Here Mode and Type are both non-integer values and get truncated to integers 1 and 2, respectively. 0.298513332513432
=TTEST({8,9,10,11};{50,80,110,140};2.5;3.9) The function calculates the Student's t-test for the given data passed as reference to a list of cells. Here Mode and Type are both non-integer values and get truncated to integers 2 and 3, respectively. 0.021495566698816
=TTEST(A1:A6;B1:B6;1.5;4) The function will return an error value since Type is greater than or equal to 4. Err:502

Related LibreOffice functions:

T.DIST

T.DIST.2T

T.DIST.RT

T.INV

T.INV.2T

T.DIST

TINV

T.TEST

ODF standard:

None

Equivalent Excel functions:

TTEST