Class: Stats

nyc/Stats~ Stats


new Stats(data)

A class to simple statistics and classifications for choropleth maps

Parameters:
Name Type Description
data Array.<number>

The data on which to perfom statisitcal operations

Source:

Members


<static, constant> METHODS :Object

The available methods for generating intervals for a dataset

Type:
  • Object
Source:

Methods


ckmeansClasses(numClasses)

Get ckmeans clustered intervals from the data

Parameters:
Name Type Description
numClasses number

The number of classes

Source:
Returns:

An Array of numbers starting with the minimum value and incemented to the maximum value by ckmeans clustered intevrals

Type
Array.<number>

equalIntervalClasses(numClasses)

Get equal intervals from the data

Parameters:
Name Type Description
numClasses number

The number of classes

Source:
Returns:

An Array of numbers starting with the minimum value and incemented to the maximum value by equal intevrals

Type
Array.<number>

max()

Get the maximum value from the data

Source:
Returns:

The maximum value from the data

Type
number

mean()

Get the mean value from the data

Source:
Returns:

The mean value from the data

Type
number

median()

Get the median value from the data

Source:
Returns:

The median value from the data

Type
number

min()

Get the minimum value from the data

Source:
Returns:

The minimum value from the data

Type
number

std()

Get the standard deviation of the data

Source:
Returns:

The standard deviation of the data

Type
number

stdClasses(numClasses)

Get standard deviation intervals from the data

Parameters:
Name Type Description
numClasses number

The number of classes (3, 5 or 7 only)

Source:
Returns:

An Array of numbers centered around the mean and distributed to the left and right by the standard deviation of the data

Type
Array.<number>