Advanced tables and statistics > Descriptive statistics > Chi-squared tests > Two-dimensional chi-squared test
 
Two-dimensional chi-squared test
Quick reference
To request a two-dimensional chi-squared test, type:
stat=chi2
on the tab statement.
More information
The two-dimensional chi-squared test statistic is a table-level statistic which produces an overall chi-squared value for the table. It can be used to test for any association between the axes which form the table. For example, you might use it to see whether political opinions vary according to age.
To request a two-dimensional chi-squared test, place a stat=chi2 option on the tab statement. The first element in each axis must be a base element. Other base elements may be present, but are ignored. There must be at least two basic count elements in each axis.
When producing tables with this statistic, remember that:
If there is no association — that is, the figures in each column (and, equivalently, in each row) are distributed in the same proportions — the chi-squared value is zero. This would indicate, for example, that political opinions do not vary according to age.
Elements in which all cells are zero are ignored by this statistic. You can suppress them with the option nz.
The elements in each axis must be mutually exclusive.
Chi-squared tests might give misleading results when cell counts are small (less than 10) or when there are both row and column bases which are small compared to the overall base.
The statistic is calculated using the sum of totalizable (basic count) rows, the sum of totalizable columns and the sum of all totalizable cells rather than the row base, column base and table base.
You might use a two-dimensional chi-squared test when you want to use the results of a survey of political habits to test whether there is an association between voting patterns and region.
Example
The Quantum program:
tab region party;stat=chi2
ttlQ3: Which party did you vote for?
ttlBase: All voters
l region
col 110;Base;North;South;East;West
l party
col 126;Base;Labour;Conservative;Liberal/SDP
g       Base   Labour   Conserv-   Liberal/
g                          ative        SDP
p          x        x          x          x
produces:
Q3: Which party did you vote for?
Base: All voters

Base Labour Conserv- Liberal/
ative SDP

Base 605 168 229 208
North 145 43 65 37
South 194 51 73 70
East 129 35 42 52
West 137 39 49 59

CHI SQUARED VALUE = 8.233

SIGNIFICANCE LEVEL = 0.222
The results show a significance level of 22.2%. You can be 77.8% confident that there is a degree of association between region and voting preference.
See also
Chi-squared tests