IDAX.CHISQ_TEST - Pearson's chi-square test of independence
The CHISQ_TEST stored procedure calculates the chi-square value between the two input columns and returns the probability that the two columns are independent.
Syntax
IDAX.CHISQ_TEST(in parameter_string varchar(32672))
Parameter descriptions
- parameter_string
- Mandatory one-string parameter that contains pairs of <parameter>=<value> entries that are separated by a comma.
Returned information
What is returned depends on whether the outtable parameter is specified:
- If it is, the number of rows in the output table is returned.
- If it is not, the content of the output table as a result set is returned.
In addition to the chi-square statistics, this function returns the degree of freedom of the input variables and a percentage between 0 and 1. If the percentage is in the range:
- 0 - 0.05, there is a very high probability that the input columns are mutually independent.
- 0.05 - 0.95, the input columns are treated as mutually independent although this is uncertain.
- 0.95 - 1, there is a very high probability that the input columns are mutually dependent.
Example
CALL IDAX.CHISQ_TEST('intable=CENSUSINCOME,incolumn=education;gender');
CALL IDAX.CHISQ_TEST('intable=CENSUSINCOME,incolumn=education;gender, by=marital_status, outtable=CHISQ_TEST_RESULT');