This is documentation for an old release of SciPy (version 0.10.0). Read this page in the documentation of the latest stable release (version 1.15.1).
Compute the expected frequencies from a contingency table.
Given an n-dimensional contingency table of observed frequencies, compute the expected frequencies for the table based on the marginal sums under the assumption that the groups associated with each dimension are independent.
Parameters : | observed : array_like
|
---|---|
Returns : | expected : ndarray of type numpy.float64, same shape as observed.
|
Examples
>>> observed = np.array([[10, 10, 20],[20, 20, 20]])
>>> expected_freq(observed)
array([[ 12., 12., 16.],
[ 18., 18., 24.]])