Desktop User Guides > Professional > Table scripting > Statistical tests > Cell chi-square test > Example of the cell chi-square test
 
Example of the cell chi-square test
Sample script file: CellChiSquareTests.mrs
This example script is based on the Museum sample data set. See Running the sample table scripts for information on running the example scripts.
The cell chi-square test in this example tests whether there are any particular cells that contribute significantly to any association between respondents' expectations of their visit to the museum and their age.
The script adds the test to the table as follows:
TableDoc.Table1.Statistics.Add("CellChiSquare")
This graphic is described in the surrounding text.
When a cell chi-square test is requested, UNICOM Intelligence Professional creates a cell item position for it, in the same way that it does for the results of the column proportions and column means tests. This cell item is created as the last item, or the last item before the column proportions/column means item (when both statistics requested on the table).
Significance symbols
The cell chi-square test produces a result for each table cell. The result is one of three possibilities:
> — The cell value is significantly larger than expected
< — The cell value is significantly smaller than expected
The cell value is not significant (no symbol)
By default, the cell chi-square cell item position contains the symbols indicating significance. The default symbols are < and >. Alternatively, you can specify the strings. For example:
Tab.Statistics["CellChiSquare"].AboveExpected = ">>"
Tab.Statistics["CellChiSquare"].BelowExpected = "<<"
If chi-square values are also requested, these are displayed in the cell chi-square cell item position with the symbols to the right of value. For any cell that has the Yates' small sample correction applied, (y) is displayed to the right of the chi-square or p value, with the significance symbol to the right.
The option to display values is also specified on the cell chi-square statistic:
Tab.Statistics["CellChiSquare"].Values = X
where X is None (the default), ChiSquare or PValue.
The default decimal places are two for ChiSquare and six for PValue. This can be changed by specifying:
Tab.Statistics["CellChiSquare"].Decimals = N
See also
Cell chi-square test