Stats chisquaredcontingencyresult equals - CyrilB1531/lodestar GitHub Wiki

Development build. This page describes main, not a released package. The latest published Lodestar.Stats is 0.5.0 — read its documentation.

Home › Stats › Hypothesis tests

ChiSquaredContingencyResult.Equals

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

public bool Equals(ChiSquaredContingencyResult 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;

ChiSquaredContingencyResult 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));
ChiSquaredContingencyResult 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 — ChiSquaredContingencyResult.GetHashCode, ChiSquaredContingencyResult.