This page contains the data work behind an Arizona Republic story about playing the lottery during the coronavirus pandemic. We wanted to find out how safety concerns and the statewide stay-at-home order had impacted ticket sales.

The analysis is simple: an easy year-to-year comparison of sales data. Data for March was provided to us as a lump sum figure, and April sales data was provided in Excel files. Here we go.

Photo by Patrick Breen/The Republic

Load the data

First, let’s load the April sales data for 2019 and 2020. These files were provided on April 21, 2020 by John Gilliland, the public information officer for the Arizona Lottery. The spreadsheets contain daily sales for all lottery games.

Warning: the Excel file contains a ‘TOTAL’ row that we need to remove. I’m also specifying the column types upon load, since R otherwise doesn’t know the first column is a date.

Run a few checks: Does the total_sales column accurately reflect the total sales on that day?

Note that some columns are a summation of the others. We need only to look at “online sales” (a Lottery term for draw games like Mega Millions and Powerball), “scratchers” and pull tabs to reach the total.

From the empty output above, we know the total_sales row is accurate and safe to use.

Gilliland also provided sales figures for lottery games in the month of March. The exact values can be found in the PDF of our email, saved as 20200421_email_arizona_lottery_data. We’ll create variables to hold those values:

Already, we can run a quick check on how sales compare in March between the two years.

## [1] -24.97865

Lottery sales were down about 25% in March compared to last year.

Now, let’s run a similar comparison for April sales between 2019 and 2020. Because the latest data we could obtain included only the first three weeks of April, we’ll need to truncate our table of april2019_sales to match the same time frame.

Now calculate the percent change:

## [1] 5.613154

Sales for the first three weeks of April are up by 5.6% compared to 2019.

That’s pretty surprising, given the 25% drop in March. Which games are doing poorly, and which games are doing well? We can summarise the day-by-day data to get a weekly comparison.


We see that sales for all games are still down in April nearly across the board - except for scratcher games, which sold so many tickets in the third week that they nearly made up for other losses. Looking closer at that week of data shows that sales ballooned on April 21st, totaling almost three times the earnings on earlier days.

At first, we wondered if this was an error. Gilliland told us no, it wasn’t wrong - just a reflection of converting to a new accounting system, which led to a backlog of tickets recorded that day. The Arizona Lottery data shows when a ticket “settles,” or is recognized by the state, which may not always be the same day the ticket was sold.

Our reporting also showed that lottery sales fluctuate with jackpot values and the state portfolio of games. People tend to buy more tickets when Powerball and Mega Millions skyrocket, and the Arizona Lottery regularly introduces new games and incentives for players. These could impact demand as much as a pandemic-era urge to stay home.

In short, it would be better to compare the data for broad time periods - March, April, or the seven weeks combined - rather than on a daily basis. Our analysis still shows that scratcher games are a powerful revenue engine for the state lottery, boosting sales enough to compensate for flagging interest in other games.

Finally, let’s combine all our data to compare sales from March 1 - April 21.


## [1] -13.78237
## [1] -23931204

Lottery revenues are down by 14% in March and the first three weeks of April.

That’s nearly $24 million in lost revenue.

You’ll see these findings included in the published story: .