Related Experiment Video
Updated: Dec 3, 2025

A Method of Trigonometric Modelling of Seasonal Variation Demonstrated with Multiple Sclerosis Relapse Data
Published on: December 9, 2015
Modeling and visualizing two-way contingency tables using compositional data analysis: A case-study on individual
Marina Vives-Mestres1,2, Amparo Casanova2
1Department of Computer Science, Applied Mathematics and Statistics, Universitat de Girona, Girona, Spain.
Abstract:
Two-way contingency tables arise in many fields, such as in medical studies, where the relation between two discrete random variables or responses is to be assessed. We propose to analyze and visualize a sample of 2 × 2 tables in the context of single-subject repeated measurements design by means of compositional data (CoDa) methods. First, we propose to visualize the tables in a quaternary diagram. Second, we show how to represent these tables by means of logratios indicating the relationship between the two variables as well as their strength and direction of dependency. Finally, we describe a technique to model those tables with a simplicial regression model. Data from a real-world study of self-prediction of migraine attack onset is used to illustrate this methodology. For each individual, the 2 × 2 table of their migraine expectation vs next day migraine occurrence is computed, generating a sample of tables. Then we visualize and interpret the prediction ability of individuals both in the simplex and in terms of logratios of components. Finally, we model the self-prediction ability with respect to demographic variables, days tracked and disease characteristics. Our application demonstrates that CoDa can be a useful tool for visualizing, modeling, and interpreting the components of 2 × 2 tables.
Related Concept Videos
Contingency Table
Introduction to Test of Independence
The test statistic for a test of independence is similar to that of a goodness-of-fit test:
Determination of Expected Frequency
Compartment Models: Two-Compartment Model
Mechanistic Models: Compartment Models in Individual and Population Analysis
Two-Way ANOVA
The two-way ANOVA analysis initially begins by stating the null hypothesis that there is an interaction effect between the two factors of a dataset. This effect can be visualized using line segments formed by joining the...

