Statistics Functions

contingtbl(M) Takes a matrix of integers, M, and returns a 5-element vector containing chi-squared, degrees of freedom, probability that chi-squared or larger would occur if variables had no association, Cramer's V, and the contingency coefficient, C.

Ftest(v1, v2) Tests the hypothesis that two real-valued vectors vl and v2 are drawn from distributions having the same variance, and returns a vector of length 2 containing the value of the F statistic, and the probability that a value this large or larger would occur when the distributions have the same variance.

kendltau(v1,v2) Takes two real vectors vl and v2 of equal length, and returns a 3-element vector containing the following data:

kendltau2(M) Takes a real matrix M, and returns a 3-element vector containing the following data:

order(v) Takes a vector v of real or complex numbers and returns the index in which the numbers of a data set occur if sorted. Multiple entries generate sequential indices based on their original priority in the data. The indices returned are relative to ORIGIN.

percentile(v, p) Takes a vector v of real or complex numbers and measures which values of the vector occur below a certain percentage p of the total number of points. p must be between 0 and 1, inclusive. The imaginary parts of the elements of v are ignored.

qqplot(v1, [v2 OR "distribution"]) Takes complex-valued vectors of data v1 and the optional vector v2.

If only v1 is specified, qqplot calculates points for a normal probability plot, generating quantiles for both v1 and the normal distribution.

If v2 is specified, qqplot calculates quantiles for v2, to be plotted against quantiles for v1 and returns a two-column matrix containing the x- and y-axes for a QQ plot (quantile-quantile plot) comparing the quantiles, or percentiles, of each data set.

If distribution is the second argument, the quantiles of the first data set are compared against the appropriate distribution. Options are:

The imaginary parts of the elements of v1 and v2 are ignored.

Rank(v) Takes a real or complex vector v and returns a vector corresponding to the sorted positions of each element of v. For repeated values, Rank returns an average of the indices where the values occur after sorting. Rank of the first entry is always 1. The imaginary parts of the elements of v are ignored.

Rank should not be confused with the built-in Mathcad function rank, which returns the rank of an array.

Spear(v1, v2) Takes two real vectors v1 and v2 of equal length and returns a five-element vector containing the following data: