Statistical

Classes

beta
binom
chiSq
confidence
coVariance
expon
f
logNorm
mode
norm
percentile
percentRank
poisson
quartile
rank
stDev
t
Var
weiBull
z
gamma
gammaLn

Members

(static) binomDistRange

See
  • binom.dist.range

(static) binomInv

See
  • binom.inv

(static) chiSqDist

See
  • chiSq.dist

(static) chiSqDistRt

See
  • chiSq.dist.rt

(static) chiSqInv

See
  • chiSq.inv

(static) chiSqInvRt

See
  • chiSq.inv.rt

(static) chiSqTest

See
  • chiSq.test

(static) confidenceNorm

See
  • confidence.norm

(static) confidenceT

See
  • confidence.t

(static) exponDist

See
  • expon.dist

(static) hypGeom

Returns the hypergeometric distribution.

(static) negBinom

Returns the negative binomial distribution.

(static) tDist2T

See
  • t.dist

(static) tInv2T

See
  • t.inv

Methods

(inner) aveDev(args) → {number}

Returns the average of the absolute deviations of data points from their mean.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the average of the absolute deviations of data points from their mean or an error.

Type: 
number

(inner) average(args) → {number}

Returns the average of its arguments.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ...Numbers, value references or ranges for which you want the average.

See
Returns:

the average of the arguments

Type: 
number

(inner) averageA(args) → {number}

Returns the average of its arguments, including numbers, text, and logical values.

Parameters:
NameTypeDescription
args*

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.

See
Returns:

the average of its arguments, including numbers, text, and logical values.

Type: 
number

(inner) averageIf(range, criteria, average_range) → {number}

Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.

Parameters:
NameTypeDescription
range*

One or more values to average, including numbers or names, arrays, or references that contain numbers.

criteriastring

The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.

average_range*

Optional. The actual set of values to average. If omitted, range is used.

See
Returns:

the average (arithmetic mean) of all the values in a range that meet a given criteria.

Type: 
number

(inner) averageIfs(args) → {number}

Returns the average (arithmetic mean) of all values that meet multiple criteria.

Parameters:
NameTypeDescription
args*

One or more values to average, including numbers or names, arrays, or references that contain numbers.

See
Returns:

the average (arithmetic mean) of all values that meet multiple criteria.

Type: 
number

(inner) correl(array1, array2) → {number|Error}

Returns the correlation coefficient between two data sets.

Parameters:
NameTypeDescription
array1Array.<number>

A range of value values.

array2Array.<number>

A second range of value values.

See
Returns:

Returns the population correlation coefficient of the array1 and array2 vectors (Pearson's Rho).

Type: 
number | Error

(inner) count(…values) → {number}

When using the Open Formula implementation, counts how many numbers are in the list of arguments. When using the Notes Formula implementation, calculates the number of text, number, or time-date values in a list.

Parameters:
NameTypeAttributesDescription
values*<repeatable>

Cell reference, or range within which you want to count numbers.

See
Returns:

how many numbers are in the list of arguments. or when using the Open Formula implementation see  www.oasis-open.org

Type: 
number
Examples
rosettajs.Statistical.count(1,2,3); // Returns 3
rosettajs.Statistical.count(["Jones", "Portsmore"]); // Returns 2

(inner) countA(args) → {number}

Counts how many values are in the list of arguments.

Parameters:
NameTypeDescription
args*

Arguments representing the values that you want to count.

See
Returns:

how many values are in the list of arguments

Type: 
number

(inner) countBlank(…values) → {number}

Counts the number of blank values within a range.

Parameters:
NameTypeAttributesDescription
valuesnumber<repeatable>

The range from which you want to count the blank values.

See
Returns:

the number of blank values within a range.

Type: 
number

(inner) countIf(range, criteria) → {number}

Counts the number of values within a range that meet the given criteria.

Parameters:
NameTypeDescription
range*

The values to check

criteriastring

The criteria to apply to each value in range

See
Returns:

The number of values in range that meet criteria

Type: 
number

(inner) countIfs(…valuesAndCriteria) → {number}

Counts the number of values within a range that meet multiple criteria.

Parameters:
NameTypeAttributesDescription
valuesAndCriteria*<repeatable>

Range in which to evaluate the associated criteria.

See
Returns:

the number of values within a range that meet multiple criteria

Type: 
number

(inner) countIn(range, value) → {number}

Counts the number of occurrences of a value in a given range.

Category: Statistical

Parameters:
NameTypeDescription
range*
value*
Returns:

the number of occurrences of a value in a given range.

Type: 
number

(inner) countUnique(…values) → {number}

Returns the number of unique items in a flattened array Formula.js only

Parameters:
NameTypeAttributesDescription
values*<repeatable>

The array or multiple arrays to be examined.

Returns:

the number of unique items in a flattened array

Type: 
number

(inner) devSq(args) → {number}

Returns the sum of squares of deviations.

Parameters:
NameTypeDescription
args*

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the sum of squares of deviations or an error if the arguments are incorrect.

Type: 
number

(inner) fisher(x) → {number}

Returns the Fisher transformation.

Parameters:
NameTypeDescription
xnumber

A numeric value for which you want the transformation.

See
Returns:

the Fisher transformation for a given number, or an error if the arguments are incorrect.

Type: 
number

(inner) fisherInv(y) → {number|Error}

Returns the inverse of the Fisher transformation.

Parameters:
NameTypeDescription
ynumber

The value for which you want to perform the inverse of the transformation.

See
Returns:

the inverse of the Fisher transformation.

Type: 
number | Error

(inner) forecast(x, known_ys, known_xs) → {number}

Returns a value along a linear trend.

Parameters:
NameTypeDescription
xnumber

The data point for which you want to predict a value.

known_ysnumber

The dependent array or range of data.

known_xsnumber

The independent array or range of data.

See
Returns:

a value along a linear trend or an error if the arguments are incorrect.

Type: 
number

(inner) frequency(data_array, bins_array) → {number}

Returns a frequency distribution as a vertical array.

Parameters:
NameTypeDescription
data_arraynumber

An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.

bins_arraynumber

An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.

See
Returns:

a frequency distribution as a vertical array or an error if the arguments are incorrect.

Type: 
number

(inner) gauss(z) → {number}

Returns 0.5 less than the standard normal cumulative distribution.

Parameters:
NameTypeDescription
znumber

Returns a number.

See
Returns:

0.5 less than the standard normal cumulative districubtion or an error if the arguments are incorrect.

Type: 
number

(inner) geoMean(args) → {number}

Returns the geometric mean.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the geometric mean or an error if the arguments are incorrect.

Type: 
number

(inner) growth(known_y, known_x, new_x, use_const) → {number}

Returns values along an exponential trend.

Parameters:
NameTypeDescription
known_ynumber

The set of y-values you already know in the relationship y = b*m^x.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.
  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.
  • If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.
known_xnumber

Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).
  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
new_xnumber

Optional. Are new x-values for which you want GROWTH to return corresponding y-values.

  • new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.
  • If new_x's is omitted, it is assumed to be the same as known_x's.
  • If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.
use_constboolean

Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.

  • If const is TRUE or omitted, b is calculated normally.
  • If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.
See
Returns:

values along an exponential trend or an error if the arguments are incorrect.

Type: 
number

(inner) harMean(args) → {number}

Returns the harmonic mean.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the harmonic mean or an error if the arguments are incorrect.

Type: 
number

(inner) intercept(known_y, known_x)

Returns the intercept of the linear regression line.

Parameters:
NameTypeDescription
known_ynumber

The dependent set of observations or data.

known_xnumber

The independent set of observations or data.

See
Returns:

the intercept of the linear regression line.

(inner) kurt(args) → {number}

Returns the kurtosis of a data set.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the kurtosis of a data set or an error if the arguments are incorrect.

Type: 
number

(inner) large(array, k)

Returns the k-th largest value in a data set.

Parameters:
NameTypeDescription
arraynumber

The array or range of data for which you want to determine the k-th largest value.

knumber

The position (from the largest) in the array or value range of data to return.

See
Returns:

the k-th largest value in a data set or an error if the arguments are incorrect.

(inner) linest(known_y, known_x) → {number}

Returns the parameters of a linear trend.

Parameters:
NameTypeDescription
known_ynumber

The set of y-values that you already know in the relationship y = mx + b.

  • If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.
  • If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.
known_xnumber

Optional. A set of x-values that you may already know in the relationship y = mx + b.

  • The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).
  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
See
Returns:

the parameters of a linear trend or an error if the arguments are incorrect.

Type: 
number

(inner) logest(known_y, known_x)

Returns the parameters of an exponential trend.

Parameters:
NameTypeDescription
known_ynumber

The set of y-values you already know in the relationship y = b*m^x.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.
  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.
known_xnumber

Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).
  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
See
Returns:

the parameters of an exponential trend or an error if the arguments are incorrect.

(inner) maxA(args) → {number}

Returns the maximum value in a list of arguments, including numbers, text, and logical values.

Parameters:
NameTypeDescription
argsnumber

value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.

See
Returns:

the maximum value in a list of arguments, including numbers, text, and logical values.

Type: 
number

(inner) median(args) → {number}

Returns the median of the given numbers.

Parameters:
NameTypeDescription
argsnumber

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.

See
Returns:

the median of the given numbers or an error if the arguments are incorrect.

Type: 
number

(inner) minA(args) → {number}

Returns the smallest value in a list of arguments, including numbers, text, and logical values.

Parameters:
NameTypeDescription
argsnumber

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.

See
Returns:

the smallest value in a list of arguments, including numbers, text, and logical values.

Type: 
number

(inner) pearson(array1, array2) → {number}

Returns the Pearson product moment correlation coefficient.

Parameters:
NameTypeDescription
array1Array.<number>

A set of independent values.

array2Array.<number>

A set of dependent values.

See
Returns:

the Pearson product moment correlation coefficient or an error if the arguments are incorrect.

Type: 
number

(inner) permut(number, number_chosen) → {number}

Returns the number of permutations for a given number of objects.

Parameters:
NameTypeDescription
numbernumber

An integer that describes the number of objects.

number_chosennumber

An integer that describes the number of objects in each permutation.

See
Returns:

the number of permutations for a given number of objects or an error if the arguments are incorrect.

Type: 
number

(inner) permutationA(number, number_chosen) → {number}

Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.

Parameters:
NameTypeDescription
numbernumber

An integer that describes the total number of objects.

number_chosennumber

An integer that describes the number of objects in each permutation.

See
Returns:

the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects or an error if the arguments are incorrect.

Type: 
number

(inner) phi(x) → {number}

Returns the value of the density function for a standard normal distribution.

Parameters:
NameTypeDescription
xnumber

X is the number for which you want the density of the standard normal distribution.

See
Returns:

the value of the density function for a standard normal distribution or an error if the argument is incorrect.

Type: 
number

(inner) prob(x_range, prob_range, lower_limit, upper_limit) → {number}

Returns the probability that values in a range are between two limits.

Parameters:
NameTypeDescription
x_rangeArray.<number>

The range of numeric values of x with which there are associated probabilities.

prob_rangeArray.<number>

A set of probabilities associated with values in x_range.

lower_limitnumber

Optional. The lower bound on the value for which you want a probability.

upper_limitnumber

Optional. The optional upper bound on the value for which you want a probability.

See
Returns:

the probability that values in a range are between two limits.

Type: 
number

(inner) rsq(known_y, known_x) → {number}

Returns the square of the Pearson product moment correlation coefficient.

Parameters:
NameTypeDescription
known_yArray.<number>

An array or range of data points.

known_xArray.<number>

An array or range of data points.

See
Returns:

the square of the Pearson product moment correlation coefficient or an error if the arguments are inforrect.

Type: 
number

(inner) skew(args) → {number}

Returns the skewness of a distribution.

Parameters:
NameTypeDescription
argsArray.<number>

number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

the skewness of a distribution or an error if the arguments are incorrect.

Type: 
number

(inner) slope(known_y, known_x) → {number}

Returns the slope of the linear regression line.

Parameters:
NameTypeDescription
known_yArray.<number>

An array or value range of numeric dependent data points.

known_xArray.<number>

The set of independent data points.

See
Returns:

the slope of the linear regression line or an error if the arguments are incorrect.

Type: 
number

(inner) small(array, k) → {number}

Returns the k-th smallest value in a data set.

Parameters:
NameTypeDescription
arrayArray.<number>

An array or range of numerical data for which you want to determine the k-th smallest value.

knumber

The position (from the smallest) in the array or range of data to return.

See
Returns:

the k-th smallest value in a data set or an error if the arguments are incorrect.

Type: 
number

(inner) standardize(x, mean, standard_dev) → {number}

Returns a normalized value.

Parameters:
NameTypeDescription
xnumber

The value you want to normalize.

meannumber

The arithmetic mean of the distribution.

standard_devnumber

The standard deviation of the distribution.

See
Returns:

a normalized value or an error if the arguments are incorrect.

Type: 
number

(inner) stDevA(…args) → {number}

Estimates standard deviation based on a sample, including numbers, text, and logical values.

Parameters:
NameTypeAttributesDescription
argsArray.<number><repeatable>

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

Estimated standard deviation based on a sample, including numbers, text, and logical values or an error.

Type: 
number

(inner) stDevPA(…args) → {number}

Calculates standard deviation based on the entire population, including numbers, text, and logical values.

Parameters:
NameTypeAttributesDescription
argsArray.<number><repeatable>

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.

See
Returns:

Calculated standard deviation based on the entire population, including numbers, text, and logical values or an error.

Type: 
number

(inner) steyx(known_y, known_x) → {number}

Returns the standard error of the predicted y-value for each x in the regression.

Parameters:
NameTypeDescription
known_yArray.<number>

An array or range of dependent data points.

known_xArray.<number>

An array or range of independent data points.

See
Returns:

the standard error of the predicted y-value for each x in the regression or an error if the arguments are incorrect.

Type: 
number

(inner) trend(known_ys, known_xs, new_xs) → {Array.<number>}

Returns values along a linear trend.

Parameters:
NameTypeDescription
known_ysArray.<number>

The set of y-values you already know in the relationship y = mx + b

known_xsArray.<number>

An optional set of x-values that you may already know in the relationship y = mx + b

new_xsArray.<number>

Optional. New x-values for which you want TREND to return corresponding y-values.

See
Returns:

values along a linear trend or an error if the arguments are incorrect.

Type: 
Array.<number>

(inner) trimMean(range, percent) → {number}

Returns the mean of the interior of a data set.

Parameters:
NameTypeDescription
rangeArray.<number>

The array or range of values to trim and average.

percentnumber

The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.

See
Returns:

the mean of the interior of a data set or an error if the arguments are incorrect.

Type: 
number

(inner) varA(…args) → {number}

Estimates variance based on a sample, including numbers, text, and logical values.

Parameters:
NameTypeAttributesDescription
argsArray.<number><repeatable>

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.

See
Returns:

Estimated variance based on a sample, including numbers, text, and logical values.

Type: 
number

(inner) varPA(…args) → {number}

Calculates variance based on the entire population, including numbers, text, and logical values.

Parameters:
NameTypeAttributesDescription
argsArray.<number><repeatable>

value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.

See
Returns:

Calculated variance based on the entire population, including numbers, text, and logical values

Type: 
number