Functions for descriptive statistics
From Free Pascal wiki
Revision as of 02:14, 3 January 2015 by Jwdietrich (talk | contribs) (→Standard functions defined in other units)
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.
- mean: Returns the mean value of an array.
- stddev: Returns the standard deviation of an array.
- meanandstddev: Returns mean and standard deviation of an array.
- momentskewkurtosis: Returns the first four moments of an array.
- variance: Returns the variance of an array.
- totalvariance: Returns the total variance of an array.
- sumofsquares: Returns the sum of squares of an array.
- sum: Returns the sum of values of an array.
- sumsandsquares: Returns sum and sum of squares of the values in an array.
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;