Showing posts with label marathon. Show all posts
Showing posts with label marathon. Show all posts

Friday, December 18, 2015

Marathon Races Shiny App

About a year ago I posted about men's and women's marathon (and longer) distance races from the Arrs.net dataset.  In the meantime, Shiny development and the open source announcement of plot.ly have brought data visualization to the next level.  As an avid (at least former) runner, exploring marathon data is interesting at both the personal and "data science" (or is that personal too?) levels.  Thus, I finished a Shiny app that explores this dataset from 2014.  Unfortunately, 2015 data is not being updated for one reason or another, but 2014 provides a lot of observations about marathon and longer distance races.

Click here to access the app.

datavaapps.shinyapps.io/ARRS_dashboard


The values can be toggled between months for 2014 and a searchable table of all the data is below the graph.  You will notice many of the points are small ultra-marathons around the world.  Plot.ly provides nice graph interactive abilities found when hovering in the upper right corner of the graph.

Thanks to RStudio for all their work on Shiny and to Plot.ly for their plotly package and charting library.




Sunday, April 19, 2015

Boston Elite Field 2015

Last year I posted about how chances of a non-African country winning the Boston Marathon seemed to be good because of the widening interval of winning times (more recently there had been some historically "slower" races and some historically "faster" ones) and this actually happened.   Meb Kflezighi ran a remarkable race and was widely celebrated as he represented the US in a race more recently dominated by African countries.  His time for winning the race was obviously the fastest, but others in the field had faster PRs.  Because of the variation in winning times my conclusion has been that this provides opportunities for certain runners representing non-African countries to contest the race well.


The amount of participants from Africa in the elite field clearly increases the likelihood that the winner represents an African country.  The runners in the elite field mostly fall into or below the confidence interval shown in the graph above with the slight exception of Matt Tegenkamp whose PR for the marathon is 2:12 ish, just above where this statistical measurement would encompass.  It is clear that once again the elite field is dominated by African runners who are putting up some really impressive PRs.



And yet, with the difference in PRs, last year there was a similar dynamic.  Dennis Kimetto comes to the race with a 2:03 PR and Meb Kflezighi wins the Boston Marathon having run a 2:09 PR previously.  Thus we have another great story this year.  Incredible athletes, some of whom have in the past run much faster than others.  And yet, who can tell what will happen race day.

But why try?  Why did Meb think he could beat someone who in marathon terms could go somewhere he could not?  More broadly, why do we love these events?  Why should Matt Tegankamp attempt to rival someone who would be 2 miles ahead of him on each of their best days?  Variance.  Within these elite athletes there is the notion that on any given day, the guy next to you could be at his best or worst.  As spectators, we're drawn to variance...we love possibilities of things not turning out predictably, or that there is variation in what we assume to be true.  Athletes place their hopes in this, that they could run their absolute best and others may not.  Confidence intervals tell the story of variance, that statistically we can't know for certain.  I think this year yet again, we could see this same variance play out.  The athlete that doesn't have the fastest PR runs their best despite the odds.  This is what makes a great race and what we could see again tomorrow.

Sunday, December 21, 2014

Winning a Marathon (Part 2)

In a previous post I looked at a data set published by the AARRS that provides a lot of data on marathons around the world and specifically the winning times of every* race.  After spending a bit more time with the data there are a few more things we can take from this data that may be more helpful for personal use.

As mentioned before, the data includes ultra-marathons, trail-runs, etc.  In an effort to extract those to get only road races I've filtered the data to include only those races with at least 200 participants (male/female so 200 male participants at least or 200 female participants).  Still there are some non-road races in the data that have 200+ participants, but far less than before.  So, is the data totally "cleaned" of these races, no.  But, I think this gets us closer to the finishing time(s) people are running to win "normal" marathon road races.


In this case the average winning time is about 2:35:00 for male winners.  We can assume that this would come down slightly with a few more of the ultra-races stripped out.  You can see different race names as you put your cursor over the point (thanks plot.ly!).  This is potentially helpful for finding a race to win that's within your race time.  In the past 10 years the times haven't changed dramatically (contrary to the graph that included all marathon and ultra distances).  Certainly more races were available the past few years than those before, but it seems that those races are all run just as fast as the others.  

Female winning times have also stayed consistent over the past 10 years for races with more than 200 finishers.  


The average time for Female winners is around 3:02:00 for the last 10 years.  Again, much lower time than had we included all races in the data set without some filtering.

These graphs were only of races in the US.  In general, without having personal knowledge of the race, (terrain, temperature, organization, etc.) marathon difficulty is difficult to measure objectively.  I don't know of any "difficulty index" for marathons (let me know if you know of one), which is why starting with the winning times of races is a good place to start when considering racing with the potential to win.  

Friday, December 5, 2014

Winning a Marathon

The proliferation and participation in the marathon has increased substantially in recent years.  No longer is the distance an event reserved for the super-athletic, but at least in the US one can from many vantage points on highways or streets see the infamous "26.2" sticker donning a rear windshield.  In a previous post I logged participation in marathons worldwide and as can be seen from the animation, certainly in the US this has increased over time.

As participation becomes more the norm we turn now to the question of actually winning a marathon.  The Association of Road Racing Statisticians (yes there is such a thing) maintains an excellent site with all sorts of data on the marathon event as well as other distances.  I created a large file from their data of all marathons each year in the world with their winners.  Marathon in this dataset is anything that is over or equal to 26.2 miles, so that includes trail races or ultra-marathons.  This will make sense when some of the finishing times are seen below.  I plan on talking more about this dataset in future posts but for now we'll look at winning a marathon in the USA.

According to this dataset, in 2013 there were 1,984 marathon events in the US (wow).  And seemingly Fall is the most popular time to host them (ya know before the Holidays).


So how fast do you need to run to win one of these or at least have a decent shot at winning?  Obviously lots of variance depending on which one - or as may be intuitive race purse/recognition is highly correlated with race speed*.  In general for the past several years in the US, the time needed for a male on average is about 3 hours.  As more races have been created giving opportunity to more people, the average time needed to win a marathon has decreased slightly.  In 2013 you "only" needed to run in the 3:30 range to win a marathon, that is on average across 1,984 races.




Interesting to note that to qualify for the Boston Marathon in 2013 as a male a time of 3 hours was needed (wonder if they based that on average winning times over the last 10 years).  Female winning times look similar in that they too have a slight bump in 2013/2014 in terms of "slower" winning times on average.




More recently across all the marathons in the USA, women are winning marathons at around the 4 hour mark.  Again, this all depends on the race one is entering.  But if you are like some of the people who run multiple marathons a year, hitting these averages gives you a decent chance at winning...especially as you heavily consider the number of participants and/or the purse involved ;-) 

For those interested, most of the code for pulling this data and the graph(s) will be on my github page.

*More challenging races (ultra-distance, trail, etc.) are included in the dataset (not all races were created equal) and perhaps more vetting on this dataset on individual races is needed to fully appreciate the finishing times.  A more vetted dataset would surely yield a lower finishing time for both male/female, however combing every race is beyond the scope of this post...maybe when I have a bit more time.

Monday, November 10, 2014

Marathon Finishers Worldwide

This is an interactive timeline of the top 10 countries' participants who finished a marathon. The data was used/scraped from the Association of Road Racing Statisticians where this data is compiled (great site btw). Those interested in the code will find it on my github page.

Not too surprisingly, the US has the most Marathon finishers of any country. Interesting is Japan's increase in Marathon finishers in more recent years as well as the fluctuation in which countries occupy the top 10 with the most finishers. 2014 is incomplete because the year is not finished. The dip in 2012 is a result of the NYC Marathon being canceled.

MotionChartID197c73527aa6
Data: running2 • Chart ID: MotionChartID197c73527aa6 • googleVis-0.5.6
R version 3.1.1 (2014-07-10) • Google Terms of Use • Documentation and Data Policy

Wednesday, April 2, 2014

Boston Marathon Winners and Challenging Africa

The marathon is dominated by African runners.  David Epstein in a relatively recent interview mentions about a specific tribe in Kenya called the Kalenjin, "There are 17 American men in history who have run under 2:10 in the marathon...there were 32 Kalenjin who did it in October of 2011". The times and number of African runners reaching those times times rarely achieved by their racing counterparts is impressive.  Below is a graph showing the top 50 times recorded by Association of International Marathons and Distance Races (AIMS) over the past few years.  

The Boston Marathon is perhaps the most sought after race for marathon distance runners.  At least in the US, qualifying for the Boston Marathon can be the pinnacle achievement for an avid runner's career.  As one would expect, this race draws runners from all over the world who seek the prestige and purse of winning the Boston Marathon.  Over time the winners of this race have changed, as arguably, the physiology (and arguably culture) of runners has become more of a factor since access to the race has become easier over time (for more on Kenyan physiology and culture as running determinants, see this Radiolab podcast).  Like in all marathon races, the times are getting lower and African runners have shown a clear dominance over the last several years.  In the graph below you can see the descent into Boston Marathon winning times that 30-40 years ago were unimaginable.  


 
Here are the same times and years broken out by continent instead of country.  Notice the break in dominance of winning this marathon from Europe/North America to Africa in the mid 1980s.  Prior to this time, the race enjoyed a larger amount of variety in countries/continents winning the race.




The grayish line intersecting these points is basically a confidence interval (95% confidence interval).  One could interpret any point within this grey area as a time that would not be a statistical outlier or a time that could be expected to win the Boston Marathon.  The interesting thing about this graph is how the gray area is now widening in the past few years.  This is partially because of the fastest marathon ever run is included in this graph (This was done by Geoffrey Mutai in 2011, which did not count as a world record formally because of the change in relief of the Boston Marathon).  Notwithstanding this time, we also see times more recently that have historically been run by North Americans, Australians, Asians, and Europeans.  Though it is clear that Africa demonstrates clear dominance in this marathon and others, the times that African participants have been running are not insurmountable from a historic perspective.

This "widening" of race time expectations I believe provides opportunities to continents and countries who have run races at this speed in the past.  The question now becomes how many runners in these continents/countries can currently run at these paces.  There are some.  Both Ryan Hall and Dathan Ritzenhein are US runners who have run marathons in 2:08, which would make them both very competitive with the recent winners of the Boston Marathon.

Stripping out the African countries we can see the times of other continents over the past several years.  In fact all of these times fit into the range of "expectation" (95% confidence interval) of the most recent races.




Running this fast a race must take into account multiple other factors such as weather, injury, etc.  However, based on the data of previous races, the times produced by these runners in the graph above would have been very competitive if not won previous recent years' marathons.  There may not be as many challengers in other continents, but those challenging African runners stand a chance.  More recently if a non-African runner had run the Boston Marathon in what would possibly have been their best race, they would have had a great chance at winning.