org.statcato.statistics.inferential
Class CrossTabulation
- java.lang.Object
-
- org.statcato.statistics.inferential.CrossTabulation
-
public class CrossTabulation extends java.lang.ObjectCross tabulation and Chi-square test.- Since:
- 1.0
- See Also:
ContingencyTable
-
-
Constructor Summary
Constructors Constructor and Description CrossTabulation(int a, int b)Constructor, given the number of rows and columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddObservation(int i, int j, double frequency)Adds the given frequency to the location at row i and column j.voidcomputeChiSquare()Creates a contingency table object using the cross tabulation data.doublegetColumnSum(int j)Return the sum of the given column.doublegetColumnSumPercent(int i)Return the percent of the sum of the given column out of the total sum.ContingencyTablegetContingencyTable()Returns the contingency table.doublegetFrequency(int i, int j)Returns the frequency at row i and column j.doublegetPercent(int i, int j)Returns the percent at row i and column j.doublegetRowSum(int i)Return the sum of the given row.doublegetRowSumPercent(int i)Return the percent of the sum of the given row out of the total sum.doublegetTotalSum()Return the total sum.
-
-
-
Constructor Detail
-
CrossTabulation
public CrossTabulation(int a, int b)Constructor, given the number of rows and columns.- Parameters:
a- number of rowsb- number of columns
-
-
Method Detail
-
addObservation
public void addObservation(int i, int j, double frequency)Adds the given frequency to the location at row i and column j.- Parameters:
i- row indexj- column indexdata- double array
-
getFrequency
public double getFrequency(int i, int j)Returns the frequency at row i and column j.- Parameters:
i- row indexj- column index- Returns:
- frequency
-
getPercent
public double getPercent(int i, int j)Returns the percent at row i and column j.- Parameters:
i-j-- Returns:
- percent
-
getRowSum
public double getRowSum(int i)
Return the sum of the given row.- Parameters:
i- row index- Returns:
- row sum
-
getRowSumPercent
public double getRowSumPercent(int i)
Return the percent of the sum of the given row out of the total sum.- Parameters:
i- row index- Returns:
- row sum percent
-
getColumnSum
public double getColumnSum(int j)
Return the sum of the given column.- Parameters:
j- column index- Returns:
- column sum
-
getColumnSumPercent
public double getColumnSumPercent(int i)
Return the percent of the sum of the given column out of the total sum.- Parameters:
i- column index- Returns:
- column sum percent
-
getTotalSum
public double getTotalSum()
Return the total sum.- Returns:
- total sum
-
computeChiSquare
public void computeChiSquare()
Creates a contingency table object using the cross tabulation data.
-
getContingencyTable
public ContingencyTable getContingencyTable()
Returns the contingency table.- Returns:
- ContingencyTable object
-
-
DMelt 3.0 © DataMelt by jWork.ORG