Questions tagged [contingency-tables]

Tables of counts (occasionally proportions of marginal counts), arranged by (at least) two marginal categories, displaying bivariate or multivariate frequencies. Sometimes called crosstabs.

Contingency tables are tables of counts (occasionally proportions of marginal counts), arranged by two or more marginal categories, displaying bivariate or multivariate frequencies.

Contingency tables are often associated with chi-square tests.

Contingency tables can be used in exploratory analysis or as a summary. When supplemented by additional information in each category combination besides the count or proportion (such as contribution to chi-square or Pearson residual, for example), these can become a valuable data analysis/diagnostic tool.

Contingency tables are sometimes called crosstabs.

Reference: Wikipedia - Contingency table

503 questions
91
votes
2 answers

Given the power of computers these days, is there ever a reason to do a chi-squared test rather than Fisher's exact test?

Given that software can do the Fisher's exact test calculation so easily nowadays, is there any circumstance where, theoretically or practically, the chi-squared test is actually preferable to Fisher's exact test? Advantages of the Fisher's exact…
pmgjones
  • 5,543
  • 8
  • 36
  • 36
60
votes
2 answers

What is the relationship between a chi squared test and test of equal proportions?

Suppose that I have three populations with four, mutually exclusive characteristics. I take random samples from each population and construct a crosstab or frequency table for the characteristics that I am measuring. Am I correct in saying…
hgcrpd
  • 1,307
  • 2
  • 11
  • 13
32
votes
5 answers

Fisher's Exact Test in contingency tables larger than 2x2

I was taught to only apply Fisher's Exact Test in contingency tables that were 2x2. Questions: Did Fisher himself ever envision this test to be used in tables larger than 2x2 (I am aware of the tale of him devising the test while trying to guess…
pmgjones
  • 5,543
  • 8
  • 36
  • 36
26
votes
4 answers

Which is the best visualization for contingency tables?

Which is best plot, from statistical standpoint, to show a contingency table, which is typically being analyzed by chi-square test? Is it a dodged barplot, stacked barplot, heatmap, contour plot, jitterred scatterplot, multiple lines plot or…
rnso
  • 8,893
  • 14
  • 50
  • 94
19
votes
3 answers

Analysis of Danish mask study data by Nassim Nicholas Taleb (binomial GLM with complete separation)

Recently, Nassim Nicholas Taleb made this post about the recent Danish mask study, a randomized controlled trial which concluded that the proportions of newly diagnosed coronavirus infections was not significantly different among the group with…
18
votes
2 answers

How to visualize 3D contingency matrix?

I have a data like this: > table(A,B,C) , , C = FALSE B A FALSE TRUE FALSE 177 42 TRUE 6 8 , , C = TRUE B A FALSE TRUE FALSE 5 31 TRUE 4 10 How can I plot this on a single graph,…
user88
18
votes
2 answers

Contingency tables: what tests to do and when?

I'd like to see an extension of this discussion of the age-old chi-sq vs. Fisher's exact test debate, broadening the scope a bit. There are many many tests for interactions in a contingency table, enough to make my head spin. I'm hoping to get an…
JVMcDonnell
  • 293
  • 2
  • 8
16
votes
2 answers

Applicability of chi-square test if many cells have frequencies less than 5

To find association between peer's support (independent variable) and work satisfaction (dependent variable) I wish to apply chi-square test. Peer's support is categories in four groups according to the extent of support: 1=very less extent, 2=to…
15
votes
3 answers

Relationship between the phi, Matthews and Pearson correlation coefficients

Are the phi and Matthews correlation coefficients the same concept? How are they related or equivalent to Pearson correlation coefficient for two binary variables? I assume the binary values are 0 and 1. The Pearson's correlation between two…
15
votes
1 answer

Which test for cross table analysis: Boschloo or Barnard?

I am analyzing a 2x2 table from a small dataset of 30 patients. We are retrospectively trying to find some variables that give a hint about which treatment to choose. The variables (obs normal / strange) and treatment decision (A/B) are of special…
14
votes
1 answer

What is contingent in a contingency table?

The Merriam-Webster dictionary defines a contingent event or situation as 1 : likely but not certain to happen : possible 2 : not logically necessary; especially : empirical 3 a : happening by chance or unforeseen causes b : subject to chance or…
Zen
  • 21,786
  • 3
  • 72
  • 114
14
votes
2 answers

Palantir's Asian discrimination case: how were the probabilities computed?

I read this article about Palantir's case where Deparment of Labor is accusing them in discrimination against Asians. Does anyone know where did they get these probability estimates from? I'm not getting 1/741 in item (a). (a) For the QA Engineer…
Aksakal
  • 55,939
  • 5
  • 90
  • 176
12
votes
2 answers

Statistical test for n x m contingency tables

I have a dataset made up of elements from three groups, let's call them G1, G2, and G3. I analysed certain characteristics of these elements and divided them into 3 types of "behaviour" T1, T2, and T3 (I used cluster analysis to do that). So, now I…
nico
  • 4,246
  • 3
  • 28
  • 42
12
votes
2 answers

Statistical test for positive and negative predictive value

I was reading through a paper and I saw a table with a comparison between PPV (Positive Predictive Value) and NPV (Negative Predictive Value). They did some kind of statistical test for them, this is a sketch of the table: PPV NPV p-value 65.9…
Simone
  • 6,513
  • 2
  • 26
  • 52
12
votes
1 answer

Fisher Test in R

Suppose we have the following data set: Men Women Dieting 10 30 Non-dieting 5 60 If I run the Fisher exact test in R then what does alternative = greater (or less) imply? For example: mat =…
1
2 3
33 34