dask.array.stats.chisquare

dask.array.stats.chisquare

dask.array.stats.chisquare(f_obs, f_exp=None, ddof=0, axis=0)[source]

Calculate a one-way chi-square test.

Please see the docstring for scipy.stats.chisquare() for complete information including notes, references, and examples.

Some inconsistencies with the Dask version may exist.

The chi-square test tests the null hypothesis that the categorical data has the given frequencies.

Parameters
f_obsarray_like

Observed frequencies in each category.

f_exparray_like, optional

Expected frequencies in each category. By default the categories are assumed to be equally likely.

ddofint, optional

“Delta degrees of freedom”: adjustment to the degrees of freedom for the p-value. The p-value is computed using a chi-squared distribution with k - 1 - ddof degrees of freedom, where k is the number of observed frequencies. The default value of ddof is 0.

axisint or None, optional

The axis of the broadcast result of f_obs and f_exp along which to apply the test. If axis is None, all values in f_obs are treated as a single data set. Default is 0.

Returns
res: Delayed Power_divergenceResult

An object containing attributes:

chisqfloat or ndarray

The chi-squared test statistic. The value is a float if axis is None or f_obs and f_exp are 1-D.

pvaluefloat or ndarray

The p-value of the test. The value is a float if ddof and the return value chisq are scalars.