Cross-tabulations (“crosstab”, two-way tables, contingency tables) describe the relationship between two categorical variables. The categories of one variable determine the rows of the table, and the categories of the other variable determine the columns. The table cells contain the number of times a particular combination of categories occurs. The table's margins contain the total number of observations for that category.

  1. From the analysis window, click "+ New analysis" and choose "Crosstab" from the dropdown menu. 

  2. Select the data model in the "Parameters" card on the right side. Select the series of interest from the dropdown menu if you choose to analyse series data.

  3. Choose from the dropdown menu beneath "Rows", which categorical variable to display horizontally. 

  4. Choose from the dropdown menu beneath "Columns" which categorical variable to display vertically. 

  5. In the "Chart type" card, you can choose to display the results as

    • A table (“Table”)

    • A grouped barplot (“Grouped”)

    • A stacked barplot (“Stacked”)

    • A sunburst chart (“Sunburst”)

  6. Open the "Formatting" card on the right side to choose whether to use category values or labels, and whether to display chart legends on your figure. 

  7. You can apply filters to the dataset to analyse subgroups (optional).  

  8. Export your results (Optional) 

Fisher’s exact test

Fisher’s exact test is a non-parametric test for testing independence between two categorical variables. The null hypothesis is that the two variables are independent, and the p-value describes the probability of getting an outcome as different from or more different from the null hypothesis as the outcome you observed in your data. When the sample size is small, Fisher’s exact test should be preferred over the Chi-square test. Fisher’s exact test is only available for 2×2 tables.

  1. Activate the toggle switch left to "Fisher’s exact test" in the 'Parameters' card

  2. The p-value is shown beneath the crosstab

McNemar's test

McNemar's test is a non-parametric test for testing independence between paired categorical variables.  This test, as Fisher´s exact test, is only available for 2x2 tables.   

  1. Activate the toggle switch left to "McNemar's test" in the "Parameters" card

  2. The values (X2 and p)are shown beneath the crosstab 

Chi-square test

The chi-square test is a non-parametric test for testing independence between two categorical variables. Chi-square requires a larger data set than Fisher´s exact test (5 degrees of freedom). The Chi-square test can be applied to tables containing more values than 2.

  1. Activate the toggle switch left to "Chi-square test" in the "Parameters" card

  2. The values (X2 and p)are shown beneath the crosstab.