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

566 questions
Filter by
Sorted by
Tagged with
23 views

### Statistical test for 3x2 contingency table, with cases:controls matched 1:5 (i.e. non-independent)

I am examining a cohort of cases against controls, matched at a 1:5 ratio (on sex, birth year, and residency/postal code at time of diagnosis). Education level Cases (n=206) Controls (n=957) p-value ...
7 views

### Two-sample statistical significance test taking into account group membership (proportions) and numeric comparison

Say I have two samples of observations, S1 and S2, which can be of unequal sizes. For each observation, I have two variables: G (a categorical group assignment, say it is binary with values A/B), and ...
40 views

### Chi-squared test with more than two variables, or should I run a different test?

I am looking at whether certain animals or categories of animals are more likely to use human-made trails than natural trails. We used camera traps and recorded for every case which animal it was, ...
425 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 ...
65 views

### Standardised residuals in contingency tables and statistically significant result

I have the following contingency table that results in statistically significant result of Pearson's $\chi^2$ Test for Count Data. I've computed Pearson residuals that should have the same properties ...
8 views

### Enrichment of positive cases within paired data

I have analyzed 47 cancer samples from tissue and blood. in the tissue 40 are positive for a virus and in the blood 8 are positive for the virus Importantly, these 8 are the same patients that are ...
71 views

### Compare two contingency tables with the same structure

I want to compare two contingency tables A and B with the same structure (same columns and rows). My first idea was to use chi squared distance $\sum_{i=1}^{p}{\frac{(O_i-E_i)^2}{E_i}}$. But, some ...
63 views

### Comparing two association matrices (contingency tables)

I am looking for a significance test to compare between two association matrices (contingency tables) - preferably to test whether the odds ratio is the same. I have looked at some questions here but ...
52 views

### Bayesian inference based on a 3$\times$3 contingency table

How do I make inferences about population parameters based on a 3$\times$3 table of observations? In "Bernoulli's Fallacy", Aubrey Clayton provides this (Table 5.8). Democrat Republican ...
22 views

### How can I update a contingency table based on evidence?

I have a series of contingency tables that are my population benchmarks and survey data. Practically speaking, we know the population benchmarks are largely, but not entirely, accurate; there are some ...
1 vote
50 views

### How to calculate the p-value of a log-odds ratio, given that the variance depends on the observed frequencies?

I am a bit confused about how people calculate p-value when calculating odds-ratios. The log-odds ratio (LOR) for a contingency table with two entries is $L = \log \frac{p_{1}}{p_{0}}$ and has an ...
15 views

### Anova with response dependent on other variables that arent the predictor

I am running into difficulty determining the best way to analyze my data. So, as backgroud I have a dataset containing the variables MONTH, REGION, COUNT, and YEARS. MONTH, REGION, and YEAR and all ...
1 vote
82 views

### Test to compare multiple contingency tables

I have three contingency tables with the variables month and region that contain the frequency of the sighting of a particular bird. Additionally, the tables differ only by counting frequencies from ...
94 views

### Does Cochrane-Armitage test require an obvious trend in contingency table?

I'm trying to determine whether it's appropriate to use the Cochrane-Armitage trend test on this set of data? I don't have any specific hypotheses I need to investigate, just to choose an appropriate ...
1 vote
53 views

### Inference for Contingency tables [closed]

Assume two paired binary vectors, $v^A,v^B$. We can easily construct a contingency table looking like: $v^A_i=1$ $v^A_i=0$ Totals $v^B_i=1$ $a$ $b$ $a+b$ $v^B_i=0$ $c$ $d$ $c+d$ Totals $a+c$ $b+d$ ...
85 views

### margins=True option in pd.crosstab influences the outcome of chi2_contingency test. Why?

I understand what the margins=True option in pd.crosstab does, but I don't understand why it would influence the outcome of the chi2_contingency. Here an example: ...
40 views

### Relative Risk and Odd ratio for N x N x N table

I am trying to calculate RR for case where I have N x N x N table. First N is City (20 cities) second N is Age group (5 groups) and third one is Industry (4 ...
49 views

### I have an issue summarising highly skewed data in a table

I have a numerical ordinal dataset (eg. 1-10) that's very highly skewed, with >90% of the values at 10. How can I best summarise this in a table? The median/IQR gives '10 (10, 10)' (which doesn't ...
25 views

### Are marginal probabilities a mixture model of the conditional probabilities?

In a contingency table, is it correct to say that the marginal probabilities are a mixture model of the conditional probabilities? Also, is it correct to say that these marginal and conditinal ...
240 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 ...
91 views

### Making sense of a reviewer's "30 observed counts minimum per cell" requirement on a contingency table

I'm perplexed by the comment of a reviewer, who has taken issue with the sample size from a study I conducted. He says, relatively to the 2X2 contingency table below and a (significant) 2-sample test ...
1 vote
79 views

### What will happen to my results if I use Fisher's exact test with unfixed marginal totals?

I've been trying to get my head around the controversy that surrounds Fisher's exact test. I often use the test in the something like the following way: A survey asks respondents two questions: "...
158 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 ...
26 views

### Statistical test for odds ratio when 1. N is large and not meaningful; 2. replicates are present

I'm investigating the co-occurrence of 2 types of events (var1 and var2). The hypothesis is that ...
18 views

### Replicated experiment with categorical response and predictor

A set of experiments is performed under n conditions, with each experiment resulting in a series of events classified in k categories (k<10). Each condition is independently repeated m times. ...
30 views

### No theoretical frequency should be less than 5 [duplicate]

Why does the theoretical frequency in chi-square distribution should not be less than 5? What's the concept behind pooling the preceding and succeeding frequency to make pooled frequency more than 5?
51 views

### Calculate correlation of nominal and ordinal variables and hypothesis test in r

I would like to statistically analyze three variables. One variable is "consortium mostly academic" (nominal, dichotomous), the second variable is "evaluation method" (nominal, non-... 33 views

### How to apply Bayes' theorem on a contingency in which the sampled distribution differs drastically from the entire population?

Summary: How can I calculate my probability of being truly positive based on a contingency table that has a completely different distribution than the total population? I was recently confronted with ...
1 vote
193 views

### Chi-square test for two vectors with very identical values

I have two vectors with two levels: vector 1:...
1 vote
97 views

### Contingency analysis of a 3x3 table via Chi2, log-linear and Poisson GLM - how to interpret this result?

I have a dataset describing age of wine in 3 classes of quality. ...
100 views

### Chi-squared test for equality of proportions

This question is question 12 from Problems 10.3 from Rohatgi's An Introduction to Probability and Statistics. Of 25 income tax returns audited in a small town, 10 were from low and middle income ...
187 views

### Non-numeric argument to binary operator

I'm trying to find out a model that adequately describes effects of gender and length on food choice. For gender; 0=Male and 1=Female, length; 0=Subadult 1=Adult, Choice; F=Fish I=Invertebrates and O=...
98 views

### Covariance of cells in random contingency tables

Say we have $n=3$ bins and $m=3$ different coloured balls (30 red 20 green and 50 blue) in an urn. We draw randomly without replacement a ball from from the urn and place it into the bins. The first ...
22 views

### To analyze some percentage structure, is Breslow-Day any different than Chi2 for contengency table?

I was asked to compare three groups for their percentage structure. Let me explain - there is a categorical variable X with 3 levels: <100, 100-200, > 200 units. That's all I have and I have no ...
90 views

### Should a contingency table be "symmetric"?

Im am running a fishers exact test on some data but im unsure of how the input contingency table should be formatted. Option 1 ...
1 vote
30 views

### Perform goodness-of-fit test on multiple contingency tables

I want to test my theory against a set of scenes. Specifically, I have 10 2x2 contingency table with observation and expected frequencies. Since there is only one model rather than 10 different models,...
1 vote
36 views

### Caveats in analyzing 2x2 contingency tables

after reading this paper https://onlinelibrary.wiley.com/doi/10.1111/1440-1681.12052 I have real troubles deciding which test is most suitable for my analysis. The data is following: a group of ...
34 views

### Collapsibility Conditions for Multiway Tables

Why is the WX conditional association the same as the WX marginal association in log linear model (WX, XYZ) (four-way table) and not in the log linear model (WX, WZ, XY, YZ)? I saw on the internet to ...
1 vote
58 views

### Testing Relationships surrounding Social Media Engagement

I'm sure I have a very easy question I'm trying to answer, but as a qualitative researcher who has found themselves trying to help an undergraduate on a quantitative project, I need some help. I'm ...
464 views

### Chi-Square Test for multiple-response variables?

I have two categorical variables but one of them has multiple responses. After searching online, I came to find the Rao-Scott Chi-Square Test for such data, but little was found about some useful R or ...
11 views

### Different sub-population sizes in grading data

I am relatively new to statistical analysis. Let's say I have a data set of 5000 report card grades 3000 (60%) are "A" grades 100 (2%) are "D" grades and 25 (0.5%) are "F&...
26 views

It is known that Fisher exact test assumes that all 4 margins of 2 by 2 table are fixed. $\chi^2$ test does not impose restriction on sampling design beforehand in general where I mean $\chi^2\sim\sum ... 1 vote 1 answer 109 views ### How to generate data or sample data from a summary tables? I have a dataset like this: I only have summary tables of the "loneliness score" for overall, for each sex, each age group, and sex * age interactions. Besides this, I have 23 items that ... 1 vote 1 answer 45 views ### Determine if a categorical variable occurs at a frequency greater than chance with a boolean outcome I am looking for the proper statistic to answer whether which categorical items (from a long list) occur at frequency greater than chance with each state of a boolean variable. More specifically, I ... 1 vote 1 answer 369 views ### Pairwise test of 2x3 contingency table in R ... 0 votes 1 answer 171 views ### What is the$\chi^2\$ contingency test really showing?

I have a friend who used this function to compute a chi-squared contingency table in a paper they are writing, and I don't think I fully understand what the results of this test are. Function ...
18 views

### How to infer unknown cell frequencies (effect of a variable) if table marginals are known and cell frequencies for another population is known?

I want to infer cell frequencies (or conditional probabilities) for a population table where: I know the marginal totals but not the cell frequencies, and I know the cell frequencies for a table of a ...
30 views

### Quantifying Dependency in Chi Squared Test

I am running a Chi Squared test on nominal values and this is the contingency table. ...