
This article is Part Two of a two-part series focusing on how foot traffic data from cell phone pings can be used to analyze visitor demographics. Part One: Demographic Analysis of the Des Moines Farmers Market with Foot Traffic Data provides important context that guides this article. Please tag SafeGraph in any social media shares.
Demographic analysis drives decision-making among retailers, universities, amusement parks, and more. The importance of understanding your consumers cannot be overstated.
In the last article, we found that the Des Moines Farmers Market – a massive weekly event in downtown Des Moines, Iowa running from May to October – sees a drop in its visitors’ age and income each fall. We hypothesized that the observed demographic shift is driven by university students returning to school. While not a statistically rigorous test, data visualization often has real-world value, and mapping is no exception. We’ll test our hypothesis by mapping the home neighborhoods of the farmers market’s visitors.
Data
Setup was covered in Part One, so we’ll just do a quick overview of the data used in this analysis. We used SafeGraph’s Neighborhood Patterns. From the documentation:
SafeGraph’s Neighborhood Patterns dataset contains footfall data aggregated by census block group (CBG). Learn which day of the week a CBG is busiest, what time of the day a CBG is busiest, where devices that stop during breakfast, lunch, and dinner travel from, and how weekday and weekend demographics compare.
While we looked at 2018 and 2019 in Part One, the scope of this article is limited to 2019. Additionally, we are only analyzing visitors from within Polk County, where Des Moines is located. Before moving forward, one important term:
Census Block Group (CBG): A cluster of blocks within the same census tract. Usually containing 600 to 3000 people, CBGs are the geographical unit used by the US Census Bureau.
Our visualizations are at the CBG level, which is the level at which the US Census Bureau publishes demographic data.
Mapping
First, let’s check out a map of July 2019.

The Des Moines Farmers Market is shown by the black marker and dark gray CBG. Drake University and Grand View University are shown by the blue markers.
Now, a map of October 2019.

It’s hard to see any major differences between the two. Let’s combine the data from each to see the relative change in visitors from July to October. To do this, we take the (# of October visitors) / (# of July visitors) for each CBG. For example, if a given CBG had 100 visitors in July and 125 visitors in October, the relative change is 125/100 = 1.25, which is equivalent to 125%. In other words, the CBG had 25% more visitors in October than it did in July.
In this map, we’ll shade CBGs blue if they had more visitors in October than July. Otherwise, they’ll be shaded red. White indicates close to the same number of visitors in each month. So if our hypothesis is correct, we expect to see some blue around the two universities (we assume most students live on/near campus).

It’s a big difficult to see, so let’s also zoom in on the area of interest…

That’s a much more useful map than the first two. And it looks like we might be on to something! The CBG containing Drake University had 12 times mores visitors in October than it did in July. You can also see that CBG’s median age is 19 and its median income is $35,192.
Furthermore, most of the map is some shade of red, but each university has a cluster of blue CBGs around it. Interestingly, looking at the zoomed out map there is another unexplained blue cluster… After some googling, I discovered this blue cluster is home to Faith Baptist Bible College, which further corroborates our findings.

Conclusion
It’s important to keep in mind that correlation is not causation, and there are a number of potential confounders to our analysis. For example, the downtown Des Moines area is one of the city’s nightlife hotspots; perhaps our observed demographic shift has more to do with downtown bars than the farmers market. (Note: we could correct for this by making use of SafeGraph’s point-of-interest foot traffic data, SafeGraph Patterns, but that’s out of scope for this notebook). Furthermore, SafeGraph’s data is only a sample of the entire population; we used raw counts, but best practices would be to normalize the data in an effort to correct for bias.
However, our findings certainly seem like something. They make intuitive sense, and they may even have real-world significance, the easily-forgotten cousin of statistical significance. Applied to the real world, our findings have practical, actionable insights, which isn’t as common as we’d like in Data Science. For example, the Greater Des Moines Partnership (producer of the DSM Farmers Market) can leverage this type of analysis to optimize the farmers market to the demographic shift. Things like student discounts, campus shuttles, networking opportunities, yard games, and free food/beverage tickets could maximize turnout each Saturday morning.
Questions?
I invite you to ask them in the #safegraphdata channel of the SafeGraph Community, a free Slack community for data enthusiasts. Receive support, share your work, or connect with others in the GIS community. Through the Safegraph Community, academics have free access to data on over 7 million businesses in the USA, UK, and Canada.