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

198 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
407 views

### Pooled variance for post hoc tests for contingency table $\chi^{2}$ tests

The 2-by-2 contingency table test provides an alternate hypothesis testing approach to the $z$ test for proportion difference. Conveniently enough, a 2-by-k contingency table test provides an omnibus ...
• 30.1k
46 views

### Proper name for the variant of Haldane estimator for handling empty cell in a 2xn contingency table

I am using R and survey package to analyse a survey that several 2xn contingency tables need to be analysed using Chi square ...
• 3,229
700 views

### Is it invalid to conduct post-hoc analysis on a contingency table when an initial chi-squared test shows no significant evidence against independence?

I'm working on a tool to automatically analyze survey results. The tool builds contingency tables and conducts statistical tests on them. When the questions have categorical (nominal) answer choices (...
• 176
866 views

### Effect size measure for mxn Fisher Exact Test

I'm using the R function to run fisher exact test for mxn contingency tables (since my sample size <5; limitation of the chi-squared test). Along with the p-value I want to state the effect size. ...
• 508
572 views

### Does N-1 correction for Pearson's Chi-Square apply to r x c tables generally?

Campbell (2007) recommended what he called the "N-1" correction for chi-square tests performed on two-by-two contingency tables. He described the correction as: "the K. Pearson chi-squared test but ...
194 views

### An appropriate alternative to chi2 for paired, categorical data (tables larger than 2X2)

I am analysing a data set consisting mostly of categorical data. This has resulted in a number of contingency tables (mostly, but not always larger than 2X2) that need statistical testing. Now, I ...
• 41
884 views

### chi-squared test vs fisher's test vs ... => highly unbalanced length frequency data

I would like to statistically verify if two distributions are identical. Basically, the first distribution is a length frequency distribution from a large population ("population"). The second is the ...
• 175
753 views

### 2x2 contingency table - maximum likelihood estimate of the odds ratio and exact confidence intervals

I have two questions regarding the following 2x2 contingency table: 1, How can I derive the maximum likelihood estimate of the odds ratio ($OR = (a*d)/(c*b)$) 2, How can I derive exact confidence ...
39 views

### Statistical significance for difference in mean proportions when comparing groups

I may not have described my problem precisely, but I hope I can illustrate it with the following example. Suppose that I have $m$ contingency tables: Col 1 Col 2 Total Row 1 $a_i$ $b_i$ $a_i+b_i$ ...
• 131
380 views

### The asymptotic distribution of a Pearson Chi-Square test statistic (test for independence)

There are many different Pearson Chi-Square tests. The test statistics are always a sum of scaled and squared deviations. Some are written as a single sum, and some are written as a double sum (the ...
• 20.8k
250 views

### Alternatives to logistic regression if there are zero counts

I have three variables (let's call them $A$, class (both binary) and age (numerical)), and I want to test if there is a difference in the presence of A between the two classes, with age as a potential ...
• 368
48 views

### Analysis of contingency table with ordinal outcome?

What statistical test do I apply in following 2 situations: ...
• 10.1k
74 views

### Is there any anova-like approach for calculating contingency tables across multiple levels within a factor

I want to compare success rates across a large number of different levels within a third factor to detect if there are statistically significant differences for at least one of the groups. I'm not ...
• 153
124 views

### Probability of a contingency table with given marginals

In Fisher's exact test we consider all contingency tables $(n_{ij})_{i,j=0,1}$ consistent with given marginals $(n_{0.},n_{1.},n_{.0},n_{.1})$, where $\sum_i n_{i.}=\sum_j n_{.j}=N$. Each table has ...
• 421
1k views

### Using chi-squared or Fisher's exact with replicates

I want to compare proportion data (sex ratio) between two treatments. There are 19 populations for each treatment (i.e., 19 replicates). The specifics of the data is that it is the proportion of ...
• 51
2k views

### Chi-square test vs. McNemar's test - which test is right for this highly usual situation?

Here is, I would assume, a fairly common situation: I would like to know which test to use to assess whether the tendency to answer "Yes" on question 1 of a questionnaire is associated with ...
565 views

### Pearson's chi-squared test assumption: independence of observations

I am unsure of how to establish (or interpret) the independence condition of the chi-squared test in (for instance) the following situation. Consider this 2x2 contingency table representing the ...
• 141
46 views

### How to rebuild a master table from derived, filtered tables?

Disclaimer: I'm a developer, so please forgive-me if I'm not aware of math and statistics terminology. Once upon a time there was a master table with this layout: ...
• 131
356 views

### Chi square test in a contigency table with sampling zeroes

im trying to estimate if an association exists between two variables in a 7x5 contingency table (the type of prosthesis with the type of complication). The table contains a lot of sampling zeroes and ...
• 41
2k views

### Contingency tables, Chi-Squared analysis and next steps in R

I'm hoping one of the more experienced R programmers/statisticians out there can help me with something, or explain why what I'm trying to do is stupid :-) In the past, I've done analysis of survey ...
686 views

### Association between a categorical and binary variable

I have a set of patients that I split into two parts using some obscure algorithm (doesn't matter how): let the $X$ take on values $A$ and $B$. Each patient belongs to exactly one of 5 disease ...
• 340
409 views

### Is a g-test appropriate for count data?

I am analyzing an forest ecology experiment where we counted the number of trees in 5 pairs of plots in a forest. One member of each pair was fenced several years ago to exclude deer (exclusion ...
• 2,163
35 views

### Am I using the appropriate statistical comparison tests & applying them correctly to my qualitative coded data?

I am trying to determine if I am using the correct statistical tests in making comparisons & finding out if there are any statistically significant shifts of student attitudes. I have three open ...
30 views

### Testing for Association in RxC Contingency Tables with 1 Ordinal Variable

I'm currently trying to analyze data similar to the following example: Suppose I have count data from a survey of US States (~10) relating to their population's feelings about how their current state ...
81 views

### What method should I use if I want to estimate proportions in a 2xc contingency table (where c >2)?

This is a theoretical question, but it's been in the back of my head for a while now. Let's say I have two groups A and B, and I already know that they differ relative to their distribution on a ...
• 57
104 views

### How to test if watching a advertisement only 1 time is enough to change one's preference

I'm sort of having a trouble finding what statistical test to use in a specific project of mine. My experiment was as follows: I have 10 friends and they all prefer Coke cola then Pepsi. Each of them ...
81 views

### 2x2 contingency table, $d$ statistic?

I am reading The Fluctuating Female Vote: Politics, Religion, and the Ovulatory Cycle. (It shows up in several of Gelman's papers as an example of how not to do statistics.) Among the reported ...
• 806
321 views

### Boschloo or Barnard? In which case?

For 2x2 contingency tables, my understanding is that Boschloo and Barnard both have uniformly more power than Fisher's exact test (even if all marginals are fixed??). But I am still confused about the ...
• 41
419 views

### How to assess if a distribution has significantly changed over time

I'm studying the incidence of different types of influenza in a country over several years. In particular, for years from 2015 to 2020 I know the relative abundance of 3 types of influenza (% of ...
830 views

### How to correct zero cell counts for odds ratio calculations when variable has >2 categories

I am trying to calculate odds ratios for several univariate models with a binomial outcome. The problem is, for some of my variables, I have at least 1 zero count cell. It seems that the Haldane ...
• 21
1k views

### What is the difference between the so-called confusion matrix and contingency table? Are they the same?

I would like to understand the difference between the confusion matrix and contingency table in the context of classification (Machine Learning). It seems that different sources use their names for ...
• 1,460
109 views

### Obtaining measures of effect for contingency tables with multiply imputed data

The epi.2by2 function in the epiR package computes a chi-square test and provides measures of effect when count data are ...
• 125
128 views

### should the product of 2 independent binomials converge to a normal distribution for large sample sizes?

I have been studying 2x2 contingency tables and specifically I have been looking at situations where the marginals are fixed by design for one categorical variable. As an example, suppose a ...
• 135
48 views

### Mutations in known DNA sequence: which test to use?

I am analysing a double knockout (mouse), and trying to see whether restoring one or another of the genes it's missing affects specific positions preferentially in a third gene. The data* looks ...
• 43
541 views

### Barnard's Exact Test (Boschloo's variant) when distribution is hypergeometric

Let's say, we have a standard $2 \times 2$ contingency table and because of low sample size we're about to use some type of Exact Test, e.g. Fisher's Exact Test (FET) or Barnard's Exact Test. It's ...
• 1,134
1k views

### Calculating degrees of freedom for a contingency table with interactions

Below is a contingency table with residual deviance given by a Poisson regression model with a log-link. I have searched online and I believe that for the mutually exclusive model ...
• 1,261
414 views

### Measure dependence of categorical and ordinal variable

My purpose: When trying to find out which variables of a generic questionnaire data set will show striking differences across columns in crosstabs, I first do correlation tests (or dependence tests) ...
• 121
157 views

### Test for differences in frequencies of categorical variable with multiple responses

Background Interviews with two groups of therapists were conducted: experienced therapists and inexperienced therapists. Each statement of the interview was classified into 9 different categories. ...
• 30.7k
812 views

### What is the null model for a four-way contingency table?

I'm working through this tutorial on the Titanic data in R, a four-way contingency table, and I'm unclear as to what is the NULL ...
• 1,133
60 views

### Help with analyzing/planning a physical experiment -- regression

This is a real experiment about to be performed Batches of samples will be prepared. A Striker will be used to see if a reaction will occur. For example: 20 drops might be performed, and number of ...
• 141
126 views

### Test of Independence Between Two Nominal Variables With Many Levels Each

I am looking to test whether there is a significant relationship between two nominal variables, one which has 100 levels and the other with 10 levels. I initially considered doing a $\chi^2$ test of ...
• 711
120 views

• 6,604
301 views

### Log-linear analysis vs Breslow-day test

I would like to test independence of several categorical variables for a few datasets. I believe Breslow-day is possible for some of the analyses I want to do, and log-linear may be possible for all, ...
• 765
488 views

### Chi square for logical vectors: 2 row contingency table or 1 row vector?

I want to determine the independence between groups of logical variables. For example, for three groups, I want to know if the number of females (versus males) differs between the groups. I'm ...
• 359