Difference between revisions of "Functions for descriptive statistics"

From Free Pascal wiki
Jump to navigationJump to search
(SEM)
Line 1: Line 1:
 +
Descriptive statistics aim at characterising empirical data by summative parameters (and also by tables and plots}.
 +
 +
== Standard functions defined in math unit ==
 +
 
The unit [[doc:rtl/math/index.html|math]] of the [[RTL]] provides a plethora of routines for descriptive statistics.
 
The unit [[doc:rtl/math/index.html|math]] of the [[RTL]] provides a plethora of routines for descriptive statistics.
  
Line 10: Line 14:
 
*  [[doc:rtl/math/sum.html| sum]]: Returns the sum of values of an array.
 
*  [[doc:rtl/math/sum.html| sum]]: Returns the sum of values of an array.
 
*  [[doc:rtl/math/sumsandsquares.html| sumsandsquares]]: Returns sum and sum of squares of the values in an array.
 
*  [[doc:rtl/math/sumsandsquares.html| sumsandsquares]]: Returns sum and sum of squares of the values in an array.
 +
 +
== Other 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:
 +
 +
<syntaxhighlight>
 +
  function sem(const data: array of Extended): real;
 +
  begin
 +
    sem := stddev(data) / sqrt(length(data));
 +
  end;
 +
</syntaxhighlight>
 +
  
 
[[Category:Statistical algorithms]]
 
[[Category:Statistical algorithms]]

Revision as of 16:07, 2 January 2015

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.

Other 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;