ContingencyTable Class

Represents a table that cross-tabulates totals from two categorical variables.

Definition

Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public class ContingencyTable
Inheritance
Object  →  ContingencyTable

Remarks

Use the ContingencyTable class to represent a 2x2 or RxC contingency table and make inferences about the relative frequencies of the tabulated data.

Individual cells are indexed through the indexed Item[Object, Object] property.

Once the Compute() method is called, various properties are available, including the Chi-square value, the coefficient of contingency, and the Cramer V.

Constructors

ContingencyTable(Matrix<Double>) Constructs a new contingency table object from counts stored in a matrix.
ContingencyTable(ICategoricalVector, ICategoricalVector) Constructs a new contingency table for the specified variables.
ContingencyTable(ICategoricalVector, ICategoricalVector, Vector<Double>) Constructs a new contingency table for the specified variables.
ContingencyTable(Matrix<Double>, IIndex, IIndex) Constructs a new contingency table object from counts stored in a matrix.

Properties

ChiSquare Returns the chi-square value for the contingency table.
CoefficientOfContingency Returns the coefficient of contingency of the contingency table.
ColumnCount Gets the number of columns in the contingency table.
ColumnScale Gets the categorical scale that contains the categories corresponding to the columns in the contingency table.
CramerV Returns the Cramer V statistic for the contingency table.
Item[Int32, Int32] Gets the cell at the specified position in the contingency table.
Item[Object, Object] Gets the cell for the specified values of the categories in the contingency table.
Phi Returns the Phi coefficient for the contingency table.
RowCount Gets the number of rows in the contingency table.
RowScale Gets the categorical scale that contains the categories corresponding to the rows in the contingency table.
TotalCount Gets the total of all counts in the contingency table.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetChiSquareTest Returns the Chi-Square test for the contingency table.
GetFisherExactProbability(Boolean, Double) Gets the probability of Fisher's exact test for the contingency table.
GetFisherExactProbability(HypothesisType, Boolean) Gets the probability of Fisher's exact test for the contingency table.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetLikelihoodRatioTest Returns the likelihood ratio test for the contingency table.
GetMantelHaenszelTest Returns the Mantel-Haenszel Chi-Square test for the contingency table.
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetYatesCorrectedChiSquareTest Returns the Yates-corrected Chi-Square test for the contingency table.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also