# 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.

585 questions
Filter by
Sorted by
Tagged with
12k views

### 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'...
• 5,811
87k views

### 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 ...
• 1,427
87k views

### 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 ...
• 5,811
38k views

### 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, ...
• 10.1k
5k views

### At What Level is a $\chi^2$ test Mathematically Identical to a $z$-test of Proportions?

BACKGROUND: Skip safely - it's here for reference, and to legitimize the question. The opening of this paper reads: "Karl Pearson’s famous chi-square contingency test is derived from another ...
• 26.4k
1k views

### 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 ...
• 3,210
3k views

### How to visualize 3D contingency matrix?

I have a data like this: ...
10k views

### 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 ...
• 19.5k
5k views

### 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, ...
• 293
5k views

### 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 / ...
• 338
10k views

### 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 ...
• 621
17k views

### Alternatives for chi-squared test for independence for tables more than 2 x 2

What are some alternatives to the chi-squared test for categorical variables with tables larger than 2 x 2 and cells with a count less than 5, if I don't want to merge classes?
• 263
844 views

### What is contingent in a contingency table?

The Merriam-Webster dictionary defines a contingent event or situation as ...
• 24.4k
19k views

### 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 ...
• 309
561 views

### 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 ...
• 61.5k
32k views

### How should you handle cell values equal to zero in a contingency table?

How should you deal with a cell value in a contingency table that is equal to zero in statistical calculations? (Note that such a value can be structural, i.e., it must be zero by definition, or ...
• 939
7k views

### 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, ...
• 4,601
2k views

### Bayesian analysis of contingency tables: How to describe effect size

I'm working through the examples in Kruschke's Doing Bayesian Data Analysis, specifically the Poisson exponential ANOVA in ch. 22, which he presents as an alternative to frequentist chi-square tests ...
• 759
10k views

### 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 ...
• 7,118
13k views

### How to interpret the residual colors on a mosaic plot?

This is a mosaic plot of contingency table dataset HairEyeColor described here. How do I interpret the colors representing residuals? What is the difference ...
• 10.1k
16k views

### Logistic regression vs chi-square in a 2x2 and Ix2 (single factor - binary response) contingency tables?

I'm trying to understand the use of logistic regression in 2x2 and Ix2 contingency tables. For instance, using this as an example What is the difference between using chi-square test and using ...
• 1,229
11k views

### G-test vs Pearson's $\chi^2$ test

I'm testing independence in an $N \times M$ contingency table. I don't know whether the G-test or Pearson's $\chi^2$ test is better. The sample size is in the hundreds but there are some low cell ...
• 121
4k views

### What distribution does Fisher's exact test assume?

In my work I have seen several uses of Fisher's exact test, and I was wondering how well it fits my data. Looking at several sources I understood how to calculate the statistic, but never saw a clear ...
• 113
23k views

### How to interpret Cochran-Mantel-Haenszel test?

I'm testing the independence of two variables, A and B, stratified by C. A and B are binary variables and C is categorical (5 values). Running Fisher's exact test for A and B (all strata combined), I ...
• 213
253 views

### Enrichment analysis by gene duplication level

Biological Background Over time, some plant species tend to duplicate their entire genomes, gaining an additional copy of each gene. Due to the instability of this setup, many of these genes are then ...
• 211
7k views

### Fisher exact test on paired data

Given $40$ cases with lung cancer and $40$ matched controls (without lung cancer) (matching based on age, sex, etc.). To try to find evidence between the effect of smoking on lung cancer, I used ...
• 213
5k views

### Chi-square test for equality of distributions: how many zeroes does it tolerate?

I am comparing two groups of mutants each of which can have only one out of 21 different phenotypes. I would like to see whether distribution of these outcomes is similar between two groups. I found ...
• 121
8k views

### What is the difference using a Fisher's Exact Test vs. a Logistic Regression for $2 \times 2$ tables?

For a $2 \times 2$ table, two ways to do inference on the table is through Fisher's Exact Test and also a Logistic Regression. I was told that using a Fisher's Exact Test, we are only interested in ...
• 4,626
2k views

### Does Simpson's Paradox cover all instances of reversal from a hidden variable?

The following is a question about the many visualizations offered as 'proof by picture' of the existence of Simpson's paradox, and possibly a question about terminology. Simpson's Paradox is a fairly ...
• 1,987
12k views

### How do you compute confidence intervals for positive predictive value?

How do you compute confidence intervals for positive predictive value? The standard error is: $$SE = \sqrt{ \frac{PPV(1-PPV)}{TP+FP}}$$ Is that right? (here my concern is the denominator) Does ...
• 1,987
28k views

### What to do when I have expected count <5 warning for a chi squared test?

I applied a survey consisting of 12 questions to 120 people and each questions include 4 nominal categories; I want to make comparison of people's answers according to their socio-demographic ...
• 231
5k views

### Correlation among categories between categorical nominal variables

I have a data set with two categorical nominal variables (both with 5 categories). I would like to know if (and how) I am able to identify potential correlations between the categories from these two ...
612 views

### Cramer's $\phi$ for three-way contingency tables

Can Cramer's $\phi$ be determined for three-way contingency tables? I know how to calculate the expected values, chi squared, and how Cramer's $\phi$ works with two-way contingency tables. However, ...
531 views

### Infinite upper confidence interval using Fisher exact test in R

I am having trouble interpreting the upper confidence interval for the odds ratio (OR) after executing Fisher's exact test in R. I have the following contingency table which contains the response ...
3k views

### Is the chi-squared test appropriate with many small counts in a 5x2 table?

I have two sample populations, A, and B, which are independent. ...
• 181
3k views

### Testing equality of two binomial proportions proportion (one near 100 %)

I am testing equality of two binomial proportions 87/88 and 48/60. I use this online calculator and it noted that the Standard Normal approximation is not valid in this case. It seem quite strange to ...
• 157
1k views

### Matched binomial pairs

I am trying to analyse the following table: 5 5 5 5 4 5 5 5 5 3 4 3 3 4 4 3 5 5 Each number is a success score out of 5 attempts, so we can assume binomial (p, 5), for unknown p. ...
• 14.4k
2k views

### How to incorporate costs (into logit model) of false positive, false negative, true positive, true negative if they are different costs?

How to incorporate costs (into logit model) of false positive, false negative, true positive, true negative responses, if they are different costs ? Is it possible to do that on the level of ...
• 1,717
758 views

### How to express cells of a 2x2 table in terms of phi coefficient and marginal probabilities

Consider a typical 2x2 table of frequencies (shown in this image): Notation: The row variable is denoted R and takes on values 0 or 1; the column variable is denoted C and takes on values 0 or 1. The ...
• 2,371
93 views

### Alternative to chi-square where independence assumption is broken

I have a data set where n participants were asked to give a yes or no response to of 12 different (and distinct) stimuli. Each stimulus fits into 1 of 3 categories and an item for each category ...
• 81
680 views

### Comparison of frequency tables over time

I have an experiment in which students are asked to solve a maze under two groups (TRT v. Ctrl) over 10 different trials. In each trial, students can try 3 times to solve the maze. If they solve it in ...
• 2,184
3k views

### How do I perform a follow up on a chi-squared table 3x3 or larger?

On a 3x2, like in this example, I could perform an additional follow up chi-squared to test differences between only two groups I'm interested in (e.g. between vaccinated a year before and just before ...
• 81
5k views

I have a common question on how to explain significant association between categorical variables in mosaic plot. For example,in this plot,based on Pearson residuals, can we say that $[2.0, 5.1]$ and $[... • 191 7 votes 4 answers 2k views ### Chi square statistic and contingency coefficients I need some advice on explaining$\chi^2$as a contingency measure from a pedagogical perspective. I usually introduce the individual terms in the$\chi^2$sum as scaled deviations from independence; ... • 1,008 7 votes 2 answers 5k views ###$\chi^2 $of multidimensional data I want to test if two observations of nominal data accord to the same distribution. I am using the chi squared statistics to perform a chi squared homogeneity test and normalize the result with Cramer'... 7 votes 3 answers 730 views ### Does Fisher's Exact test for a$2\times 2\$ table use the Non-central Hypergeometric or the Hypergeometric distribution?

In doing a Fisher's exact test, on wikipedia it states that the p-value is calculated as the sum of the probabilities of tables having probability less than or equal to the probability of the observed ...
• 4,626
3k views

### How to interpret a two-dimensional contingency table?

I am trying to understand how to interpret log-linear models for contingency tables, fitted by way of Poisson GLMs. Consider this example from CAR (Fox and Weisberg, 2011, p. 252). ...
• 1,133
942 views

### How to simulate effectiveness of treatment in R?

Let's say I want to write a simulation for the table below to decide if Xylitol treatment and ear infections are independent. How would I go about doing this?
• 93