OpenBI Docs Buy

CONFIDENCE.T

The margin of error either side of a sample's mean (confidence 1 - alpha), from Student's t.

Group: Statistics. Compatible with DAX.

Syntax

CONFIDENCE.T ( <alpha>, <standard_dev>, <size> )
ParameterTypeDescription
alphaNumberOne minus the confidence level, strictly between 0 and 1: 0.05 for a 95 % interval.
standard_devNumberThe sample's standard deviation, above 0.
sizeWhole numberHow many values are in the sample, 2 or more; rounded to a whole number.

Returns

Number. The margin either side of the sample's mean, from Student's t with size − 1 degrees of freedom.

Remarks

  • It is T.INV ( 1 − alpha / 2, size − 1 ) × standard_dev / √size.
  • For a few values it is clearly wider than CONFIDENCE.NORM; the two draw together as the sample grows.
  • A size below 2 is an error: a single value says nothing about the spread.

Examples

Normal and t margins side by side

EVALUATE
VAR Sizes = DATATABLE ( "Size", INTEGER, { { 5 }, { 30 }, { 200 } } )
RETURN
    ADDCOLUMNS (
        Sizes,
        "Normal", CONFIDENCE.NORM ( 0.05, 2.5, [Size] ),
        "Student t", CONFIDENCE.T ( 0.05, 2.5, [Size] )
    )
SizeNormalStudent t
52.191306351441453.10415999550941
300.8945970718585790.933515341895249
2000.3464759560874190.348595961161408

The margin of the mean month

36 months of sales; the margin equals the formula written out with T.INV.

EVALUATE
VAR Monthly = ADDCOLUMNS ( VALUES ( Sales[Month] ), "Liters", [Liters sold] )
VAR n = COUNTROWS ( Monthly )
VAR Spread = STDEVX.S ( Monthly, [Liters] )
RETURN
    ROW (
        "Margin", CONFIDENCE.T ( 0.05, Spread, n ),
        "Written out", T.INV ( 0.975, n - 1 ) * Spread / SQRT ( n )
    )
MarginWritten out
2331.679595333662331.67959533366

CONFIDENCE.NORM, T.INV, STDEVX.S, AVERAGEX.

Last updated · OpenBI Studio 0.3.74