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.

198 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
5 votes
0 answers
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 ...
Alexis's user avatar
  • 30.1k
5 votes
0 answers
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 ...
lokheart's user avatar
  • 3,229
5 votes
0 answers
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 (...
rogueleaderr's user avatar
5 votes
0 answers
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. ...
dter's user avatar
  • 508
5 votes
0 answers
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 ...
someguyinafloppyhat's user avatar
4 votes
0 answers
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 ...
Nerine3's user avatar
  • 41
4 votes
0 answers
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 ...
Wave's user avatar
  • 175
4 votes
0 answers
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 ...
Daniel Gardiner's user avatar
3 votes
0 answers
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$ ...
libcaffe's user avatar
  • 131
3 votes
0 answers
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 ...
Taylor's user avatar
  • 20.8k
3 votes
0 answers
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 ...
user36196's user avatar
  • 368
3 votes
0 answers
48 views

Analysis of contingency table with ordinal outcome?

What statistical test do I apply in following 2 situations: ...
rnso's user avatar
  • 10.1k
3 votes
0 answers
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 ...
Brad Davis's user avatar
3 votes
0 answers
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 ...
ruggero's user avatar
  • 421
3 votes
0 answers
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 ...
Sitobion's user avatar
3 votes
0 answers
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 ...
NamelessAmos's user avatar
3 votes
0 answers
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 ...
BrechtDeMan's user avatar
3 votes
0 answers
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: ...
fernacolo's user avatar
  • 131
3 votes
0 answers
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 ...
Panos.A's user avatar
  • 41
3 votes
0 answers
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 ...
Texas_Crane's user avatar
3 votes
0 answers
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 ...
ALiX's user avatar
  • 340
3 votes
0 answers
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 ...
N Brouwer's user avatar
  • 2,163
2 votes
1 answer
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 ...
Cassandra C's user avatar
2 votes
0 answers
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 ...
Rubberduckquack's user avatar
2 votes
0 answers
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 ...
Daniela's user avatar
  • 57
2 votes
0 answers
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 ...
Roas Clack's user avatar
2 votes
1 answer
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 ...
nth's user avatar
  • 806
2 votes
0 answers
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 ...
tupui's user avatar
  • 41
2 votes
0 answers
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 ...
Francesco's user avatar
2 votes
0 answers
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 ...
Jenny's user avatar
  • 21
2 votes
0 answers
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 ...
DanielTheRocketMan's user avatar
2 votes
0 answers
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 ...
C_H's user avatar
  • 125
2 votes
0 answers
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 ...
user221943's user avatar
2 votes
0 answers
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 ...
dvanic's user avatar
  • 43
2 votes
0 answers
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 ...
Adam Przedniczek's user avatar
2 votes
0 answers
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 ...
YellowPillow's user avatar
  • 1,261
2 votes
1 answer
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) ...
nilsole's user avatar
  • 121
2 votes
0 answers
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. ...
COOLSerdash's user avatar
  • 30.7k
2 votes
0 answers
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 ...
landroni's user avatar
  • 1,133
2 votes
1 answer
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 ...
Chad's user avatar
  • 141
2 votes
0 answers
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 ...
wellington's user avatar
2 votes
0 answers
120 views

A question about the distribution of the log odds ratios in multivariate contingency tables?

I know that in $2 \times 2$ tables, one may compute the standard error of the log odds ratio by the formula $$\sqrt{\frac{1}{N_{11}} +\frac{1}{N_{12}}+\frac{1}{N_{21}} +\frac{1}{N_{22}}}$$ where the $...
JohnK's user avatar
  • 20.6k
2 votes
1 answer
76 views

Setting up data sheet for ANOVA

I am trying to set up a data sheet for my project, which is on the number of men and women on each floor in a dorm. My hypothesis is that each floor (and therefor the dorm as well) will have more ...
Lindsay's user avatar
  • 21
2 votes
0 answers
156 views

Visualise significant differences in a contingency table?

I'm working with pandas and scipy, and I would like to find a quick way to visualise unusual values in a contingency table. Say this is my contingency table: ...
Richard's user avatar
  • 693
2 votes
0 answers
51 views

Help with calculation of crossing more than expected from observed vs simulated data

I want to know if moose are crossing water more than expected. I followed the methods written in Beyer et al 2013 which I am now completely confused as to how to actually do the analysis. I am ...
Kerry's user avatar
  • 1,219
2 votes
0 answers
131 views

Testing equality of two or more contingency tables

Which options are there to test, whether two contingency tables of the same variables, say $X$ and $Y$, are equal across the levels of a third discrete variable, say $Z$? I can think of a log-linear ...
tomka's user avatar
  • 6,604
2 votes
0 answers
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, ...
baixiwei's user avatar
  • 765
2 votes
0 answers
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 ...
patrickmdnet's user avatar
2 votes
0 answers
169 views

How to test whether two means of categorisation generate significantly different results

If I have the following contingency table in which Novel.Cat is a new means of classifying some thing. Ref.Cat is the gold ...
Nodnol's user avatar
  • 21