Pa Lottery Data Viz Tool
2019 March 20

In this post, I provide access to a data visualizer for the Pennsylvania lottery using data I pull regularly from their RSS feed. This tool uses SQLite and some scripts to automatically pull data to this post which is then visualized using Chart.js. I created histograms of the most common drawn numbers for the drawings in which a particular number appears, and you can see that visualized below in the charts.

Frequency of Numbers given that X is part of the drawing

This chart displays the relative frequencies of a value coming up given that X showed up in the results. Numbers are counted exactly once within a drawing, so if 000 came up it would count as exactly 1 count for 0,0. The results are then normalized using count divided by the row sum.

Overall Frequency of Individual Numbers

So I just recently collected this data from the RSS feed, so it doesn’t go back too far, but I plan on keeping it running for as long as I can collecting new data. So use this tool to explore the lottery data, as a histogram or in other formats.

This post was updated on April 2nd, 2019 due to errors in computing the paired calculations. It’s fixed now with iterative computation now.

This post was updated on Aug 17, 2020 with some improvements. You can now select specific date ranges from the game picker, and if the form inputs aren’t working you can use the “force update” button to trigger an manual refresh. Also improved the styling.

Written by Henry J Schmale on 2019 March 20