1.1.7 • Published 8 years ago

gini v1.1.7

Weekly downloads
17
License
MIT
Repository
github
Last release
8 years ago

gini NPM version Build status

Calculate the Gini coefficient of a data set.

Installation

Install the package with NPM:

$ npm install -g gini

The -g flag is recommended for easy CLI usage, but completely optional.

API

For data sets that are already ordered ascendingly, use the faster ordered function:

var gini = require("gini");
var data = [0, 2, 3, 8, 9, 13, 14, 23, 49, 57];
var result = gini.ordered(data);
console.log(result); // = 0.5415730337078651

For data sets that are not already ordered ascendingly, use the slower unordered function:

var gini = require("gini");
var data = [0, 14, 2, 9, 3, 8, 13, 23, 57, 49];
var result = gini.unordered(data);
console.log(result); // = 0.5415730337078651

See here for more information about the two different methods of calculation.

CLI

Run gini from the command line, with a list of numbers provided as input arguments:

$ gini 0 14 2 9 3 8 13 23 57 49
1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago