Jump to content

Documentation/Calc Functions/TDIST

From The Document Foundation Wiki

Function name:

TDIST

Category:

Statistical Analysis

Summary:

Calculates right tail or two-tailed probability values for the t-distribution. The t-distribution is often known as the Student's t-distribution.

T-distributions are a family of continuous probability distributions and each has a curve with the same general bell shape that is symmetric about 0. Each t-distribution is characterized by a parameter known as the number of degrees of freedom, often denoted by the lowercase Greek letter nu ([math]\displaystyle{ \nu }[/math]). The t-distribution approaches the normal distribution as the number of degrees of freedom increases. T-distributions are often used to model small sample sizes.

Syntax:

TDIST(Number; Degrees freedom; Mode)

Returns:

Returns a real number in the range [0, 1], which is the required probability value for the given arguments. This represents the total area under the appropriate tail or tails of the probability density function of the specified t-distribution.

Arguments:

Number is a non-negative real number, or a reference to a cell containing that number, which is the value at which the probability is to be evaluated.

Degrees freedom is a positive integer, or a reference to a cell containing that number, which is the number of degrees of freedom of the t-distribution. This is typically assumed to be the number of samples minus 1.

Mode is an integer equal to 1 or 2, or a reference to a cell containing that number, which indicates which probability to calculate. Value 1 corresponds to a right tail probability; value 2 corresponds to a two-tailed probability.

  • If any of Number, Degrees freedom, or Mode is non-numeric, then TDIST reports a #VALUE! error.
  • If Number is less than 0, then TDIST reports an invalid argument error (Err:502).
  • If either Degrees freedom or Mode is a non-integer value, then TDIST truncates it to an integer value.
  • If Degrees freedom is less than 1, then TDIST reports an invalid argument error (Err:502).
  • If, after any truncation, Mode is not equal to 1 or 2, then TDIST reports an invalid argument error (Err:502).

Additional details:

  • Calc's TDIST function meets the requirements of the LEGACY.TDIST function in ODF 1.2.
  • Calc provides four related functions that return values from the t-distribution and these are:
  • T.DIST. Calculates t-distribution values from either the probability density function or the cumulative distribution function of the specified t-distribution. These are sometimes referred to as "left tailed" values.
  • T.DIST.2T. Calculates the total area under the two tails of the probability density function of the specified t-distribution. This represents the total probability that the value of a random variable lies below [math]\displaystyle{ -\text{ABS}(Number) }[/math] or above [math]\displaystyle{ +\text{ABS}(Number) }[/math].
  • T.DIST.RT. Calculates the total area under the right tail of the probability density function of the specified t-distribution. This represents the total probability that the value of a random variable lies above Number.
  • TDIST. A dual purpose function that can calculate either of the two types of value calculated by T.DIST.2T or T.DIST.RT.
  • The formula for calculating a right tail or two-tailed probability for the t-distribution is:
[math]\displaystyle{ \text{TDIST}(x;\:\nu;\:m)~=~m \times \int_{x}^{\infty}\frac{ \Gamma\!\left(\frac{\nu +1}{2}\right)}{\sqrt{\pi\:\nu}~~\Gamma\!\left(\frac{\nu}{2}\right)}\left (1+\frac{t^2}{\nu}\right)^{ -\frac{(\nu+1)}{2}} dt }[/math]
where
  • [math]\displaystyle{ \Gamma }[/math] is the gamma function.
  • [math]\displaystyle{ \nu }[/math] is the (positive) number of degrees of freedom of the t-distribution.
  • [math]\displaystyle{ m }[/math] is the value of the Mode argument.
Note that the random variable x in the above formula often appears as t in other sources.
  • The following figure shows right tail probability plots for four sample t-distributions.
  • The following figure shows two-tailed probability plots for four sample t-distributions.
  • For valid arguments, the following relationships exist with other Calc functions:
TDIST(x; y; 1) = T.DIST.RT(x; y)
TDIST(x; y; 2) = T.DIST.2T(x; y)

Examples:

Formula Description Returns
=TDIST(A1; A2; A3) where cells A1:A3 contain the values 0.5, 2, and 1 respectively. Here the function calculates the right tail probability for the given values. Note that the formula =TDIST(0.5; 2.9; 1.9) returns the same value because the Degrees freedom and Mode arguments are truncated to integer values. 0.333333333333333
=TDIST(0; 25; 1) Here the function calculates the value of the right tail probability when the Number argument is set to 0. Note that with Number equal to 0, a call to TDIST with Mode set to 1 returns the same result for any valid value of the Degrees freedom argument. 0.5
=TDIST(0.5; 2; 2) Here the function calculates the two-tailed probability for the given values. 0.666666666666667
=TDIST(0; 25; 2) Here the function calculates the peak value of the two-tailed probability for the t-distribution with 25 degrees of freedom. Note that if the Number argument is set to 0, a call to TDIST with Mode set to 1 returns the same result for any valid value of the Degrees freedom argument. 1

Related LibreOffice functions:

T.DIST

T.DIST.2T

T.DIST.RT

T.INV

T.INV.2T

TINV

ODF standard:

Section 6.18.77, part 2

Related (or similar) Excel functions:

TDIST