One-way vs. two-way tables: examples and totals
A table can summarize the same data in different amounts of detail. Combining four years of revenue by month answers one question, while keeping each year separate lets us answer more. Let’s compare those two tables and calculate their totals.
Start with a one-way summary
Suppose an artist sold paintings from 2014 through 2017. Combining all four Januaries, all four Februaries, and so on gives a summary organized by one category: month. Each value below is the revenue for that month across all four years.
| Month | Total revenue |
|---|---|
| Jan | $28,361 |
| Feb | $14,744 |
| Mar | $19,407 |
| Apr | $15,891 |
| May | $21,277 |
| Jun | $21,530 |
| Jul | $17,990 |
| Aug | $21,838 |
| Sep | $20,174 |
| Oct | $20,025 |
| Nov | $48,055 |
| Dec | $24,318 |
| Grand total | $273,610 |
The artist earned $28,361 across the four Januaries. November has the largest combined revenue, $48,055. The table shows the overall monthly pattern, but it combines the years.
Keep month and year in a two-way table
A two-way table organizes values by two categorical variables. Here the rows identify the month, and the columns identify the year. To read a revenue amount, choose both a month and a year.
| Month | 2014 | 2015 |
|---|---|---|
| Jan | $254 | $1,396 |
| Feb | $377 | $1,084 |
| Mar | $291 | $1,679 |
| Apr | $1,146 | $1,668 |
| May | $820 | $2,708 |
| Jun | $1,138 | $3,014 |
| Jul | $694 | $2,586 |
| Aug | $486 | $2,080 |
| Sep | $538 | $3,109 |
| Oct | $448 | $3,695 |
| Nov | $2,387 | $6,495 |
| Dec | $401 | $2,030 |
| Year total | $8,980 | $31,544 |
| Month | 2016 | 2017 |
|---|---|---|
| Jan | $10,696 | $16,015 |
| Feb | $4,745 | $8,538 |
| Mar | $7,549 | $9,888 |
| Apr | $2,434 | $10,643 |
| May | $2,326 | $15,423 |
| Jun | $2,982 | $14,396 |
| Jul | $3,270 | $11,440 |
| Aug | $5,451 | $13,821 |
| Sep | $6,614 | $9,913 |
| Oct | $5,153 | $10,729 |
| Nov | $13,128 | $26,045 |
| Dec | $7,441 | $14,446 |
| Year total | $71,789 | $161,297 |
January 2014 has revenue $254, while January 2017 has revenue $16,015. These entries were combined with January 2015 and January 2016 to produce the January total in the one-way summary.
Month and year identify how the revenue is grouped. Organizing a table this way does not assert that the categories are statistically independent or establish a cause-and-effect relationship. Two-way tables can contain counts or other summaries; this example records revenue.
Find row totals, column totals, and the grand total
Add across a row to combine all four years for one month. For January, the row total is
Add down a year column to get the annual revenue. Those column totals are shown at the bottom of the two-way tables. Adding them gives the grand total for all months and all years.
| Year | Revenue |
|---|---|
| 2014 | $8,980 |
| 2015 | $31,544 |
| 2016 | $71,789 |
| 2017 | $161,297 |
| Grand total | $273,610 |
Adding the twelve monthly totals gives the same grand total. This lets us check that both summaries account for all the revenue.
Compare the years with a graph
A separate line for each year compares the same month across years. A chronological line graph would instead put all 48 months in order from January 2014 through December 2017. Side-by-side bars are another option for comparing the years within each month.
In this data set, 2017 has the largest annual revenue. November has the largest combined monthly total. The two-way table lets us see both patterns while keeping the individual month-and-year amounts available.