Stats 0.5.0 chi2contingencyresult equals - CyrilB1531/lodestar GitHub Wiki

Lodestar.Stats 0.5.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Home › Hypothesis tests

Chi2ContingencyResult.Equals

Compares the scalars and the expected table, row by row.

public bool Equals(Chi2ContingencyResult other)

Parameters — other is the result to compare against, or null.

Returns — true when the statistic, p-value and degrees of freedom match and both expected tables hold the same frequencies.

Example — the same result, reached twice.

using Lodestar.Stats;

Chi2ContingencyResult left = new(1.5, 0.2, 1, [1.0, 2.0], [3.0, 4.0](/CyrilB1531/lodestar/wiki/1.0,-2.0],-[3.0,-4.0));
Chi2ContingencyResult right = new(1.5, 0.2, 1, [1.0, 2.0], [3.0, 4.0](/CyrilB1531/lodestar/wiki/1.0,-2.0],-[3.0,-4.0));

bool same = left == right;  // => True

Remarks — the comparison descends into each row rather than stopping at the row count, which is what a table differing inside one row needs. the equality rule has the rule.

Applies to — net10.0, netstandard2.0.

See also — Chi2ContingencyResult.GetHashCode, Chi2ContingencyResult.