sampleSkewness
sampleSkewness(
x,biased?):number
Defined in: src/sample_skewness.js:27
Skewness is a measure of the extent to which a probability distribution of a real-valued random variable “leans” to one side of the mean. The skewness value can be positive or negative, or even undefined.
Implementation is based on the adjusted Fisher-Pearson standardized moment coefficient, which is the version found in Excel and several statistical packages including Minitab, SAS and SPSS.
Pass biased to opt into the biased coefficient instead, which is the
population moment ratio m3 / m2^(3/2). That is what R reports and what
scipy returns by default; the adjusted coefficient above is scipy’s
bias=False. The two differ by a factor of sqrt(n * (n - 1)) / (n - 2).
Parameters
Section titled “Parameters”number[]
a sample of 3 or more data points
biased?
Section titled “biased?”boolean = false
if true, return the biased coefficient
Returns
Section titled “Returns”number
sample skewness
4.1.0
Throws
Section titled “Throws”if x has length less than 3
Example
Section titled “Example”sampleSkewness([2, 4, 6, 3, 1]); // => 0.590128656384365sampleSkewness([2, 4, 6, 3, 1], true); // => 0.3958703373438167