- Two-way tables display how data is split according to two different categorical characteristics at once. Each entry inside the table shows the frequency for one combined category, such as one row category together with one column category, so the table captures both separate and joint information.
- A row usually represents one set of categories and a column represents the other set, but the mathematical meaning is unchanged if they are swapped. What matters is that each interior cell gives the number of observations that belong to both categories simultaneously.
- Marginal totals are the totals at the ends of rows and columns, and the grand total is the overall total in the bottom-right corner. These totals summarize how many observations fall into each single category and how many observations there are altogether.
- A two-way table is especially useful when data is categorical rather than numerical, because the goal is to count how many observations fall into each class. It is commonly used for classification, comparison, and probability questions involving words like and, or, or given that.
diagram":{"svg":"<svg viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg\"><linearGradient id="twoway-fill-gradient-1" x1="0" x2="1" y1="0" y2="1"><stop offset="0%" stop-color="#dbeafe" stop-opacity="0.7"/><stop offset="100%" stop-color="#93c5fd" stop-opacity="0.7"/><rect x="0" y="0" width="600" height="400" fill="white"/><g stroke="#e5e7eb" stroke-opacity="0.4"><line x1="50" y1="50" x2="550" y2="50"/><line x1="50" y1="125" x2="550" y2="125"/><line x1="50" y1="200" x2="550" y2="200"/><line x1="50" y1="275" x2="550" y2="275"/><line x1="50" y1="350" x2="550" y2="350"/><line x1="50" y1="50" x2="50" y2="350"/><line x1="170" y1="50" x2="170" y2="350"/><line x1="310" y1="50" x2="310" y2="350"/><line x1="430" y1="50" x2="430" y2="350"/><line x1="550" y1="50" x2="550" y2="350"/><rect x="170" y="125" width="140" height="75" fill="url(#twoway-fill-gradient-1)" stroke="#ef4444" stroke-width="2.5"/><rect x="310" y="125" width="120" height="75" fill="url(#twoway-fill-gradient-1)" stroke="#ef4444" stroke-width="2.5"/><rect x="170" y="200" width="140" height="75" fill="url(#twoway-fill-gradient-1)" stroke="#ef4444" stroke-width="2.5"/><rect x="310" y="200" width="120" height="75" fill="url(#twoway-fill-gradient-1)" stroke="#ef4444" stroke-width="2.5"/><g fill="#374151" font-family="Arial, sans-serif" font-size="18"><text x="90" y="95">Category<text x="215" y="95">Column A<text x="335" y="95">Column B<text x="465" y="95">Total<text x="80" y="170">Row 1<text x="80" y="245">Row 2<text x="80" y="320">Total<text x="205" y="170">joint<text x="345" y="170">joint<text x="205" y="245">joint<text x="345" y="245">joint<text x="465" y="170">row total<text x="465" y="245">row total<text x="205" y="320">column total<text x="337" y="320">column total<text x="462" y="320">grand total<path d="M 240 115 C 240 100, 240 90, 240 80" fill="none" stroke="#22c55e" stroke-width="2.5"/><path d="M 500 185 C 525 185, 530 185, 540 185" fill="none" stroke="#f59e0b" stroke-width="2.5"/><text x="205" y="65" fill="#22c55e" font-size="16" font-family="Arial, sans-serif">column category<text x="440" y="180" fill="#f59e0b" font-size="16" font-family="Arial, sans-serif">marginal total","alt":"Generic two-way table showing joint frequencies in interior cells, row and column totals, and a grand total."}},{