Running the Numbers on the 2015 Chicago Marathon
The 2015 Chicago Marathon drew 45,000 runners to Chicago on October 11, 2015. More than 37,000 completed the race, and details of each runner's performance were carefully recorded. Explore and visualize characteristics of the runners and their performances using a custom entity store containing this data.
Load an entity store of the marathon from a ResourceObject.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_180.png)
marathonEntityStore = ResourceData[
ResourceObject[
Association[
"Name" -> "2015 Chicago Marathon Data",
"UUID" -> "7dc77972-cfc3-48dc-8d08-0292c6d2a929",
"ResourceType" -> "DataResource", "Version" -> "1.0.0",
"Description" -> "2015 Chicago Marathon participant data",
"ContentSize" -> Quantity[1990.2215919999999`, "Megabytes"],
"ContentElements" -> {"Content"}]]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_129.png)
Register the store for this session.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_181.png)
PrependTo[$EntityStores, marathonEntityStore];
Extract the total numbers of runners and, using an implicitly defined entity class, the numbers of male and female participants.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_182.png)
EntityValue["ChicagoMarathon2015", "EntityCount"]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_130.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_183.png)
Table[EntityValue[
EntityClass["ChicagoMarathon2015", "Gender" -> gender],
"EntityCount"], {gender, {Entity["Gender", "Male"],
Entity["Gender", "Female"]}}]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_131.png)
Select five random runners.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_184.png)
RandomEntity["ChicagoMarathon2015", 5]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_132.png)
View stored properties for a particular runner.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_185.png)
Entity["ChicagoMarathon2015", "Runner145"]["PropertyAssociation"]
Extract tallies of runner nationalities and make a table of the most common nationalities.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_186.png)
nationalityTallies =
Reverse[SortBy[
Tally[EntityValue["ChicagoMarathon2015",
EntityProperty["ChicagoMarathon2015", "Country"]]], Last]];
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_134.png)
Visualize geodesic paths from all countries of origin to Chicago.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_188.png)
With[{chicago =
Entity["City", {"Chicago", "Illinois", "UnitedStates"}]},
GeoGraphics[{Darker[Green],
GeoPath[{chicago, #} & /@ nationalityTallies[[All, 1]],
"Geodesic"]},
GeoRange -> "World",
GeoProjection -> "Robinson",
GeoCenter -> chicago]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_135.png)
Construct a heat map of the US showing home locations for American participants.
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_136.png)
Find the numbers of runners per variation from split mean.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_193.png)
allkm = Table[
Normal[allTimeSplits[[i]][2 ;;, "Time"]], {i,
Length[allTimeSplits]}];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_194.png)
allsplitbins = DeleteMissing[Transpose[allkm], 2];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_195.png)
meanall = Table[N[Mean[allsplitbins[[i]]]], {i, Length[allsplitbins]}]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_137.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_196.png)
marathondistances = (allTimeSplits[[1]])[All, "Split"] // Normal
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_138.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_197.png)
differencesall = Table[{marathondistances[[i + 1]],
allsplitbins[[i]] - meanall[[i]]},
{i, Length[allsplitbins]}];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_198.png)
allHistograms =
Histogram[#2, {60}, PlotLabel -> NumberForm[#1, {3, 1}]] & @@@
differencesall;
Generate histograms for each split.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_199.png)
Grid[Partition[allHistograms, UpTo[3]]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_139.png)
Plot a smooth kernel distribution of the differences between runners' splits and means.
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_140.png)