Liking cljdoc? Tell your friends :D

## kixi.stats.core

``(adjusted-r-squared fy-hat fy k)``

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, and a constant k equal to the number of terms in the model, estimates the adjusted coefficient of determination R^2 using Wherry's Formula-1. This is the fraction of variance in y explained by the model, adjusted for the number of terms in the model. https://stats.stackexchange.com/questions/48703/what-is-the-adjusted-r-squared-formula-in-lm-in-r-and-how-should-it-be-interpret

```Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, and a constant k
equal to the number of terms in the model, estimates the adjusted
coefficient of determination R^2 using Wherry's Formula-1.
This is the fraction of variance in y explained by the model,
adjusted for the number of terms in the model.
sourceraw docstring

#### arithmetic-mean

Calculates the arithmetic mean of numeric inputs.

```Calculates the arithmetic mean of numeric inputs.
```
sourceraw docstring

#### chi-squared-test

``(chi-squared-test & fxs)``

Given a sequence of functions, each of which returns the categorical value (e.g. keyword or string) of a factor, performs a X^2 test of independence.

```Given a sequence of functions, each of which returns the categorical value
(e.g. keyword or string) of a factor, performs a X^2 test of independence.```
sourceraw docstring

#### correlation

``(correlation fx fy)``

Given two functions: (fx input) and (fy input), each of which returns a number, estimates the unbiased linear correlation coefficient between fx and fy over inputs. Ignores any records where fx or fy are nil. If there are no records with values for fx and fy, the correlation is nil. See http://mathworld.wolfram.com/CorrelationCoefficient.html.

```Given two functions: (fx input) and (fy input), each of which returns a
number, estimates the unbiased linear correlation coefficient between fx and
fy over inputs. Ignores any records where fx or fy are nil. If there are no
records with values for fx and fy, the correlation is nil. See
http://mathworld.wolfram.com/CorrelationCoefficient.html.```
sourceraw docstring

#### correlation-matrix

``(correlation-matrix kvs)``

Given a map of key names to functions that extract values for those keys from an input, computes the correlation for each of the n^2 key pairs. For example:

``````(correlation-matrix {:name-length #(.length (:name %))
:age         :age
:num-cats    (comp count :cats)})
``````

will, when reduced, return a map like:

``````{[:name-length :age]      0.56
[:name-length :num-cats] 0.95
...}
``````
```Given a map of key names to functions that extract values for those keys
from an input, computes the correlation for each of the n^2 key pairs.
For example:

(correlation-matrix {:name-length #(.length (:name %))
:age         :age
:num-cats    (comp count :cats)})

will, when reduced, return a map like:

{[:name-length :age]      0.56
[:name-length :num-cats] 0.95
...}```
sourceraw docstring

#### count

Calculates the count of inputs.

```Calculates the count of inputs.
```
sourceraw docstring

#### covariance

Alias for covariance-s

```Alias for covariance-s
```
sourceraw docstring

#### covariance-matrix

``(covariance-matrix kvs)``

Given a map of key names to functions that extract values for those keys from an input, computes the covariance for each of the n^2 key pairs. For example:

``````(covariance-matrix {:name-length #(.length (:name %))
:age         :age
:num-cats    (comp count :cats)})
``````

will, when reduced, return a map like:

``````{[:name-length :age]      0.56
[:name-length :num-cats] 0.95
...}
``````
```Given a map of key names to functions that extract values for those keys
from an input, computes the covariance for each of the n^2 key pairs.
For example:

(covariance-matrix {:name-length #(.length (:name %))
:age         :age
:num-cats    (comp count :cats)})

will, when reduced, return a map like:

{[:name-length :age]      0.56
[:name-length :num-cats] 0.95
...}```
sourceraw docstring

#### covariance-p

``(covariance-p fx fy)``

Given two functions of an input `(fx input)` and `(fy input)`, each of which returns a number, estimates the population covariance of those functions over inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no inputs have both x and y, returns nil.

```Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, estimates the population covariance of those functions over
inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no
inputs have both x and y, returns nil.```
sourceraw docstring

#### covariance-s

``(covariance-s fx fy)``

Given two functions of an input `(fx input)` and `(fy input)`, each of which returns a number, estimates the unbiased covariance of those functions over inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no inputs have both x and y, returns nil.

```Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, estimates the unbiased covariance of those functions over
inputs.

Ignores any inputs where `(fx input)` or `(fy input)` are nil. If no
inputs have both x and y, returns nil.```
sourceraw docstring

#### cramers-v

``(cramers-v fx fy)``

Cramer's Phi is the intercorrelation of two discrete variables and may be used with variables having two or more levels. It gives a value between 0 and +1 (inclusive). Given two functions: (fx input) and (fy input), each of which returns a the relevant discrete value.

```Cramer's Phi is the intercorrelation of two discrete variables and may be used with variables having two or more levels. It gives a value between 0 and +1 (inclusive).
Given two functions: (fx input) and (fy input), each of which returns a the relevant discrete value.```
sourceraw docstring

#### cross-tabulate

``(cross-tabulate & fxs)``

Given a sequence of n functions, each of which returns a categorical value (e.g. keyword or string) of a factor, calculates an n-dimensional contingency table implementing PContingencyTable. This can be passed to kixi.stats.test/chi-squared-test to determine if the relationship between factors is significant. See also: kixi.stats.core/chi-squared-test

```Given a sequence of n functions, each of which returns a categorical value
(e.g. keyword or string) of a factor, calculates an n-dimensional contingency table
implementing PContingencyTable. This can be passed to kixi.stats.test/chi-squared-test
to determine if the relationship between factors is significant.
sourceraw docstring

#### geometric-mean

Calculates the geometric mean of numeric inputs. Defined only for positive numbers.

```Calculates the geometric mean of numeric inputs. Defined only for positive numbers.
```
sourceraw docstring

#### harmonic-mean

Calculates the harmonic mean of numeric inputs.

```Calculates the harmonic mean of numeric inputs.
```
sourceraw docstring

#### histogram

Calculates a histogram of numeric inputs using the t-digest with default arguments.

```Calculates a histogram of numeric inputs using the t-digest with default arguments.
```
sourceraw docstring

#### iqr

Calculates the interquartile range of numeric inputs.

```Calculates the interquartile range of numeric inputs.
```
sourceraw docstring

#### kurtosis

Alias for kurtosis-s.

```Alias for kurtosis-s.
```
sourceraw docstring

#### kurtosis-p

Calculates the population kurtosis of numeric inputs. See http://www.macroption.com/kurtosis-formula/

```Calculates the population kurtosis of numeric inputs.
See http://www.macroption.com/kurtosis-formula/```
sourceraw docstring

#### kurtosis-s

```Estimates the sample kurtosis of numeric inputs.
See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
and http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.```
sourceraw docstring

#### max

Like clojure.core/max, but transducer and nil-friendly.

```Like clojure.core/max, but transducer and nil-friendly.
```
sourceraw docstring

#### mean

Alias for arithmetic-mean.

```Alias for arithmetic-mean.
```
sourceraw docstring

#### median

Calculates the median of numeric inputs.

```Calculates the median of numeric inputs.
```
sourceraw docstring

#### min

Like clojure.core/min, but transducer and nil-friendly.

```Like clojure.core/min, but transducer and nil-friendly.
```
sourceraw docstring

#### monoid

``(monoid f init)``

Add 0-arity returning `init` to `f`.

```Add 0-arity returning `init` to `f`.
```
sourceraw docstring

#### mse

``(mse fy-hat fy)``

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, calculates the mean squared error of the estimate.

```Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, calculates
the mean squared error of the estimate.```
sourceraw docstring

#### proportion

``(proportion pred)``

Calculate the proportion of inputs for which `pred` returns true.

```Calculate the proportion of inputs for which `pred` returns true.
```
sourceraw docstring

#### r-squared

``(r-squared fy-hat fy)``

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, estimates the coefficient of determination R^2. This is the fraction of variance in y explained by the model.

```Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, estimates
the coefficient of determination R^2.
This is the fraction of variance in y explained by the model.```
sourceraw docstring

#### regression-confidence-interval

``(regression-confidence-interval fx fy)``
``(regression-confidence-interval fx fy alpha)``
``(regression-confidence-interval fx fy alpha x)``

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

```Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.```
sourceraw docstring

#### regression-prediction-confidence-interval

``(regression-prediction-confidence-interval fx fy)``
``(regression-prediction-confidence-interval fx fy alpha)``
``(regression-prediction-confidence-interval fx fy alpha x)``

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

```Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.```
sourceraw docstring

#### regression-prediction-standard-error

``(regression-prediction-standard-error fx fy)``
``(regression-prediction-standard-error fx fy x)``

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

```Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.```
sourceraw docstring

#### regression-standard-error

``(regression-standard-error fx fy)``
``(regression-standard-error fx fy x)``

Given two functions: (fx input) and (fy input), each of which returns a number, and an x value, calculates the standard error of the least squares linear model of fx and fy over inputs. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the standard error of the estimate is nil.

```Given two functions: (fx input) and (fy input), each of which returns a
number, and an x value, calculates the standard error of the least
squares linear model of fx and fy over inputs.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the standard error of the estimate is nil.```
sourceraw docstring

#### rmse

``(rmse fy-hat fy)``

Given two functions: (fŷ input) and (fy input), returning the predicted and actual values of y respectively, calculates the root mean squared error of the estimate.

```Given two functions: (fŷ input) and (fy input), returning
the predicted and actual values of y respectively, calculates
the root mean squared error of the estimate.```
sourceraw docstring

#### share

Alias for proportion

```Alias for proportion
```
sourceraw docstring

#### simple-linear-regression

``(simple-linear-regression fx fy)``

Given two functions: (fx input) and (fy input), each of which returns a number, calculates a least squares linear model between fx and fy over inputs. Returns a vector containing the coefficients: offset and slope. Ignores any records with fx or fy are nil. If there are no records with values for fx and fy, the linear relationship is nil. See https://en.wikipedia.org/wiki/Simple_linear_regression.

```Given two functions: (fx input) and (fy input), each of which returns a
number, calculates a least squares linear model between fx and fy over inputs.
Returns a vector containing the coefficients: offset and slope.
Ignores any records with fx or fy are nil. If there are no records with
values for fx and fy, the linear relationship is nil. See
https://en.wikipedia.org/wiki/Simple_linear_regression.```
sourceraw docstring

#### simple-t-test

``(simple-t-test {:keys [mu sd]})``

Performs a simple t test against a specified population mean and standard deviation. The standard deviation is optional, if not provided, a 'plug-in' test using the sample's sd will be performed instead. mu: the population mean sd: (optional) the population standard deviation

```Performs a simple t test against a specified population mean
and standard deviation. The standard deviation is optional,
if not provided, a 'plug-in' test using the sample's sd
mu: the population mean
sd: (optional) the population standard deviation```
sourceraw docstring

#### simple-z-test

``(simple-z-test {:keys [mu sd]})``

Performs a simple z test against a specified population mean and standard deviation. The standard deviation is optional, if not provided, a 'plug-in' test using the sample's sd will be performed instead. mu: the population mean sd: (optional) the population standard deviation

```Performs a simple z test against a specified population mean
and standard deviation. The standard deviation is optional,
if not provided, a 'plug-in' test using the sample's sd
mu: the population mean
sd: (optional) the population standard deviation```
sourceraw docstring

#### skewness

Alias for skewness-s.

```Alias for skewness-s.
```
sourceraw docstring

#### skewness-p

Calculates the population skewness of numeric inputs. See: http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.

```Calculates the population skewness of numeric inputs.
See: http://www.real-statistics.com/descriptive-statistics/symmetry-skewness-kurtosis.```
sourceraw docstring

#### skewness-s

Estimates the sample skewness of numeric inputs. See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.

```Estimates the sample skewness of numeric inputs.
See https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.```
sourceraw docstring

#### standard-deviation

Alias for standard-deviation-s.

```Alias for standard-deviation-s.
```
sourceraw docstring

#### standard-deviation-p

Calculates the population standard deviation of numeric inputs.

```Calculates the population standard deviation of numeric inputs.
```
sourceraw docstring

#### standard-deviation-s

Estimates the sample standard deviation of numeric inputs.

```Estimates the sample standard deviation of numeric inputs.
```
sourceraw docstring

#### standard-error

Alias for standard-error-s

```Alias for standard-error-s
```
sourceraw docstring

#### standard-error-s

Calculates the standard error of sample means.

```Calculates the standard error of sample means.
```
sourceraw docstring

source

#### summary

Calculates the five number summary of numeric inputs.

```Calculates the five number summary of numeric inputs.
```
sourceraw docstring

#### t-test

``(t-test fx fy)``

Given two functions of an input `(fx input)` and `(fy input)`, each of which returns a number, performs the t test of mean significance of those functions over inputs. Ignores only inputs where both `(fx input)` and `(fy input)` are nil.

```Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, performs the t test of mean significance of those functions over
inputs.
Ignores only inputs where both `(fx input)` and `(fy input)` are nil.```
sourceraw docstring

#### variance

Alias for variance-s.

```Alias for variance-s.
```
sourceraw docstring

#### variance-p

Calculates the population variance of numeric inputs.

```Calculates the population variance of numeric inputs.
```
sourceraw docstring

#### variance-s

Estimates an unbiased variance of numeric inputs.

```Estimates an unbiased variance of numeric inputs.
```
sourceraw docstring

#### z-test

``(z-test fx fy)``

Given two functions of an input `(fx input)` and `(fy input)`, each of which returns a number, performs the z-test of mean significance of those functions over inputs.

Ignores only inputs where both `(fx input)` and `(fy input)` are nil.

```Given two functions of an input `(fx input)` and `(fy input)`, each of which
returns a number, performs the z-test of mean significance of those functions over
inputs.

Ignores only inputs where both `(fx input)` and `(fy input)` are nil.```
sourceraw docstring cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close