stats 1.2.1
Statistics library for use with the Euphoria Programming Language

stats.e

This stats library providing a number of basic statistical functions. The definition of each function is given with the details of the function.

Preparing the data

All functions take as parameters one or more objects containing arrays of data.

Consequently in order to use these functions you need to arrange your data in an array, within a sequence. Sometimes, however, your data may be in the form of a frequency distribution - pairs of values and frequencies. In this case you can easily use Euphoria's 'repeat' function and the concatenation operator '&' to create the right form of input.

N.B. No provision is made in this library for 'missing values'. If you wish to use these functions then you must remove such data from your sequence.

Most functions operate on integer or real data values without problem. Some functions, however, have two forms:

See Dual functions for details of the exceptions.

The function frequency can handle string-type data as well as numeric data.

Moments

Moments in statistics are defined in a systemmatic way. Each value can be seen as a deviation from a given value. The mean of these deviations, raised to the power 'r' is known as the rth moment of the distribution, or sometimes the moment of order r.

A number of the functions in this library are defined using moments. Mainly for this reason all the functions are based on 'n' (the number of observations) and not on 'n-1' (for sample-bound estimates). If you wish to record such estimates then you can easily make the simple calculation adjustment before reporting your results.

Library specification

Version: 1.2.1

Date: February 2010
Author: C A Newbould (canewbould@users.sourceforge.net)
Licence: Free
Changes:

Interface

Globally-defined includes

Routines:

** univariate routines **

All these functions take, as the parameter, a sequence consisting of atoms in the form of a one-dimensional array. A vector type has been defined with the library to enable type-checking to take place when each function is called.

** more generalised univariate routine **

This function take, as the parameter, a sequence consisting of objects in the form of a vector.

** bivariate routines **

N.B. All these functions take, as parameters, two sequences consisting of atoms in the form of a vector. A vector type has been defined with the library to enable type-checking to take place when each function is called. The data are analysed pair-wise: that is, the first value in vector1 is associated with the first value in vector2, etc.

** Dual functions **

Instances where there are separate functions for integer and real data.

  Distributions Modal value[s]
Integer distribution mode
Real real_distribution real_mode

Integer functions

Real functions