Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "stats/chi2gof/docs/types/index.d"

Index

Interfaces

Functions

Functions

Export assignment chi2gof

  • Performs a chi-square goodness-of-fit test.

    throws

    first argument must be an array-like object or a 1-dimensional array containing nonnegative integers

    throws

    second argument must be either an array-like object (or a 1-dimensional array) of nonnegative numbers, an array-like object (or a 1-dimensional array) of probabilities summing to one, or a discrete probability distribution name

    throws

    must provide valid options

    throws

    first and second arguments must have the same length

    throws

    first argument must contain at least one element greater than zero

    Parameters

    • x: NumericArray | ndarray

      observation frequencies

    • y: NumericArray | ndarray | string

      expected frequencies or a discrete probability distribution name

    • Rest ...args: Array<number | Options>

      probability mass function (PMF) arguments followed by an optional options object

    Returns Results

    test results

    Example

    var x = [ 89, 37, 30, 28, 2 ];
    var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];
    
    var out = chi2gof( x, p );
    
    var o = out.toJSON();
    // returns { 'pValue': ~0.0406, 'statistic': ~9.9901, ... }