Package smile.stat
Interface Hypothesis.chisq
 Enclosing interface:
Hypothesis
public static interface Hypothesis.chisq
Chisquare test.

Method Summary
Modifier and TypeMethodDescriptionstatic ChiSqTest
test
(int[][] table) Given a twodimensional contingency table in the form of an array of integers, returns Chisquare test for independence.static ChiSqTest
test
(int[] bins, double[] prob) Onesample chisq test.static ChiSqTest
test
(int[] bins, double[] prob, int constraints) Onesample chisq test.static ChiSqTest
test
(int[] bins1, int[] bins2) Twosample chisq test.static ChiSqTest
test
(int[] bins1, int[] bins2, int constraints) Twosample chisq test.

Method Details

test
Onesample chisq test. Given the array bins containing the observed numbers of events, and an array prob containing the expected probabilities of events, and given one constraint, a small value of pvalue indicates a significant difference between the distributions. Parameters:
bins
 the observed number of events.prob
 the expected probabilities of events. Returns:
 the test results.

test
Onesample chisq test. Given the array bins containing the observed numbers of events, and an array prob containing the expected probabilities of events, and given the number of constraints (normally one), a small value of pvalue indicates a significant difference between the distributions. Parameters:
bins
 the observed number of events.prob
 the expected probabilities of events.constraints
 the constraints on the degree of freedom. Returns:
 the test results.

test
Twosample chisq test. Given the arrays bins1 and bins2, containing two sets of binned data, and given one constraint, a small value of pvalue indicates a significant difference between the distributions. Parameters:
bins1
 the observed number of events in first sample.bins2
 the observed number of events in second sample. Returns:
 the test results.

test
Twosample chisq test. Given the arrays bins1 and bins2, containing two sets of binned data, and given the number of constraints (normally one), a small value of pvalue indicates a significant difference between the distributions. Parameters:
bins1
 the observed number of events in first sample.bins2
 the observed number of events in second sample.constraints
 the constraints on the degree of freedom. Returns:
 the test results.

test
Given a twodimensional contingency table in the form of an array of integers, returns Chisquare test for independence. The rows of contingency table are labels by the values of one nominal variable, the columns are labels by the values of the other nominal variable, and whose entries are nonnegative integers giving the number of observed events for each combination of row and column. Continuity correction will be applied when computing the test statistic for 2x2 tables: one half is subtracted from all OE differences. The correlation coefficient is calculated as Cramer's V. Parameters:
table
 the contingency table. Returns:
 the test results.
