org.statcato.statistics.inferential
Class ContingencyTable
- java.lang.Object
-
- org.statcato.statistics.inferential.ContingencyTable
-
public class ContingencyTable extends java.lang.ObjectA contingency table. Provides methods that perform computations relevant to a test of independence in a contingency table.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor and Description ContingencyTable(java.util.Vector<java.util.Vector<java.lang.Double>> table)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecriticalValue(double confidenceLevel)Returns the critical value corresponding to the given confidence level and degrees of freedom of the contingency table.intDOF()Returns the degrees of freedom of a contingency table.doublepValue()Returns the p-Value corresponding to the test statistic in a chi-square distribution.doubletestStatistics()Returns the test statistic for a test of independence between the row and column variable in the contingency table.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ContingencyTable
public ContingencyTable(java.util.Vector<java.util.Vector<java.lang.Double>> table)
Constructor. A vector of vector of Double representing the table of observed frequencies is provided. The row and column totals are calculated. The expected frequencies are also computed.- Parameters:
table- vector of vector of Double representing the table of observed frequencies
-
-
Method Detail
-
testStatistics
public double testStatistics()
Returns the test statistic for a test of independence between the row and column variable in the contingency table. chi^2 = Sum((O-E)^2 / E).- Returns:
- chi^2 test statistics
-
DOF
public int DOF()
Returns the degrees of freedom of a contingency table.- Returns:
- degrees of freedom
-
criticalValue
public double criticalValue(double confidenceLevel)
Returns the critical value corresponding to the given confidence level and degrees of freedom of the contingency table.- Returns:
- critical value
-
pValue
public double pValue()
Returns the p-Value corresponding to the test statistic in a chi-square distribution.- Returns:
- p-value
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG