Functions for descriptive statistics

From Free Pascal wiki
Jump to navigationJump to search

Descriptive statistics aim at characterising empirical data by summative parameters (and also by tables and plots}.

Standard functions defined in math unit

The unit math of the RTL provides a plethora of routines for descriptive statistics.

Standard functions defined in other units

  • length: Delivers the length (n) of an array.

Custom functions

Standard error of the mean

The standard error of the mean (SEM) is a measure that estimates how precisely the true mean of the population can be known.

Calculation of SEM is simple:

  function sem(const data: array of Extended): real;
  begin
    sem := stddev(data) / sqrt(length(data));
  end;