# 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 V2 Category 1 Category j … Category m2 Category 1 n(1,1) n(1,j) … n(1,m2) … … … … … Category i n(i,1) n(i,j) … n(i,m2) … … … … … Category m1 n(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.

Included in
{"ft_lang_label":"__label__en","ft_lang_prob":0.87608427,"math_prob":0.95839906,"size":1588,"snap":"2019-51-2020-05","text_gpt3_token_len":371,"char_repetition_ratio":0.1635101,"word_repetition_ratio":0.016129032,"special_character_ratio":0.23425692,"punctuation_ratio":0.094076656,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9773612,"pos_list":[0,1,2],"im_url_duplicate_count":[null,10,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-14T09:56:38Z\",\"WARC-Record-ID\":\"<urn:uuid:2296ccfb-4a22-43eb-b1df-b86947f2c51f>\",\"Content-Length\":\"31221\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1084f221-86a3-4ae1-8766-23ffb8d65729>\",\"WARC-Concurrent-To\":\"<urn:uuid:f05d94eb-0ec6-4a26-88f2-80b935a72c1c>\",\"WARC-IP-Address\":\"13.68.195.86\",\"WARC-Target-URI\":\"https://www.xlstat.com/en/solutions/features/create-contingency-tables\",\"WARC-Payload-Digest\":\"sha1:2OMZIY3PDOYAPACQ6G2TCJMRDJRRIA5W\",\"WARC-Block-Digest\":\"sha1:ODGI4ZXUR37JE2CMB4XNBRDNOXGBQFEA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540586560.45_warc_CC-MAIN-20191214094407-20191214122407-00336.warc.gz\"}"}