Skip to main content

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.

Filter by
Sorted by
Tagged with
96 votes
2 answers
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'...
pmgjones's user avatar
  • 5,811
70 votes
2 answers
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 ...
hgcrpd's user avatar
  • 1,427
35 votes
5 answers
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 ...
pmgjones's user avatar
  • 5,811
33 votes
5 answers
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, ...
rnso's user avatar
  • 10.1k
21 votes
1 answer
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 ...
Antoni Parellada's user avatar
19 votes
3 answers
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 ...
Tom Wenseleers's user avatar
18 votes
2 answers
3k views

How to visualize 3D contingency matrix?

I have a data like this: ...
user avatar
18 votes
3 answers
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 ...
Tim's user avatar
  • 19.5k
18 votes
2 answers
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, ...
JVMcDonnell's user avatar
17 votes
1 answer
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 / ...
Taz's user avatar
  • 338
17 votes
2 answers
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 ...
Braj-Stat's user avatar
  • 621
15 votes
2 answers
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?
Israel's user avatar
  • 263
15 votes
1 answer
844 views

What is contingent in a contingency table?

The Merriam-Webster dictionary defines a contingent event or situation as ...
Zen's user avatar
  • 24.4k
15 votes
1 answer
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 ...
snape's user avatar
  • 309
14 votes
2 answers
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 ...
Aksakal's user avatar
  • 61.5k
13 votes
3 answers
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 ...
DrWho's user avatar
  • 939
13 votes
2 answers
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, ...
nico's user avatar
  • 4,601
13 votes
2 answers
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 ...
Ben's user avatar
  • 759
12 votes
2 answers
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 ...
Simone's user avatar
  • 7,118
12 votes
1 answer
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 ...
rnso's user avatar
  • 10.1k
12 votes
1 answer
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 ...
L Xandor's user avatar
  • 1,229
12 votes
3 answers
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 ...
oodkan's user avatar
  • 121
11 votes
2 answers
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 ...
Amit Lavon's user avatar
11 votes
1 answer
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 ...
rodrigorgs's user avatar
11 votes
2 answers
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 ...
TDN169's user avatar
  • 211
10 votes
4 answers
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 ...
Gert's user avatar
  • 213
10 votes
2 answers
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 ...
Membran's user avatar
  • 121
10 votes
1 answer
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 ...
user321627's user avatar
  • 4,626
9 votes
2 answers
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 ...
Mitch's user avatar
  • 1,987
9 votes
1 answer
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 ...
Mitch's user avatar
  • 1,987
9 votes
2 answers
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 ...
erdal's user avatar
  • 231
9 votes
2 answers
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 ...
user32378's user avatar
9 votes
2 answers
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, ...
wehnsdaefflae's user avatar
8 votes
2 answers
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 ...
Samuel Leal's user avatar
8 votes
2 answers
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. ...
jvc26's user avatar
  • 181
8 votes
2 answers
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 ...
mcihak's user avatar
  • 157
8 votes
3 answers
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. ...
Placidia's user avatar
  • 14.4k
8 votes
2 answers
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 ...
Qbik's user avatar
  • 1,717
8 votes
1 answer
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 ...
John K. Kruschke's user avatar
8 votes
1 answer
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 ...
Barry's user avatar
  • 81
8 votes
1 answer
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 ...
Sam's user avatar
  • 2,184
8 votes
0 answers
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 ...
Borna's user avatar
  • 81
7 votes
2 answers
5k views

How to determine significant associations in a mosaic plot?

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 $[...
Rya's user avatar
  • 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; ...
Markus Loecher's user avatar
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'...
wehnsdaefflae's user avatar
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 ...
user321627's user avatar
  • 4,626
7 votes
2 answers
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). ...
landroni's user avatar
  • 1,133
7 votes
2 answers
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?
Gerk's user avatar
  • 93
7 votes
1 answer
3k views

Overlapping sets (3) - significance test

Sorry if this appears to be a naive question! I have three overlapping sets and I want to find the probability of finding a larger/greater intersection for 'A intersect B intersect C' (in the example ...
user21891's user avatar
7 votes
1 answer
10k views

What is the difference between the 'Pivot table' and 'Contingency table'?

Is there any difference? Or they are basically the same? Just Excel users call it 'pivot table' and statistically-minded people call it 'contingency table'?
Bogaso's user avatar
  • 871

1
2 3 4 5
12