Create contingency tables

Contingency tables are a way to visualize the relationship between two qualitative variables. Create them in Excel using the XLSTAT add-on software.

What is a contingency table

A contingency table is an efficient way to summarize the relation (or correspondence) between two categorical variables V1 and V2. It has the following structure:

V1 V2Category 1Category jCategory m2
Category 1n(1,1)n(1,j)n(1,m2)
Category in(i,1)n(i,j)n(i,m2)
Category m1n(m1,1)n(m1,j)n(m1,m2)

where n(i,j) is the frequency of observations that show both characteristic i for variable V1, and characteristic j for variable V2.

XLSTAT tool for creating contingency table

From two or more qualitative variables, XLSTAT enables you to create instantly contingency tables summarizing the structure of the dataset. Some tests are available to describe the distribution within the contingency table.

XLSTAT tests on contingency tables

XLSTAT provides you with two criteria to characterize the relationship between the two variables:

  • The Chi-square distance has been suggested to measure the distance between two categories. The Pearson chi-square statistic, which is the sum of the Chi-square distances, is used to test the independence between rows and columns.
  • Inertia is a measure inspired from physics that is often used in Correspondence Analysis, a method that is used to analyse in depth contingency tables. The inertia of a set of points is the weighted mean of the squared distances to the center of gravity.