metachronistic http://swingleydev.com/blog/ Latest metachronistic posts en-us Sat, 19 Nov 2016 15:50:20 -0900 Low snow years in Fairbanks http://swingleydev.com/blog/p/2001/ <div class="document"> <div class="section" id="introduction"> <h1>Introduction</h1> <p>So far this winter we’ve gotten only 4.1&nbsp;inches of snow, well below the normal 19.7&nbsp;inches, and there is only 2&nbsp;inches of snow on the ground. At this point last year we had 8&nbsp;inches and I’d been biking and skiing on the trail to work for two weeks. In his <a class="reference external" href="http://ak-wx.blogspot.com/2016/11/north-pacific-temperature-update.html">North Pacific Temperature Update</a> blog post, Richard James mentions that winters like this one, with a combined strongly positive Pacific Decadal Oscillation phase and strongly negative North Pacific Mode phase tend to be a “distinctly dry” pattern for interior Alaska. I don’t pretend to understand these large scale climate patterns, but I thought it would be interesting to look at snowfall and snow depth in years with very little mid-November snow. In other years like this one do we eventually get enough snow that the trails fill in and we can fully participate in winter sports like skiing, dog mushing, and fat biking?</p> </div> <div class="section" id="data"> <h1>Data</h1> <p>We will use daily data from the Global Historical Climate Data set for the Fairbanks International Airport station. Data prior to 1950 is excluded because of poor quality snowfall and snow depth data and because there’s a good chance that our climate has changed since then and patterns from that era aren’t a good model for the current climate in Alaska.</p> <p>We will look at both snow depth and the cumulative winter snowfall.</p> </div> <div class="section" id="results"> <h1>Results</h1> <p>The following tables show the ten years with the lowest cumulative snowfall and snow depth values from 1950 to the present on November&nbsp;18th.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="20%" /> <col width="80%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Year</th> <th class="head">Cumulative Snowfall (inches)</th> </tr> </thead> <tbody valign="top"> <tr><td>1953</td> <td>1.5</td> </tr> <tr><td>2016</td> <td>4.1</td> </tr> <tr><td>1954</td> <td>4.3</td> </tr> <tr><td>2014</td> <td>6.0</td> </tr> <tr><td>2006</td> <td>6.4</td> </tr> <tr><td>1962</td> <td>7.5</td> </tr> <tr><td>1998</td> <td>7.8</td> </tr> <tr><td>1960</td> <td>8.5</td> </tr> <tr><td>1995</td> <td>8.8</td> </tr> <tr><td>1979</td> <td>10.2</td> </tr> </tbody> </table> <table border="1" class="tosf docutils"> <colgroup> <col width="26%" /> <col width="74%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Year</th> <th class="head">Snow depth (inches)</th> </tr> </thead> <tbody valign="top"> <tr><td>1953</td> <td>1</td> </tr> <tr><td>1954</td> <td>1</td> </tr> <tr><td>1962</td> <td>1</td> </tr> <tr><td>2016</td> <td>2</td> </tr> <tr><td>2014</td> <td>2</td> </tr> <tr><td>1998</td> <td>3</td> </tr> <tr><td>1964</td> <td>3</td> </tr> <tr><td>1976</td> <td>3</td> </tr> <tr><td>1971</td> <td>3</td> </tr> <tr><td>2006</td> <td>4</td> </tr> </tbody> </table> <p>2016 has the second-lowest cumulative snowfall behind 1953 and is tied for second with 2014 for snow depth with 1953, 1954 and 1962 all having only 1&nbsp;inch of snow on November 18th.</p> <p>It also seems like recent years appear in these tables more frequently than would be expected. Grouping by decade and averaging cumulative snowfall and snow depth yields the pattern in the chart below. The error bars (not shown) are fairly large, so the differences between decades aren’t likely to be statistically significant, but there is a pattern of lower snowfall amounts in recent decades.</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/11/decadal_averages.pdf"><img alt="Decadal average cumulative snowfall and snow depth" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/11/decadal_averages.svgz" /></a> </div> <p>Now let’s see what happened in those years with low snowfall and snow depth values in mid-November starting with cumulative snowfall. The following plot (and the subsequent snow depth plot) shows the data for the low-value years (and one very high snowfall year—1990), with each year’s data as a separate line. The smooth dark cyan line through the middle of each plot is the smoothed line through the values for all years; a sort of “average” snowfall and snow depth curve.</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/11/cumulative_snowfall.pdf"><img alt="Cumulative snowfall, years with low snow on November 18" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/11/cumulative_snowfall.svgz" /></a> </div> <p>In all four mid-November low-snowfall years, the cumulative snowfall values remain below average throughout the winter, but snow did continue to fall as the season went on. Even the lowest winter year here, 2006–2007, still ended the winter with 15 inches of snow on the groud.</p> <p>The following plot shows snow depth for the four years with the lowest snow depth on November 18th. The data is formatted the same as in the previous plot except we’ve jittered the values slightly to make the plot easier to read.</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/11/snow_depth.pdf"><img alt="Snow depth, years with low snow on November 18" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/11/snow_depth.svgz" /></a> </div> <p>The pattern here is similar, but the snow depths get much closer to the average values. Snow depth for all four low snow years remain low throughout November, but start rising in December, dramatically in 1954 and 2014.</p> <p>One of the highest snowfall years between 1950 and 2016 was 1990–1991 (shown on both plots). An impressive 32.8&nbsp;inches of snow fell in eight days between December&nbsp;21st and December&nbsp;28th, accounting for the sharp increase in cumulative snowfall and snow depth shown on both plots. There are five years in the record where the cumulative total for the entire winter was lower than these eight days in 1990.</p> </div> <div class="section" id="conclusion"> <h1>Conclusion</h1> <p>Despite the lack of snow on the ground to this point in the year, the record shows that we are still likely to get enough snow to fill in the trails. We may need to wait until mid to late December, but it’s even possible we’ll eventually reach the long term average depth before spring.</p> </div> <div class="section" id="appendix"> <h1>Appendix</h1> <p>Here’s the R code used to generate the statistics, tables and plots from this post:</p> <div class="highlight"><pre><span class="kn">library</span><span class="p">(</span>tidyverse<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>lubridate<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>scales<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>knitr<span class="p">)</span> noaa <span class="o">&lt;-</span> src_postgres<span class="p">(</span>host<span class="o">=</span><span class="s">&quot;localhost&quot;</span><span class="p">,</span> dbname<span class="o">=</span><span class="s">&quot;noaa&quot;</span><span class="p">)</span> snow <span class="o">&lt;-</span> tbl<span class="p">(</span>noaa<span class="p">,</span> build_sql<span class="p">(</span> <span class="s">&quot;WITH wdoy_data AS (</span> <span class="s"> SELECT dte, dte - interval &#39;120 days&#39; as wdte,</span> <span class="s"> tmin_c, tmax_c, (tmin_c+tmax_c)/2.0 AS tavg_c,</span> <span class="s"> prcp_mm, snow_mm, snwd_mm</span> <span class="s"> FROM ghcnd_pivot</span> <span class="s"> WHERE station_name = &#39;FAIRBANKS INTL AP&#39;</span> <span class="s"> AND dte &gt; &#39;1950-09-01&#39;)</span> <span class="s"> SELECT dte, date_part(&#39;year&#39;, wdte) AS wyear, date_part(&#39;doy&#39;, wdte) AS wdoy,</span> <span class="s"> to_char(dte, &#39;Mon DD&#39;) AS mmdd,</span> <span class="s"> tmin_c, tmax_c, tavg_c, prcp_mm, snow_mm, snwd_mm</span> <span class="s"> FROM wdoy_data&quot;</span><span class="p">))</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>wyear<span class="o">=</span><span class="kp">as.integer</span><span class="p">(</span>wyear<span class="p">),</span> wdoy<span class="o">=</span><span class="kp">as.integer</span><span class="p">(</span>wdoy<span class="p">),</span> snwd_mm<span class="o">=</span><span class="kp">as.integer</span><span class="p">(</span>snwd_mm<span class="p">))</span> <span class="o">%&gt;%</span> select<span class="p">(</span>dte<span class="p">,</span> wyear<span class="p">,</span> wdoy<span class="p">,</span> mmdd<span class="p">,</span> tmin_c<span class="p">,</span> tmax_c<span class="p">,</span> tavg_c<span class="p">,</span> prcp_mm<span class="p">,</span> snow_mm<span class="p">,</span> snwd_mm<span class="p">)</span> <span class="o">%&gt;%</span> collect<span class="p">()</span> write_csv<span class="p">(</span>snow<span class="p">,</span> <span class="s">&quot;pafa_data_with_wyear_post_1950.csv&quot;</span><span class="p">)</span> <span class="kp">save</span><span class="p">(</span>snow<span class="p">,</span> file<span class="o">=</span><span class="s">&quot;pafa_data_with_wyear_post_1950.rdata&quot;</span><span class="p">)</span> cum_snow <span class="o">&lt;-</span> snow <span class="o">%&gt;%</span> mutate<span class="p">(</span>snow_na<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span><span class="kp">is.na</span><span class="p">(</span>snow_mm<span class="p">),</span><span class="m">1</span><span class="p">,</span><span class="m">0</span><span class="p">),</span> snow_mm<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span><span class="kp">is.na</span><span class="p">(</span>snow_mm<span class="p">),</span><span class="m">0</span><span class="p">,</span>snow_mm<span class="p">))</span> <span class="o">%&gt;%</span> group_by<span class="p">(</span>wyear<span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>snow_mm_cum<span class="o">=</span><span class="kp">cumsum</span><span class="p">(</span>snow_mm<span class="p">),</span> snow_na<span class="o">=</span><span class="kp">cumsum</span><span class="p">(</span>snow_na<span class="p">))</span> <span class="o">%&gt;%</span> ungroup<span class="p">()</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>snow_in_cum<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snow_mm_cum<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> snwd_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snwd_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">0</span><span class="p">))</span> nov_18_snow <span class="o">&lt;-</span> cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span>mmdd<span class="o">==</span><span class="s">&#39;Nov 18&#39;</span><span class="p">)</span> <span class="o">%&gt;%</span> select<span class="p">(</span>wyear<span class="p">,</span> snow_in_cum<span class="p">,</span> snwd_in<span class="p">)</span> <span class="o">%&gt;%</span> arrange<span class="p">(</span>snow_in_cum<span class="p">)</span> decadal_avg <span class="o">&lt;-</span> nov_18_snow <span class="o">%&gt;%</span> mutate<span class="p">(</span>decade<span class="o">=</span><span class="kp">as.integer</span><span class="p">(</span>wyear<span class="o">/</span><span class="m">10</span><span class="p">)</span><span class="o">*</span><span class="m">10</span><span class="p">)</span> <span class="o">%&gt;%</span> group_by<span class="p">(</span>decade<span class="p">)</span> <span class="o">%&gt;%</span> summarize<span class="p">(</span><span class="sb">`Snow depth`</span><span class="o">=</span><span class="kp">mean</span><span class="p">(</span>snwd_in<span class="p">),</span> snwd_sd<span class="o">=</span>sd<span class="p">(</span>snwd_in<span class="p">),</span> <span class="sb">`Cumulative Snowfall`</span><span class="o">=</span><span class="kp">mean</span><span class="p">(</span>snow_in_cum<span class="p">),</span> snow_cum_sd<span class="o">=</span>sd<span class="p">(</span>snow_in_cum<span class="p">))</span> decadal_averages <span class="o">&lt;-</span> ggplot<span class="p">(</span>decadal_avg <span class="o">%&gt;%</span> gather<span class="p">(</span>variable<span class="p">,</span> value<span class="p">,</span> <span class="o">-</span>decade<span class="p">)</span> <span class="o">%&gt;%</span> filter<span class="p">(</span>variable <span class="o">%in%</span> <span class="kt">c</span><span class="p">(</span><span class="s">&quot;Cumulative Snowfall&quot;</span><span class="p">,</span> <span class="s">&quot;Snow depth&quot;</span><span class="p">)),</span> aes<span class="p">(</span>x<span class="o">=</span><span class="kp">as.factor</span><span class="p">(</span>decade<span class="p">),</span> y<span class="o">=</span>value<span class="p">,</span> fill<span class="o">=</span>variable<span class="p">))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> geom_bar<span class="p">(</span>stat<span class="o">=</span><span class="s">&quot;identity&quot;</span><span class="p">,</span> position<span class="o">=</span><span class="s">&quot;dodge&quot;</span><span class="p">)</span> <span class="o">+</span> scale_x_discrete<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Decade&quot;</span><span class="p">,</span> breaks<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="m">1950</span><span class="p">,</span> <span class="m">1960</span><span class="p">,</span> <span class="m">1970</span><span class="p">,</span> <span class="m">1980</span><span class="p">,</span> <span class="m">1990</span><span class="p">,</span> <span class="m">2000</span><span class="p">,</span> <span class="m">2010</span><span class="p">))</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Inches&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">10</span><span class="p">))</span> <span class="o">+</span> scale_fill_discrete<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Measurement&quot;</span><span class="p">)</span> <span class="kp">print</span><span class="p">(</span>decadal_averages<span class="p">)</span> date_x_scale <span class="o">&lt;-</span> cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span><span class="kp">grepl</span><span class="p">(</span><span class="s">&#39; (01|15)&#39;</span><span class="p">,</span> mmdd<span class="p">),</span> wyear<span class="o">==</span><span class="s">&#39;1994&#39;</span><span class="p">)</span> <span class="o">%&gt;%</span> select<span class="p">(</span>wdoy<span class="p">,</span> mmdd<span class="p">)</span> cumulative_snowfall <span class="o">&lt;-</span> ggplot<span class="p">(</span>cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span>wyear <span class="o">%in%</span> <span class="kt">c</span><span class="p">(</span><span class="m">1953</span><span class="p">,</span> <span class="m">1954</span><span class="p">,</span> <span class="m">2014</span><span class="p">,</span> <span class="m">2006</span><span class="p">,</span> <span class="m">1990</span><span class="p">),</span> wdoy<span class="o">&gt;</span><span class="m">183</span><span class="p">,</span> wdoy<span class="o">&lt;</span><span class="m">320</span><span class="p">),</span> aes<span class="p">(</span>x<span class="o">=</span>wdoy<span class="p">,</span> y<span class="o">=</span>snow_in_cum<span class="p">,</span> colour<span class="o">=</span><span class="kp">as.factor</span><span class="p">(</span>wyear<span class="p">)))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> geom_smooth<span class="p">(</span>data<span class="o">=</span>cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span>wdoy<span class="o">&gt;</span><span class="m">183</span><span class="p">,</span> wdoy<span class="o">&lt;</span><span class="m">320</span><span class="p">),</span> aes<span class="p">(</span>x<span class="o">=</span>wdoy<span class="p">,</span> y<span class="o">=</span>snow_in_cum<span class="p">),</span> size<span class="o">=</span><span class="m">0.5</span><span class="p">,</span> colour<span class="o">=</span><span class="s">&quot;darkcyan&quot;</span><span class="p">,</span> inherit.aes<span class="o">=</span><span class="kc">FALSE</span><span class="p">,</span> se<span class="o">=</span><span class="kc">FALSE</span><span class="p">)</span> <span class="o">+</span> geom_line<span class="p">(</span>position<span class="o">=</span><span class="s">&quot;jitter&quot;</span><span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">,</span> breaks<span class="o">=</span>date_x_scale<span class="o">$</span>wdoy<span class="p">,</span> labels<span class="o">=</span>date_x_scale<span class="o">$</span>mmdd<span class="p">)</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Cumulative snowfall (in)&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">10</span><span class="p">))</span> <span class="o">+</span> scale_color_discrete<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Winter year&quot;</span><span class="p">)</span> <span class="kp">print</span><span class="p">(</span>cumulative_snowfall<span class="p">)</span> snow_depth <span class="o">&lt;-</span> ggplot<span class="p">(</span>cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span>wyear <span class="o">%in%</span> <span class="kt">c</span><span class="p">(</span><span class="m">1953</span><span class="p">,</span> <span class="m">1954</span><span class="p">,</span> <span class="m">1962</span><span class="p">,</span> <span class="m">2014</span><span class="p">,</span> <span class="m">1990</span><span class="p">),</span> wdoy<span class="o">&gt;</span><span class="m">183</span><span class="p">,</span> wdoy<span class="o">&lt;</span><span class="m">320</span><span class="p">),</span> aes<span class="p">(</span>x<span class="o">=</span>wdoy<span class="p">,</span> y<span class="o">=</span>snwd_in<span class="p">,</span> colour<span class="o">=</span><span class="kp">as.factor</span><span class="p">(</span>wyear<span class="p">)))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> geom_smooth<span class="p">(</span>data<span class="o">=</span>cum_snow <span class="o">%&gt;%</span> filter<span class="p">(</span>wdoy<span class="o">&gt;</span><span class="m">183</span><span class="p">,</span> wdoy<span class="o">&lt;</span><span class="m">320</span><span class="p">),</span> aes<span class="p">(</span>x<span class="o">=</span>wdoy<span class="p">,</span> y<span class="o">=</span>snwd_in<span class="p">),</span> size<span class="o">=</span><span class="m">0.5</span><span class="p">,</span> colour<span class="o">=</span><span class="s">&quot;darkcyan&quot;</span><span class="p">,</span> inherit.aes<span class="o">=</span><span class="kc">FALSE</span><span class="p">,</span> se<span class="o">=</span><span class="kc">FALSE</span><span class="p">)</span> <span class="o">+</span> geom_line<span class="p">(</span>position<span class="o">=</span><span class="s">&quot;jitter&quot;</span><span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">,</span> breaks<span class="o">=</span>date_x_scale<span class="o">$</span>wdoy<span class="p">,</span> labels<span class="o">=</span>date_x_scale<span class="o">$</span>mmdd<span class="p">)</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Snow Depth (in)&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">10</span><span class="p">))</span> <span class="o">+</span> scale_color_discrete<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Winter year&quot;</span><span class="p">)</span> <span class="kp">print</span><span class="p">(</span>snow_depth<span class="p">)</span> </pre></div> </div> </div> Sat, 19 Nov 2016 15:50:20 -0900 http://swingleydev.com/blog/p/2001/ snow depth snowfall weather climate R Fairbanks Race Pace Prediction http://swingleydev.com/blog/p/2000/ <div class="document"> <div class="figure align-right"> <a class="reference external image-reference" href="//swingleydev.com/photolog/p/876/"><img alt="Equinox Marathon Relay leg 2, 2016" src="//media.swingleydev.com/img/blog/2016/10/equinox_relay_leg_2_2016.jpg" style="width: 300px; height: 169px;" /></a> <p class="caption">Equinox Marathon Relay leg 2, 2016</p> </div> <div class="section" id="introduction"> <h1>Introduction</h1> <p>A couple years ago I compared racing data between two races (<a class="reference external" href="/blog/p/1967/">Gold Discovery and Equinox</a>, <a class="reference external" href="/blog/p/1968/">Santa Claus and Equinox</a>) in the same season for all runners that ran in both events. The result was an estimate of how fast I might run the Equinox Marathon based on my times for Gold Discovery and the Santa Claus Half Marathon.</p> <p>Several years have passed and I've run more races and collected more racing data for all the major Fairbanks races and wanted to run the same analysis for all combinations of races.</p> </div> <div class="section" id="data"> <h1>Data</h1> <p>The data comes from a database I’ve built of race times for all competitors, mostly coming from the results available from Chronotrack, but including some race results from SportAlaska.</p> <p>We started by loading the required R packages and reading in all the racing data, a small subset of which looks like this.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="23%" /> <col width="9%" /> <col width="24%" /> <col width="18%" /> <col width="17%" /> <col width="8%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">race</th> <th class="head">year</th> <th class="head">name</th> <th class="head">finish_time</th> <th class="head">birth_year</th> <th class="head">sex</th> </tr> </thead> <tbody valign="top"> <tr><td>Beat Beethoven</td> <td>2015</td> <td>thomas mcclelland</td> <td>00:21:49</td> <td>1995</td> <td>M</td> </tr> <tr><td>Equinox Marathon</td> <td>2015</td> <td>jennifer paniati</td> <td>06:24:14</td> <td>1989</td> <td>F</td> </tr> <tr><td>Equinox Marathon</td> <td>2014</td> <td>kris starkey</td> <td>06:35:55</td> <td>1972</td> <td>F</td> </tr> <tr><td>Midnight Sun Run</td> <td>2014</td> <td>kathy toohey</td> <td>01:10:42</td> <td>1960</td> <td>F</td> </tr> <tr><td>Midnight Sun Run</td> <td>2016</td> <td>steven rast</td> <td>01:59:41</td> <td>1960</td> <td>M</td> </tr> <tr><td>Equinox Marathon</td> <td>2013</td> <td>elizabeth smith</td> <td>09:18:53</td> <td>1987</td> <td>F</td> </tr> <tr><td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> </tr> </tbody> </table> <p>Next we loaded in the names and distances of the races and combined this with the individual racing data. The data from Chronotrack doesn’t include the mileage and we will need that to calculate pace (minutes per mile).</p> <p>My database doesn’t have complete information about all the racers that competed, and in some cases the information for a runner in one race conflicts with the information for the same runner in a different race. In order to resolve this, we generated a list of runners, grouped by their name, and threw out racers where their name matches but their gender was reported differently from one race to the next. Please understand we’re not doing this to exclude those who have changed their gender identity along the way, but to eliminate possible bias from data entry mistakes.</p> <p>Finally, we combined the racers with the individual racing data, substituting our corrected runner information for what appeared in the individual race’s data. We also calculated minutes per mile (<tt class="docutils literal">pace</tt>) and the age of the runner during the year of the race (<tt class="docutils literal">age</tt>). Because we’re assigning a birth year to the minimum reported year from all races, our age variable won’t change during the running season, which is closer to the way age categories are calculated in Europe. Finally, we removed results where pace was greater than 20 minutes per mile for races longer than ten miles, and greater than 16 minute miles for races less than ten miles. These are likely to be outliers, or competitors not running the race.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="14%" /> <col width="13%" /> <col width="10%" /> <col width="23%" /> <col width="8%" /> <col width="9%" /> <col width="9%" /> <col width="7%" /> <col width="7%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">name</th> <th class="head">birth_year</th> <th class="head">gender</th> <th class="head">race_str</th> <th class="head">year</th> <th class="head">miles</th> <th class="head">minutes</th> <th class="head">pace</th> <th class="head">age</th> </tr> </thead> <tbody valign="top"> <tr><td>aaron austin</td> <td>1983</td> <td>M</td> <td>midnight_sun_run</td> <td>2014</td> <td>6.2</td> <td>50.60</td> <td>8.16</td> <td>31</td> </tr> <tr><td>aaron bravo</td> <td>1999</td> <td>M</td> <td>midnight_sun_run</td> <td>2013</td> <td>6.2</td> <td>45.26</td> <td>7.30</td> <td>14</td> </tr> <tr><td>aaron bravo</td> <td>1999</td> <td>M</td> <td>midnight_sun_run</td> <td>2014</td> <td>6.2</td> <td>40.08</td> <td>6.46</td> <td>15</td> </tr> <tr><td>aaron bravo</td> <td>1999</td> <td>M</td> <td>midnight_sun_run</td> <td>2015</td> <td>6.2</td> <td>36.65</td> <td>5.91</td> <td>16</td> </tr> <tr><td>aaron bravo</td> <td>1999</td> <td>M</td> <td>midnight_sun_run</td> <td>2016</td> <td>6.2</td> <td>36.31</td> <td>5.85</td> <td>17</td> </tr> <tr><td>aaron bravo</td> <td>1999</td> <td>M</td> <td>spruce_tree_classic</td> <td>2014</td> <td>6.0</td> <td>42.17</td> <td>7.03</td> <td>15</td> </tr> <tr><td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> </tr> </tbody> </table> <p>We combined all available results for each runner in all years they participated such that the resulting rows are grouped by runner and year and columns are the races themselves. The values in each cell represent the pace for the runner × year × race combination.</p> <p>For example, here’s the first six rows for runners that completed Beat Beethoven and the Chena River Run in the years I have data. I also included the column for the Midnight Sun Run in the table, but the actual data has a column for all the major Fairbanks races. You’ll see that two of the six runners listed ran BB and CRR but didn’t run MSR in that year.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="17%" /> <col width="10%" /> <col width="7%" /> <col width="8%" /> <col width="18%" /> <col width="20%" /> <col width="21%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">name</th> <th class="head">gender</th> <th class="head">age</th> <th class="head">year</th> <th class="head">beat_beethoven</th> <th class="head">chena_river_run</th> <th class="head">midnight_sun_run</th> </tr> </thead> <tbody valign="top"> <tr><td>aaron schooley</td> <td>M</td> <td>36</td> <td>2016</td> <td>8.19</td> <td>8.15</td> <td>8.88</td> </tr> <tr><td>abby fett</td> <td>F</td> <td>33</td> <td>2014</td> <td>10.68</td> <td>10.34</td> <td>11.59</td> </tr> <tr><td>abby fett</td> <td>F</td> <td>35</td> <td>2016</td> <td>11.97</td> <td>12.58</td> <td>NA</td> </tr> <tr><td>abigail haas</td> <td>F</td> <td>11</td> <td>2015</td> <td>9.34</td> <td>8.29</td> <td>NA</td> </tr> <tr><td>abigail haas</td> <td>F</td> <td>12</td> <td>2016</td> <td>8.48</td> <td>7.90</td> <td>11.40</td> </tr> <tr><td>aimee hughes</td> <td>F</td> <td>43</td> <td>2015</td> <td>11.32</td> <td>9.50</td> <td>10.69</td> </tr> <tr><td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> </tr> </tbody> </table> <p>With this data, we build a whole series of linear models, one for each race combination. We created a series of formula strings and objects for all the combinations, then executed them using <tt class="docutils literal">map()</tt>. We combined the start and predicted race names with the linear models, and used <tt class="docutils literal">glance()</tt> and <tt class="docutils literal">tidy()</tt> from the <tt class="docutils literal">broom</tt> package to turn the models into statistics and coefficients.</p> <p>All of the models between races were highly significant, but many of them contain coefficients that aren’t significantly different than zero. That means that including that term (age, gender or first race pace) isn’t adding anything useful to the model. We used the significance of each term to reduce our models so they only contained coefficients that were significant and regenerated the statistics and coefficients for these reduced models.</p> <p>The full R code appears at the bottom of this post.</p> </div> <div class="section" id="results"> <h1>Results</h1> <p>Here’s the statistics from the ten best performing models (based on <em>R²</em> ).</p> <table border="1" class="tosf docutils"> <colgroup> <col width="36%" /> <col width="36%" /> <col width="6%" /> <col width="8%" /> <col width="13%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">start_race</th> <th class="head">predicted_race</th> <th class="head">n</th> <th class="head"><em>R²</em></th> <th class="head"><em>p</em>-value</th> </tr> </thead> <tbody valign="top"> <tr><td>run_of_the_valkyries</td> <td>golden_heart_trail_run</td> <td>40</td> <td>0.956</td> <td>0</td> </tr> <tr><td>golden_heart_trail_run</td> <td>equinox_marathon</td> <td>36</td> <td>0.908</td> <td>0</td> </tr> <tr><td>santa_claus_half_marathon</td> <td>golden_heart_trail_run</td> <td>34</td> <td>0.896</td> <td>0</td> </tr> <tr><td>midnight_sun_run</td> <td>gold_discovery_run</td> <td>139</td> <td>0.887</td> <td>0</td> </tr> <tr><td>beat_beethoven</td> <td>golden_heart_trail_run</td> <td>32</td> <td>0.886</td> <td>0</td> </tr> <tr><td>run_of_the_valkyries</td> <td>gold_discovery_run</td> <td>44</td> <td>0.877</td> <td>0</td> </tr> <tr><td>midnight_sun_run</td> <td>golden_heart_trail_run</td> <td>52</td> <td>0.877</td> <td>0</td> </tr> <tr><td>gold_discovery_run</td> <td>santa_claus_half_marathon</td> <td>111</td> <td>0.876</td> <td>0</td> </tr> <tr><td>chena_river_run</td> <td>golden_heart_trail_run</td> <td>44</td> <td>0.873</td> <td>0</td> </tr> <tr><td>run_of_the_valkyries</td> <td>santa_claus_half_marathon</td> <td>91</td> <td>0.851</td> <td>0</td> </tr> </tbody> </table> <p>It’s interesting how many times the Golden Heart Trail Run appears on this list since that run is something of an outlier in the Usibelli running series because it’s the only race entirely on trails. Maybe it’s because it’s distance (5K) is comparable with a lot of the earlier races in the season, but because it’s on trails it matches well with the later races that are at least partially on trails like Gold Discovery or Equinox.</p> <p>Here are the ten worst models.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="32%" /> <col width="38%" /> <col width="6%" /> <col width="9%" /> <col width="14%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">start_race</th> <th class="head">predicted_race</th> <th class="head">n</th> <th class="head"><em>R²</em></th> <th class="head"><em>p</em>-value</th> </tr> </thead> <tbody valign="top"> <tr><td>midnight_sun_run</td> <td>equinox_marathon</td> <td>431</td> <td>0.525</td> <td>0</td> </tr> <tr><td>beat_beethoven</td> <td>hoodoo_half_marathon</td> <td>87</td> <td>0.533</td> <td>0</td> </tr> <tr><td>beat_beethoven</td> <td>midnight_sun_run</td> <td>818</td> <td>0.570</td> <td>0</td> </tr> <tr><td>chena_river_run</td> <td>equinox_marathon</td> <td>196</td> <td>0.572</td> <td>0</td> </tr> <tr><td>equinox_marathon</td> <td>hoodoo_half_marathon</td> <td>90</td> <td>0.584</td> <td>0</td> </tr> <tr><td>beat_beethoven</td> <td>equinox_marathon</td> <td>265</td> <td>0.585</td> <td>0</td> </tr> <tr><td>gold_discovery_run</td> <td>hoodoo_half_marathon</td> <td>41</td> <td>0.599</td> <td>0</td> </tr> <tr><td>beat_beethoven</td> <td>santa_claus_half_marathon</td> <td>163</td> <td>0.612</td> <td>0</td> </tr> <tr><td>run_of_the_valkyries</td> <td>equinox_marathon</td> <td>125</td> <td>0.642</td> <td>0</td> </tr> <tr><td>midnight_sun_run</td> <td>hoodoo_half_marathon</td> <td>118</td> <td>0.657</td> <td>0</td> </tr> </tbody> </table> <p>Most of these models are shorter races like Beat Beethoven or the Chena River Run predicting longer races like Equinox or one of the half marathons. Even so, each model explains more than half the variation in the data, which isn’t terrible.</p> </div> <div class="section" id="application"> <h1>Application</h1> <p>Now that we have all our models and their coefficients, we used these models to make predictions of future performance. I’ve written an online calculator based on the reduced models that let you predict your race results as you go through the running season. The calculator is here: <a class="reference external" href="https://swingleydev.com/misc/fairbanks_race_conversion.html">Fairbanks Running Race Converter</a>.</p> <p>For example, I ran a 7:41 pace for Run of the Valkyries this year. Entering that, plus my age and gender into the converter predicts an 8:57 pace for the first running of the HooDoo Half Marathon. The <em>R²</em> for this model was a respectable 0.71 even though only 23 runners ran both races this year (including me). My actual pace for HooDoo was 8:18, so I came in quite a bit faster than this. No wonder my knee and hip hurt after the race! Using my time from the Golden Heart Trail Run, the converter predicts a HooDoo Half pace of 8:16.2, less than a minute off my 1:48:11 finish.</p> </div> <div class="section" id="appendix-r-code"> <h1>Appendix: R code</h1> <div class="highlight"><pre><span class="kn">library</span><span class="p">(</span>tidyverse<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>lubridate<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>broom<span class="p">)</span> races_db <span class="o">&lt;-</span> src_postgres<span class="p">(</span>host<span class="o">=</span><span class="s">&quot;localhost&quot;</span><span class="p">,</span> dbname<span class="o">=</span><span class="s">&quot;races&quot;</span><span class="p">)</span> combined_races <span class="o">&lt;-</span> tbl<span class="p">(</span>races_db<span class="p">,</span> build_sql<span class="p">(</span> <span class="s">&quot;SELECT race, year, lower(name) AS name, finish_time,</span> <span class="s"> year - age AS birth_year, sex</span> <span class="s"> FROM chronotrack</span> <span class="s"> UNION</span> <span class="s"> SELECT race, year, lower(name) AS name, finish_time,</span> <span class="s"> birth_year,</span> <span class="s"> CASE WHEN age_class ~ &#39;M&#39; THEN &#39;M&#39; ELSE &#39;F&#39; END AS sex</span> <span class="s"> FROM sportalaska</span> <span class="s"> UNION</span> <span class="s"> SELECT race, year, lower(name) AS name, finish_time,</span> <span class="s"> NULL AS birth_year, NULL AS sex</span> <span class="s"> FROM other&quot;</span><span class="p">))</span> races <span class="o">&lt;-</span> tbl<span class="p">(</span>races_db<span class="p">,</span> build_sql<span class="p">(</span> <span class="s">&quot;SELECT race,</span> <span class="s"> lower(regexp_replace(race, &#39;[ ’]&#39;, &#39;_&#39;, &#39;g&#39;)) AS race_str,</span> <span class="s"> date_part(&#39;year&#39;, date) AS year,</span> <span class="s"> miles</span> <span class="s"> FROM races&quot;</span><span class="p">))</span> racing_data <span class="o">&lt;-</span> combined_races <span class="o">%&gt;%</span> inner_join<span class="p">(</span>races<span class="p">)</span> <span class="o">%&gt;%</span> filter<span class="p">(</span><span class="o">!</span><span class="kp">is.na</span><span class="p">(</span>finish_time<span class="p">))</span> racers <span class="o">&lt;-</span> racing_data <span class="o">%&gt;%</span> group_by<span class="p">(</span>name<span class="p">)</span> <span class="o">%&gt;%</span> summarize<span class="p">(</span>races<span class="o">=</span>n<span class="p">(),</span> birth_year<span class="o">=</span><span class="kp">min</span><span class="p">(</span>birth_year<span class="p">),</span> gender_filter<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span><span class="kp">sum</span><span class="p">(</span><span class="kp">ifelse</span><span class="p">(</span>sex<span class="o">==</span><span class="s">&#39;M&#39;</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="m">0</span><span class="p">))</span><span class="o">==</span> <span class="kp">sum</span><span class="p">(</span><span class="kp">ifelse</span><span class="p">(</span>sex<span class="o">==</span><span class="s">&#39;F&#39;</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="m">0</span><span class="p">)),</span> <span class="kc">FALSE</span><span class="p">,</span> <span class="kc">TRUE</span><span class="p">),</span> gender<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span><span class="kp">sum</span><span class="p">(</span><span class="kp">ifelse</span><span class="p">(</span>sex<span class="o">==</span><span class="s">&#39;M&#39;</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="m">0</span><span class="p">))</span><span class="o">&gt;</span> <span class="kp">sum</span><span class="p">(</span><span class="kp">ifelse</span><span class="p">(</span>sex<span class="o">==</span><span class="s">&#39;F&#39;</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="m">0</span><span class="p">)),</span> <span class="s">&#39;M&#39;</span><span class="p">,</span> <span class="s">&#39;F&#39;</span><span class="p">))</span> <span class="o">%&gt;%</span> ungroup<span class="p">()</span> <span class="o">%&gt;%</span> filter<span class="p">(</span>gender_filter<span class="p">)</span> <span class="o">%&gt;%</span> select<span class="p">(</span><span class="o">-</span>gender_filter<span class="p">)</span> racing_data_filled <span class="o">&lt;-</span> racing_data <span class="o">%&gt;%</span> inner_join<span class="p">(</span>racers<span class="p">,</span> by<span class="o">=</span><span class="s">&quot;name&quot;</span><span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>birth_year<span class="o">=</span>birth_year.y<span class="p">)</span> <span class="o">%&gt;%</span> select<span class="p">(</span>name<span class="p">,</span> birth_year<span class="p">,</span> gender<span class="p">,</span> race_str<span class="p">,</span> year<span class="p">,</span> miles<span class="p">,</span> finish_time<span class="p">)</span> <span class="o">%&gt;%</span> group_by<span class="p">(</span>name<span class="p">,</span> race_str<span class="p">,</span> year<span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>n<span class="o">=</span>n<span class="p">())</span> <span class="o">%&gt;%</span> filter<span class="p">(</span><span class="o">!</span><span class="kp">is.na</span><span class="p">(</span>birth_year<span class="p">),</span> n<span class="o">==</span><span class="m">1</span><span class="p">)</span> <span class="o">%&gt;%</span> ungroup<span class="p">()</span> <span class="o">%&gt;%</span> collect<span class="p">()</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>fixed<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span><span class="kp">grepl</span><span class="p">(</span><span class="s">&#39;[0-9]+:[0-9]+:[0-9.]+&#39;</span><span class="p">,</span> finish_time<span class="p">),</span> finish_time<span class="p">,</span> <span class="kp">paste0</span><span class="p">(</span><span class="s">&#39;00:&#39;</span><span class="p">,</span> finish_time<span class="p">)),</span> minutes<span class="o">=</span><span class="kp">as.numeric</span><span class="p">(</span>seconds<span class="p">(</span>hms<span class="p">(</span>fixed<span class="p">)))</span><span class="o">/</span><span class="m">60.0</span><span class="p">,</span> pace<span class="o">=</span>minutes<span class="o">/</span>miles<span class="p">,</span> age<span class="o">=</span>year<span class="o">-</span>birth_year<span class="p">,</span> age_class<span class="o">=</span><span class="kp">as.integer</span><span class="p">(</span>age<span class="o">/</span><span class="m">10</span><span class="p">)</span><span class="o">*</span><span class="m">10</span><span class="p">,</span> group<span class="o">=</span><span class="kp">paste0</span><span class="p">(</span>gender<span class="p">,</span> age_class<span class="p">),</span> gender<span class="o">=</span><span class="kp">as.factor</span><span class="p">(</span>gender<span class="p">))</span> <span class="o">%&gt;%</span> filter<span class="p">((</span>miles<span class="o">&lt;</span><span class="m">10</span> <span class="o">&amp;</span> pace<span class="o">&lt;</span><span class="m">16</span><span class="p">)</span> <span class="o">|</span> <span class="p">(</span>miles<span class="o">&gt;=</span><span class="m">10</span> <span class="o">&amp;</span> pace<span class="o">&lt;</span><span class="m">20</span><span class="p">))</span> <span class="o">%&gt;%</span> select<span class="p">(</span><span class="o">-</span>fixed<span class="p">,</span> <span class="o">-</span>finish_time<span class="p">,</span> <span class="o">-</span>n<span class="p">)</span> speeds_combined <span class="o">&lt;-</span> racing_data_filled <span class="o">%&gt;%</span> select<span class="p">(</span>name<span class="p">,</span> gender<span class="p">,</span> age<span class="p">,</span> age_class<span class="p">,</span> group<span class="p">,</span> race_str<span class="p">,</span> year<span class="p">,</span> pace<span class="p">)</span> <span class="o">%&gt;%</span> spread<span class="p">(</span>race_str<span class="p">,</span> pace<span class="p">)</span> main_races <span class="o">&lt;-</span> <span class="kt">c</span><span class="p">(</span><span class="s">&#39;beat_beethoven&#39;</span><span class="p">,</span> <span class="s">&#39;chena_river_run&#39;</span><span class="p">,</span> <span class="s">&#39;midnight_sun_run&#39;</span><span class="p">,</span> <span class="s">&#39;run_of_the_valkyries&#39;</span><span class="p">,</span> <span class="s">&#39;gold_discovery_run&#39;</span><span class="p">,</span> <span class="s">&#39;santa_claus_half_marathon&#39;</span><span class="p">,</span> <span class="s">&#39;golden_heart_trail_run&#39;</span><span class="p">,</span> <span class="s">&#39;equinox_marathon&#39;</span><span class="p">,</span> <span class="s">&#39;hoodoo_half_marathon&#39;</span><span class="p">)</span> race_formula_str <span class="o">&lt;-</span> <span class="kp">lapply</span><span class="p">(</span><span class="kp">seq</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="kp">length</span><span class="p">(</span>main_races<span class="p">)</span><span class="m">-1</span><span class="p">),</span> <span class="kr">function</span><span class="p">(</span>i<span class="p">)</span> <span class="kp">lapply</span><span class="p">(</span><span class="kp">seq</span><span class="p">(</span>i<span class="m">+1</span><span class="p">,</span> <span class="kp">length</span><span class="p">(</span>main_races<span class="p">)),</span> <span class="kr">function</span><span class="p">(</span>j<span class="p">)</span> <span class="kp">paste</span><span class="p">(</span>main_races<span class="p">[[</span>j<span class="p">]],</span> <span class="s">&#39;~&#39;</span><span class="p">,</span> main_races<span class="p">[[</span>i<span class="p">]],</span> <span class="s">&#39;+ gender&#39;</span><span class="p">,</span> <span class="s">&#39;+ age&#39;</span><span class="p">)))</span> <span class="o">%&gt;%</span> <span class="kp">unlist</span><span class="p">()</span> race_formulas <span class="o">&lt;-</span> <span class="kp">lapply</span><span class="p">(</span>race_formula_str<span class="p">,</span> <span class="kr">function</span><span class="p">(</span>i<span class="p">)</span> as.formula<span class="p">(</span>i<span class="p">))</span> <span class="o">%&gt;%</span> <span class="kp">unlist</span><span class="p">()</span> lm_models <span class="o">&lt;-</span> map<span class="p">(</span>race_formulas<span class="p">,</span> <span class="o">~</span> lm<span class="p">(</span><span class="m">.</span>x<span class="p">,</span> data<span class="o">=</span>speeds_combined<span class="p">))</span> models <span class="o">&lt;-</span> tibble<span class="p">(</span>start_race<span class="o">=</span><span class="kp">factor</span><span class="p">(</span><span class="kp">gsub</span><span class="p">(</span><span class="s">&#39;.* ~ ([^ ]+).*&#39;</span><span class="p">,</span> <span class="s">&#39;\\1&#39;</span><span class="p">,</span> race_formula_str<span class="p">),</span> levels<span class="o">=</span>main_races<span class="p">),</span> predicted_race<span class="o">=</span><span class="kp">factor</span><span class="p">(</span><span class="kp">gsub</span><span class="p">(</span><span class="s">&#39;([^ ]+).*&#39;</span><span class="p">,</span> <span class="s">&#39;\\1&#39;</span><span class="p">,</span> race_formula_str<span class="p">),</span> levels<span class="o">=</span>main_races<span class="p">),</span> lm_models<span class="o">=</span>lm_models<span class="p">)</span> <span class="o">%&gt;%</span> arrange<span class="p">(</span>start_race<span class="p">,</span> predicted_race<span class="p">)</span> model_stats <span class="o">&lt;-</span> glance<span class="p">(</span>models <span class="o">%&gt;%</span> rowwise<span class="p">(),</span> lm_models<span class="p">)</span> model_coefficients <span class="o">&lt;-</span> tidy<span class="p">(</span>models <span class="o">%&gt;%</span> rowwise<span class="p">(),</span> lm_models<span class="p">)</span> reduced_formula_str <span class="o">&lt;-</span> model_coefficients <span class="o">%&gt;%</span> ungroup<span class="p">()</span> <span class="o">%&gt;%</span> filter<span class="p">(</span>p.value<span class="o">&lt;</span><span class="m">0.05</span><span class="p">,</span> term<span class="o">!=</span><span class="s">&#39;(Intercept)&#39;</span><span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>term<span class="o">=</span><span class="kp">gsub</span><span class="p">(</span><span class="s">&#39;genderM&#39;</span><span class="p">,</span> <span class="s">&#39;gender&#39;</span><span class="p">,</span> term<span class="p">))</span> <span class="o">%&gt;%</span> group_by<span class="p">(</span>predicted_race<span class="p">,</span> start_race<span class="p">)</span> <span class="o">%&gt;%</span> summarize<span class="p">(</span>independent_vars<span class="o">=</span><span class="kp">paste</span><span class="p">(</span>term<span class="p">,</span> collapse<span class="o">=</span><span class="s">&quot; + &quot;</span><span class="p">))</span> <span class="o">%&gt;%</span> ungroup<span class="p">()</span> <span class="o">%&gt;%</span> transmute<span class="p">(</span>reduced_formulas<span class="o">=</span><span class="kp">paste</span><span class="p">(</span>predicted_race<span class="p">,</span> independent_vars<span class="p">,</span> sep<span class="o">=</span><span class="s">&#39; ~ &#39;</span><span class="p">))</span> reduced_formula_str <span class="o">&lt;-</span> reduced_formula_str<span class="o">$</span>reduced_formulas reduced_race_formulas <span class="o">&lt;-</span> <span class="kp">lapply</span><span class="p">(</span>reduced_formula_str<span class="p">,</span> <span class="kr">function</span><span class="p">(</span>i<span class="p">)</span> as.formula<span class="p">(</span>i<span class="p">))</span> <span class="o">%&gt;%</span> <span class="kp">unlist</span><span class="p">()</span> reduced_lm_models <span class="o">&lt;-</span> map<span class="p">(</span>reduced_race_formulas<span class="p">,</span> <span class="o">~</span> lm<span class="p">(</span><span class="m">.</span>x<span class="p">,</span> data<span class="o">=</span>speeds_combined<span class="p">))</span> n_from_lm <span class="o">&lt;-</span> <span class="kr">function</span><span class="p">(</span>model<span class="p">)</span> <span class="p">{</span> summary_object <span class="o">&lt;-</span> <span class="kp">summary</span><span class="p">(</span>model<span class="p">)</span> summary_object<span class="o">$</span>df<span class="p">[</span><span class="m">1</span><span class="p">]</span> <span class="o">+</span> summary_object<span class="o">$</span>df<span class="p">[</span><span class="m">2</span><span class="p">]</span> <span class="p">}</span> reduced_models <span class="o">&lt;-</span> tibble<span class="p">(</span>start_race<span class="o">=</span><span class="kp">factor</span><span class="p">(</span><span class="kp">gsub</span><span class="p">(</span><span class="s">&#39;.* ~ ([^ ]+).*&#39;</span><span class="p">,</span> <span class="s">&#39;\\1&#39;</span><span class="p">,</span> reduced_formula_str<span class="p">),</span> levels<span class="o">=</span>main_races<span class="p">),</span> predicted_race<span class="o">=</span><span class="kp">factor</span><span class="p">(</span><span class="kp">gsub</span><span class="p">(</span><span class="s">&#39;([^ ]+).*&#39;</span><span class="p">,</span> <span class="s">&#39;\\1&#39;</span><span class="p">,</span> reduced_formula_str<span class="p">),</span> levels<span class="o">=</span>main_races<span class="p">),</span> lm_models<span class="o">=</span>reduced_lm_models<span class="p">)</span> <span class="o">%&gt;%</span> arrange<span class="p">(</span>start_race<span class="p">,</span> predicted_race<span class="p">)</span> <span class="o">%&gt;%</span> rowwise<span class="p">()</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>n<span class="o">=</span>n_from_lm<span class="p">(</span>lm_models<span class="p">))</span> reduced_model_stats <span class="o">&lt;-</span> glance<span class="p">(</span>reduced_models <span class="o">%&gt;%</span> rowwise<span class="p">(),</span> lm_models<span class="p">)</span> reduced_model_coefficients <span class="o">&lt;-</span> tidy<span class="p">(</span>reduced_models <span class="o">%&gt;%</span> rowwise<span class="p">(),</span> lm_models<span class="p">)</span> <span class="o">%&gt;%</span> ungroup<span class="p">()</span> coefficients_and_stats <span class="o">&lt;-</span> reduced_model_stats <span class="o">%&gt;%</span> inner_join<span class="p">(</span>reduced_model_coefficients<span class="p">,</span> by<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="s">&quot;start_race&quot;</span><span class="p">,</span> <span class="s">&quot;predicted_race&quot;</span><span class="p">,</span> <span class="s">&quot;n&quot;</span><span class="p">))</span> <span class="o">%&gt;%</span> select<span class="p">(</span>start_race<span class="p">,</span> predicted_race<span class="p">,</span> n<span class="p">,</span> r.squared<span class="p">,</span> term<span class="p">,</span> estimate<span class="p">)</span> write_csv<span class="p">(</span>coefficients_and_stats<span class="p">,</span> <span class="s">&quot;coefficients.csv&quot;</span><span class="p">)</span> make_scatterplot <span class="o">&lt;-</span> <span class="kr">function</span><span class="p">(</span>start_race<span class="p">,</span> predicted_race<span class="p">)</span> <span class="p">{</span> age_limits <span class="o">&lt;-</span> speeds_combined <span class="o">%&gt;%</span> filter_<span class="p">(</span><span class="kp">paste</span><span class="p">(</span><span class="s">&quot;!is.na(&quot;</span><span class="p">,</span> start_race<span class="p">,</span> <span class="s">&quot;)&quot;</span><span class="p">),</span> <span class="kp">paste</span><span class="p">(</span><span class="s">&quot;!is.na(&quot;</span><span class="p">,</span> predicted_race<span class="p">,</span> <span class="s">&quot;)&quot;</span><span class="p">))</span> <span class="o">%&gt;%</span> summarize<span class="p">(</span>min<span class="o">=</span><span class="kp">min</span><span class="p">(</span>age<span class="p">),</span> max<span class="o">=</span><span class="kp">max</span><span class="p">(</span>age<span class="p">))</span> <span class="o">%&gt;%</span> <span class="kp">unlist</span><span class="p">()</span> q <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>speeds_combined<span class="p">,</span> aes_string<span class="p">(</span>x<span class="o">=</span>start_race<span class="p">,</span> y<span class="o">=</span>predicted_race<span class="p">))</span> <span class="o">+</span> <span class="c1"># plasma works better with a grey background</span> <span class="c1"># theme_bw() +</span> geom_abline<span class="p">(</span>slope<span class="o">=</span><span class="m">1</span><span class="p">,</span> color<span class="o">=</span><span class="s">&quot;darkred&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.5</span><span class="p">)</span> <span class="o">+</span> geom_smooth<span class="p">(</span>method<span class="o">=</span><span class="s">&quot;lm&quot;</span><span class="p">,</span> se<span class="o">=</span><span class="kc">FALSE</span><span class="p">)</span> <span class="o">+</span> geom_point<span class="p">(</span>aes<span class="p">(</span>shape<span class="o">=</span>gender<span class="p">,</span> color<span class="o">=</span>age<span class="p">))</span> <span class="o">+</span> scale_color_viridis<span class="p">(</span>option<span class="o">=</span><span class="s">&quot;plasma&quot;</span><span class="p">,</span> limits<span class="o">=</span>age_limits<span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">10</span><span class="p">))</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">6</span><span class="p">))</span> svg_filename <span class="o">&lt;-</span> <span class="kp">paste0</span><span class="p">(</span><span class="kp">paste</span><span class="p">(</span>start_race<span class="p">,</span> predicted_race<span class="p">,</span> sep<span class="o">=</span><span class="s">&quot;-&quot;</span><span class="p">),</span> <span class="s">&quot;.svg&quot;</span><span class="p">)</span> height <span class="o">&lt;-</span> <span class="m">9</span> width <span class="o">&lt;-</span> <span class="m">16</span> resize <span class="o">&lt;-</span> <span class="m">0.75</span> svg<span class="p">(</span>svg_filename<span class="p">,</span> height<span class="o">=</span>height<span class="o">*</span>resize<span class="p">,</span> width<span class="o">=</span>width<span class="o">*</span>resize<span class="p">)</span> <span class="kp">print</span><span class="p">(</span><span class="kp">q</span><span class="p">)</span> dev.off<span class="p">()</span> <span class="p">}</span> <span class="kp">lapply</span><span class="p">(</span><span class="kp">seq</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="kp">length</span><span class="p">(</span>main_races<span class="p">)</span><span class="m">-1</span><span class="p">),</span> <span class="kr">function</span><span class="p">(</span>i<span class="p">)</span> <span class="kp">lapply</span><span class="p">(</span><span class="kp">seq</span><span class="p">(</span>i<span class="m">+1</span><span class="p">,</span> <span class="kp">length</span><span class="p">(</span>main_races<span class="p">)),</span> <span class="kr">function</span><span class="p">(</span>j<span class="p">)</span> make_scatterplot<span class="p">(</span>main_races<span class="p">[[</span>i<span class="p">]],</span> main_races<span class="p">[[</span>j<span class="p">]])</span> <span class="p">)</span> </pre></div> </div> </div> Sat, 29 Oct 2016 21:14:02 -0800 http://swingleydev.com/blog/p/2000/ running R races statistics data science Equinox Marathon Weather http://swingleydev.com/blog/p/1999/ <div class="document"> <div class="section" id="introduction"> <h1>Introduction</h1> <p>Andrea and I are running the <a class="reference external" href="https://equinoxmarathon.org">Equinox Marathon</a> relay this Saturday with Norwegian dog musher Halvor Hoveid. He’s running the first leg, I’m running the second, and Andrea finishes the race. I ran the second leg as a training run a couple weeks ago and feel good about my physical conditioning, but the weather is always a concern this late in the fall, especially up on top of Ester Dome, where it can be dramatically different than the valley floor where the race starts and ends.</p> <p>Andrea ran the full marathon in 2009—2012 and the relay in 2008 and 2013—2015. I ran the full marathon in 2013. There was snow on the trail when I ran it, making the out and back section slippery and treacherous, and the cold temperatures at the start meant my feet were frozen until I got off of the single-track, nine or ten miles into the course. In other years, rain turned the powerline section to sloppy mud, or cold temperatures and freezing rain up on the Dome made it unpleasant for runners and supporters.</p> <p>In this post we will examine the available weather data, looking at the range of conditions we could experience this weekend. The current forecast from the National Weather Service is calling for mostly cloudy skies with highs in the 50s. Low temperatures the night before are predicted to be in the 40s, with rain in the forecast between now and then.</p> </div> <div class="section" id="methods"> <h1>Methods</h1> <p>There is no long term climate data for Ester Dome, but there are several valley-level stations with data going back to the start of the race in 1963. The best data comes from the Fairbanks Airport station and includes daily temperature, precipitation, and snowfall for all years, and wind speed and direction since 1984. I also looked at the data from the College Observatory station (FAOA2) behind the GI on campus and the University Experimental Farm, also on campus, but neither of these stations have a complete record. The daily data is part of the <a class="reference external" href="https://data.noaa.gov/dataset/global-historical-climatology-network-daily-ghcn-daily-version-3">Global Historical Climatology Network - Daily dataset</a>.</p> <p>I also have hourly data from 2008—2013 for both the Fairbanks Airport and a station located on Ester Dome that is no longer operational. We’ll use this to get a sense of what the possible temperatures on Ester Dome might have been based on the Fairbanks Airport data. Hourly data comes from the <a class="reference external" href="https://madis.noaa.gov">Meterological Assimilation Data Ingest System (MADIS)</a>.</p> <p>The R code used for this post appears at the bottom, and all the data used is available from <a class="reference external" href="//media.swingleydev.com/img/blog/2016/09/equinox_weather.tar.gz">here</a>.</p> </div> <div class="section" id="results"> <h1>Results</h1> <div class="section" id="ester-dome-temperatures"> <h2>Ester Dome temperatures</h2> <p>Since there isn’t a long-running weather station on Ester Dome (at least not one that’s publicly available), we’ll use the September data from an hourly Ester Dome station that was operational until 2014. If we join the Fairbanks Airport station data with this data wherever the observations are within 30 minutes of each other, we can see the relationship between Ester Dome temperature and temperature at the Fairbanks Airport.</p> <p>Here’s what that relationship looks like, including a linear regression line between the two. The shaded area in the lower left corner shows the region where the temperatures on Ester Dome are below freezing.</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/09/pafa_fbsa_sept_temps.pdf"><img alt="Ester Dome and Fairbanks Airport temperatures" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/09/pafa_fbsa_sept_temps.svgz" /></a> </div> <p>And the regression:</p> <pre class="literal-block"> ## ## Call: ## lm(formula = ester_dome_temp_f ~ pafa_temp_f, data = pafa_fbsa) ## ## Residuals: ## Min 1Q Median 3Q Max ## -9.649 -3.618 -1.224 2.486 22.138 ## ## Coefficients: ## Estimate Std. Error t value Pr(&gt;|t|) ## (Intercept) -2.69737 0.77993 -3.458 0.000572 *** ## pafa_temp_f 0.94268 0.01696 55.567 &lt; 2e-16 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 5.048 on 803 degrees of freedom ## Multiple R-squared: 0.7936, Adjusted R-squared: 0.7934 ## F-statistic: 3088 on 1 and 803 DF, p-value: &lt; 2.2e-16 </pre> <p>The regression model is highly significant, as are both coefficients, and the relationship explains almost 80% of the variation in the data. According to the model, in the month of September, Ester Dome average temperature is almost three degrees colder than at the airport. And whenever temperature at the airport drops below 37 degrees, it’s probably below freezing on the Dome.</p> </div> <div class="section" id="race-day-weather"> <h2>Race day weather</h2> <p>Temperatures at the airport on race day ranged from 19.9&nbsp;°F in 1972 to 68&nbsp;°F in 1969, and the range of average temperatures is 34.2 and 53&nbsp;°F. Using our model of Ester Dome temperatures, we get an average range of 29.5 and 47&nbsp;°F and an overall min / max of 16.1 / 61.4&nbsp;°F. Generally speaking, in most years it will be below freezing on Ester Dome, but possibly before most of the runners get up there.</p> <p>Precipitation (rain, sleet, or snow) has fallen on 15 out of 53 race days, or 28% of the time, and measurable snowfall has been recorded on four of those fifteen. The highest amount fell in 2014 with 0.36&nbsp;inches of liquid precipitation (no snow was recorded and the temperatures were between 45 and 51&nbsp;°F so it was almost certainly all rain, even on Ester Dome). More than a quarter of an inch of precipitation fell in three of the fifteen years (1990, 1992, and 2014), but most rainfall totals are much smaller.</p> <p>Measurable snow fell at the airport in four years, or seven percent of the time: 4.1&nbsp;inches in 1993, 2.1&nbsp;inches in 1985, 1.2&nbsp;inches in 1996 and 0.4&nbsp;inches in 1992. But that’s at the airport station. Four of the 15 years where measurable precipitation fell at the airport, but no snow fell, had possible minimum temperatures on Ester Dome that were below freezing. It’s likely that some of the precipitation recorded at the airport in those years was coming down as snow up on Ester Dome. If so, that means snow may have fallen on eight race days, bringing the percentage up to fifteen percent.</p> <p>Wind data from the airport has only been recorded since 1984, but from those years the average wind speed at the airport on race day is 4.9 miles per hour. Peak 2-minute winds during Equinox race day was 21 miles per hour in 2003. Unfortunately, no wind data is available for Ester Dome, but it’s likely to be higher than what is recorded at the airport. We do have wind speed data from the hourly Ester Dome station from 2008 through 2013, but the linear relationship between Ester Dome winds and winds at the Fairbanks airport only explain about a quarter of the variation in the data, and a look at the plot doesn’t give me much confidence in the relationship shown (see below).</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/09/pafa_fbsa_sept_wspds.pdf"><img alt="Ester Dome and Fairbanks Airport wind speeds" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/09/pafa_fbsa_sept_wspds.svgz" /></a> </div> </div> <div class="section" id="weather-from-the-week-prior"> <h2>Weather from the week prior</h2> <p>It’s also useful to look at the weather from the week before the race, since excessive pre-race rain or snow can make conditions on race day very different, even if the race day weather is pleasant. The year I ran the full marathon (2013), it had snowed the week before and much of the trail in the woods before the water stop near Henderson and all of the out and back were covered in snow.</p> <p>The most dramatic example of this was 1992 where 23 inches of snow fell at the airport in the week prior to the race, with much higher totals up on the summit of Ester Dome. Measurable snow has been recorded at the airport in the week prior to six races, but all the weekly totals are under an inch except for the snow year of 1992.</p> <p>Precipitation has fallen in 42 of 53 pre-race weeks (79% of the time). Three years have had more than an inch of precipitation prior to the race: 1.49&nbsp;inches in 2015, 1.26&nbsp;inches in 1992 (which fell as snow), and 1.05&nbsp;inches in 2007. On average, just over two tenths of an inch of precipitation falls in the week before the race.</p> </div> </div> <div class="section" id="summary"> <h1>Summary</h1> <p>The following stacked plots shows the weather for all 53 runnings of the Equinox marathon. The top panel shows the range of temperatures on race day from the airport station (wide bars) and estimated on Ester Dome (thin lines below bars). The shaded area at the bottom shows where temperatures are below freezing. Dashed orange horizonal lines represent the average high and low temperature at the airport on race day; solid orange horizonal lines indicate estimated average high and low temperature on Ester Dome.</p> <p>The middle panel shows race day liquid precipitation (rain, melted snow). Bars marked with an asterisk indicate years where snow was also recorded at the airport, but remember that four of the other years with liquid precipitation probably experienced snow on Ester Dome (1977, 1986, 1991, and 1994) because the temperatures were likely to be below freezing at elevation.</p> <p>The bottom panel shows precipitation totals from the week prior to the race. Bars marked with an asterisk indicate weeks where snow was also recorded at the airport.</p> <div class="figure"> <a class="reference external image-reference" href="//media.swingleydev.com/img/blog/2016/09/equinox_weather_grid.pdf"><img alt="Equinox Marathon Weather" class="img-responsive" src="//media.swingleydev.com/img/blog/2016/09/equinox_weather_grid.svgz" /></a> </div> <p>Here’s a table with most of the data from the analysis. Record values for each variable are in bold.</p> <table border="1" class="tosf docutils"> <colgroup> <col width="13%" /> <col width="10%" /> <col width="10%" /> <col width="9%" /> <col width="10%" /> <col width="9%" /> <col width="10%" /> <col width="10%" /> <col width="11%" /> <col width="10%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">&nbsp;</th> <th class="head" colspan="7">Fairbanks Airport Station</th> <th class="head" colspan="2">Ester Dome (estimated)</th> </tr> <tr><th class="head">&nbsp;</th> <th class="head" colspan="5">Race Day</th> <th class="head" colspan="2">Previous Week</th> <th class="head" colspan="2">Race Day</th> </tr> <tr><th class="head">Date</th> <th class="head">min t</th> <th class="head">max t</th> <th class="head">wind</th> <th class="head">prcp</th> <th class="head">snow</th> <th class="head">prcp</th> <th class="head">snow</th> <th class="head">min t</th> <th class="head">max t</th> </tr> </thead> <tbody valign="top"> <tr><td>1963‑09‑21</td> <td>32.0</td> <td>54.0</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.01</td> <td>0.0</td> <td>27.5</td> <td>48.2</td> </tr> <tr><td>1964‑09‑19</td> <td>34.0</td> <td>57.9</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.03</td> <td>0.0</td> <td>29.4</td> <td>51.9</td> </tr> <tr><td>1965‑09‑25</td> <td>37.9</td> <td>60.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.80</td> <td>0.0</td> <td>33.0</td> <td>54.0</td> </tr> <tr><td>1966‑09‑24</td> <td>36.0</td> <td>62.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.01</td> <td>0.0</td> <td>31.2</td> <td>55.8</td> </tr> <tr><td>1967‑09‑23</td> <td>35.1</td> <td>57.9</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>30.4</td> <td>51.9</td> </tr> <tr><td>1968‑09‑21</td> <td>23.0</td> <td>44.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.04</td> <td>0.0</td> <td>19.0</td> <td>38.9</td> </tr> <tr><td>1969‑09‑20</td> <td>35.1</td> <td><strong>68.0</strong></td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>30.4</td> <td><strong>61.4</strong></td> </tr> <tr><td>1970‑09‑19</td> <td>24.1</td> <td>39.9</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.42</td> <td>0.0</td> <td>20.0</td> <td>34.9</td> </tr> <tr><td>1971‑09‑18</td> <td>35.1</td> <td>55.9</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.14</td> <td>0.0</td> <td>30.4</td> <td>50.0</td> </tr> <tr><td>1972‑09‑23</td> <td><strong>19.9</strong></td> <td>42.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.01</td> <td>0.2</td> <td><strong>16.1</strong></td> <td>38.0</td> </tr> <tr><td>1973‑09‑22</td> <td>30.0</td> <td>44.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.05</td> <td>0.0</td> <td>25.6</td> <td>38.9</td> </tr> <tr><td>1974‑09‑21</td> <td>48.0</td> <td>60.1</td> <td>&nbsp;</td> <td>0.08</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>42.6</td> <td>54.0</td> </tr> <tr><td>1975‑09‑20</td> <td>37.9</td> <td>55.9</td> <td>&nbsp;</td> <td>0.02</td> <td>0.0</td> <td>0.02</td> <td>0.0</td> <td>33.0</td> <td>50.0</td> </tr> <tr><td>1976‑09‑18</td> <td>34.0</td> <td>59.0</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.54</td> <td>0.0</td> <td>29.4</td> <td>52.9</td> </tr> <tr><td>1977‑09‑24</td> <td>36.0</td> <td>48.9</td> <td>&nbsp;</td> <td>0.06</td> <td>0.0</td> <td>0.20</td> <td>0.0</td> <td>31.2</td> <td>43.4</td> </tr> <tr><td>1978‑09‑23</td> <td>30.0</td> <td>42.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.10</td> <td>0.3</td> <td>25.6</td> <td>37.0</td> </tr> <tr><td>1979‑09‑22</td> <td>35.1</td> <td>62.1</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.17</td> <td>0.0</td> <td>30.4</td> <td>55.8</td> </tr> <tr><td>1980‑09‑20</td> <td>30.9</td> <td>43.0</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.35</td> <td>0.0</td> <td>26.4</td> <td>37.8</td> </tr> <tr><td>1981‑09‑19</td> <td>37.0</td> <td>43.0</td> <td>&nbsp;</td> <td>0.15</td> <td>0.0</td> <td>0.04</td> <td>0.0</td> <td>32.2</td> <td>37.8</td> </tr> <tr><td>1982‑09‑18</td> <td>42.1</td> <td>61.0</td> <td>&nbsp;</td> <td>0.02</td> <td>0.0</td> <td>0.22</td> <td>0.0</td> <td>37.0</td> <td>54.8</td> </tr> <tr><td>1983‑09‑17</td> <td>39.9</td> <td>46.9</td> <td>&nbsp;</td> <td>0.00</td> <td>0.0</td> <td>0.05</td> <td>0.0</td> <td>34.9</td> <td>41.5</td> </tr> <tr><td>1984‑09‑22</td> <td>28.9</td> <td>60.1</td> <td>5.8</td> <td>0.00</td> <td>0.0</td> <td>0.08</td> <td>0.0</td> <td>24.5</td> <td>54.0</td> </tr> <tr><td>1985‑09‑21</td> <td>30.9</td> <td>42.1</td> <td>6.5</td> <td>0.14</td> <td>2.1</td> <td>0.57</td> <td>0.0</td> <td>26.4</td> <td>37.0</td> </tr> <tr><td>1986‑09‑20</td> <td>36.0</td> <td>52.0</td> <td>8.3</td> <td>0.07</td> <td>0.0</td> <td>0.21</td> <td>0.0</td> <td>31.2</td> <td>46.3</td> </tr> <tr><td>1987‑09‑19</td> <td>37.9</td> <td>61.0</td> <td>6.3</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>33.0</td> <td>54.8</td> </tr> <tr><td>1988‑09‑24</td> <td>37.0</td> <td>45.0</td> <td>4.0</td> <td>0.00</td> <td>0.0</td> <td>0.11</td> <td>0.0</td> <td>32.2</td> <td>39.7</td> </tr> <tr><td>1989‑09‑23</td> <td>36.0</td> <td>61.0</td> <td>8.5</td> <td>0.00</td> <td>0.0</td> <td>0.07</td> <td>0.5</td> <td>31.2</td> <td>54.8</td> </tr> <tr><td>1990‑09‑22</td> <td>37.9</td> <td>50.0</td> <td>7.8</td> <td>0.26</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>33.0</td> <td>44.4</td> </tr> <tr><td>1991‑09‑21</td> <td>36.0</td> <td>57.0</td> <td>4.5</td> <td>0.04</td> <td>0.0</td> <td>0.03</td> <td>0.0</td> <td>31.2</td> <td>51.0</td> </tr> <tr><td>1992‑09‑19</td> <td>24.1</td> <td>33.1</td> <td>6.7</td> <td>0.01</td> <td>0.4</td> <td><strong>1.26</strong></td> <td><strong>23.0</strong></td> <td>20.0</td> <td>28.5</td> </tr> <tr><td>1993‑09‑18</td> <td>28.0</td> <td>37.0</td> <td>4.9</td> <td>0.29</td> <td><strong>4.1</strong></td> <td>0.37</td> <td>0.3</td> <td>23.7</td> <td>32.2</td> </tr> <tr><td>1994‑09‑24</td> <td>27.0</td> <td>51.1</td> <td>6.0</td> <td>0.02</td> <td>0.0</td> <td>0.08</td> <td>0.0</td> <td>22.8</td> <td>45.5</td> </tr> <tr><td>1995‑09‑23</td> <td>43.0</td> <td>66.9</td> <td>4.0</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>37.8</td> <td>60.4</td> </tr> <tr><td>1996‑09‑21</td> <td>28.9</td> <td>37.9</td> <td>6.9</td> <td>0.06</td> <td>1.2</td> <td>0.26</td> <td>0.0</td> <td>24.5</td> <td>33.0</td> </tr> <tr><td>1997‑09‑20</td> <td>27.0</td> <td>55.0</td> <td>3.8</td> <td>0.00</td> <td>0.0</td> <td>0.03</td> <td>0.0</td> <td>22.8</td> <td>49.2</td> </tr> <tr><td>1998‑09‑19</td> <td>42.1</td> <td>60.1</td> <td>4.9</td> <td>0.00</td> <td>0.0</td> <td>0.37</td> <td>0.0</td> <td>37.0</td> <td>54.0</td> </tr> <tr><td>1999‑09‑18</td> <td>39.0</td> <td>64.9</td> <td>3.8</td> <td>0.00</td> <td>0.0</td> <td>0.26</td> <td>0.0</td> <td>34.1</td> <td>58.5</td> </tr> <tr><td>2000‑09‑16</td> <td>28.9</td> <td>50.0</td> <td>5.6</td> <td>0.00</td> <td>0.0</td> <td>0.30</td> <td>0.0</td> <td>24.5</td> <td>44.4</td> </tr> <tr><td>2001‑09‑22</td> <td>33.1</td> <td>57.0</td> <td>1.6</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>28.5</td> <td>51.0</td> </tr> <tr><td>2002‑09‑21</td> <td>33.1</td> <td>48.9</td> <td>3.8</td> <td>0.00</td> <td>0.0</td> <td>0.03</td> <td>0.0</td> <td>28.5</td> <td>43.4</td> </tr> <tr><td>2003‑09‑20</td> <td>26.1</td> <td>46.0</td> <td><strong>9.6</strong></td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>21.9</td> <td>40.7</td> </tr> <tr><td>2004‑09‑18</td> <td>26.1</td> <td>48.0</td> <td>4.3</td> <td>0.00</td> <td>0.0</td> <td>0.25</td> <td>0.0</td> <td>21.9</td> <td>42.6</td> </tr> <tr><td>2005‑09‑17</td> <td>37.0</td> <td>63.0</td> <td>0.9</td> <td>0.00</td> <td>0.0</td> <td>0.09</td> <td>0.0</td> <td>32.2</td> <td>56.7</td> </tr> <tr><td>2006‑09‑16</td> <td>46.0</td> <td>64.0</td> <td>4.3</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>40.7</td> <td>57.6</td> </tr> <tr><td>2007‑09‑22</td> <td>25.0</td> <td>45.0</td> <td>4.7</td> <td>0.00</td> <td>0.0</td> <td>1.05</td> <td>0.0</td> <td>20.9</td> <td>39.7</td> </tr> <tr><td>2008‑09‑20</td> <td>34.0</td> <td>51.1</td> <td>4.5</td> <td>0.00</td> <td>0.0</td> <td>0.08</td> <td>0.0</td> <td>29.4</td> <td>45.5</td> </tr> <tr><td>2009‑09‑19</td> <td>39.0</td> <td>50.0</td> <td>5.8</td> <td>0.00</td> <td>0.0</td> <td>0.25</td> <td>0.0</td> <td>34.1</td> <td>44.4</td> </tr> <tr><td>2010‑09‑18</td> <td>35.1</td> <td>64.9</td> <td>2.5</td> <td>0.00</td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>30.4</td> <td>58.5</td> </tr> <tr><td>2011‑09‑17</td> <td>39.9</td> <td>57.9</td> <td>1.3</td> <td>0.00</td> <td>0.0</td> <td>0.44</td> <td>0.0</td> <td>34.9</td> <td>51.9</td> </tr> <tr><td>2012‑09‑22</td> <td>46.9</td> <td>66.9</td> <td>6.0</td> <td>0.00</td> <td>0.0</td> <td>0.33</td> <td>0.0</td> <td>41.5</td> <td>60.4</td> </tr> <tr><td>2013‑09‑21</td> <td>24.3</td> <td>44.1</td> <td>5.1</td> <td>0.00</td> <td>0.0</td> <td>0.13</td> <td>0.6</td> <td>20.2</td> <td>38.9</td> </tr> <tr><td>2014‑09‑20</td> <td>45.0</td> <td>51.1</td> <td>1.6</td> <td><strong>0.36</strong></td> <td>0.0</td> <td>0.00</td> <td>0.0</td> <td>39.7</td> <td>45.5</td> </tr> <tr><td>2015‑09‑19</td> <td>37.9</td> <td>44.1</td> <td>2.9</td> <td>0.01</td> <td>0.0</td> <td>1.49</td> <td>0.0</td> <td>33.0</td> <td>38.9</td> </tr> </tbody> </table> </div> <div class="section" id="postscript"> <h1>Postscript</h1> <p>The weather for the 2016 race was just about perfect with temperatures ranging from 34 to 58 °F and no precipitation during the race. The airport did record 0.01 inches for the day, but this fell in the evening, after the race had finished.</p> </div> <div class="section" id="appendix-r-code"> <h1>Appendix: R code</h1> <div class="highlight"><pre> <span class="kn">library</span><span class="p">(</span>dplyr<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>readr<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>lubridate<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>ggplot2<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>scales<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>grid<span class="p">)</span> <span class="kn">library</span><span class="p">(</span>gtable<span class="p">)</span> race_dates <span class="o">&lt;-</span> read_fwf<span class="p">(</span><span class="s">&quot;equinox_marathon_dates.rst&quot;</span><span class="p">,</span> skip<span class="o">=</span><span class="m">5</span><span class="p">,</span> n_max<span class="o">=</span><span class="m">54</span><span class="p">,</span> fwf_positions<span class="p">(</span><span class="kt">c</span><span class="p">(</span><span class="m">4</span><span class="p">,</span> <span class="m">6</span><span class="p">),</span> <span class="kt">c</span><span class="p">(</span><span class="m">9</span><span class="p">,</span> <span class="m">19</span><span class="p">),</span> <span class="kt">c</span><span class="p">(</span><span class="s">&quot;number&quot;</span><span class="p">,</span> <span class="s">&quot;race_date&quot;</span><span class="p">)))</span> noaa <span class="o">&lt;-</span> src_postgres<span class="p">(</span>host<span class="o">=</span><span class="s">&quot;localhost&quot;</span><span class="p">,</span> dbname<span class="o">=</span><span class="s">&quot;noaa&quot;</span><span class="p">)</span> <span class="c1"># pivot &lt;- tbl(noaa, build_sql(&quot;SELECT * FROM ghcnd_pivot</span> <span class="c1"># WHERE station_name = &#39;UNIVERSITY EXP STN&#39;&quot;))</span> <span class="c1"># pivot &lt;- tbl(noaa, build_sql(&quot;SELECT * FROM ghcnd_pivot</span> <span class="c1"># WHERE station_name = &#39;COLLEGE OBSY&#39;&quot;))</span> pivot <span class="o">&lt;-</span> tbl<span class="p">(</span>noaa<span class="p">,</span> build_sql<span class="p">(</span><span class="s">&quot;SELECT * FROM ghcnd_pivot</span> <span class="s"> WHERE station_name = &#39;FAIRBANKS INTL AP&#39;&quot;</span><span class="p">))</span> race_day_wx <span class="o">&lt;-</span> pivot <span class="o">%&gt;%</span> inner_join<span class="p">(</span>race_dates<span class="p">,</span> by<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="s">&quot;dte&quot;</span><span class="o">=</span><span class="s">&quot;race_date&quot;</span><span class="p">),</span> copy<span class="o">=</span><span class="kc">TRUE</span><span class="p">)</span> <span class="o">%&gt;%</span> collect<span class="p">()</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>tmin_f<span class="o">=</span><span class="kp">round</span><span class="p">((</span>tmin_c<span class="o">*</span><span class="m">9</span><span class="o">/</span><span class="m">5.0</span><span class="p">)</span><span class="m">+32</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> tmax_f<span class="o">=</span><span class="kp">round</span><span class="p">((</span>tmax_c<span class="o">*</span><span class="m">9</span><span class="o">/</span><span class="m">5.0</span><span class="p">)</span><span class="m">+32</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> prcp_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>prcp_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">2</span><span class="p">),</span> snow_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snow_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> snwd_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snow_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> awnd_mph<span class="o">=</span><span class="kp">round</span><span class="p">(</span>awnd_mps<span class="o">*</span><span class="m">2.2369</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> wsf2_mph<span class="o">=</span><span class="kp">round</span><span class="p">(</span>wsf2_mps<span class="o">*</span><span class="m">2.2369</span><span class="p">),</span> <span class="m">1</span><span class="p">)</span> <span class="o">%&gt;%</span> select<span class="p">(</span>number<span class="p">,</span> race_date<span class="p">,</span> tmin_f<span class="p">,</span> tmax_f<span class="p">,</span> prcp_in<span class="p">,</span> snow_in<span class="p">,</span> snwd_in<span class="p">,</span> awnd_mph<span class="p">,</span> wsf2_mph<span class="p">)</span> week_before_race_day_wx <span class="o">&lt;-</span> pivot <span class="o">%&gt;%</span> mutate<span class="p">(</span>year<span class="o">=</span>date_part<span class="p">(</span><span class="s">&quot;year&quot;</span><span class="p">,</span> dte<span class="p">))</span> <span class="o">%&gt;%</span> inner_join<span class="p">(</span>race_dates <span class="o">%&gt;%</span> mutate<span class="p">(</span>year<span class="o">=</span>year<span class="p">(</span>race_date<span class="p">)),</span> copy<span class="o">=</span><span class="kc">TRUE</span><span class="p">)</span> <span class="o">%&gt;%</span> collect<span class="p">()</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>tmin_f<span class="o">=</span><span class="kp">round</span><span class="p">((</span>tmin_c<span class="o">*</span><span class="m">9</span><span class="o">/</span><span class="m">5.0</span><span class="p">)</span><span class="m">+32</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> tmax_f<span class="o">=</span><span class="kp">round</span><span class="p">((</span>tmax_c<span class="o">*</span><span class="m">9</span><span class="o">/</span><span class="m">5.0</span><span class="p">)</span><span class="m">+32</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> prcp_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>prcp_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">2</span><span class="p">),</span> snow_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snow_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> snwd_in<span class="o">=</span><span class="kp">round</span><span class="p">(</span>snow_mm<span class="o">/</span><span class="m">25.4</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> awnd_mph<span class="o">=</span><span class="kp">round</span><span class="p">(</span>awnd_mps<span class="o">*</span><span class="m">2.2369</span><span class="p">,</span> <span class="m">1</span><span class="p">),</span> wsf2_mph<span class="o">=</span><span class="kp">round</span><span class="p">(</span>wsf2_mps<span class="o">*</span><span class="m">2.2369</span><span class="p">,</span> <span class="m">1</span><span class="p">))</span> <span class="o">%&gt;%</span> select<span class="p">(</span>number<span class="p">,</span> year<span class="p">,</span> race_date<span class="p">,</span> dte<span class="p">,</span> prcp_in<span class="p">,</span> snow_in<span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>week_before<span class="o">=</span>race_date<span class="o">-</span>days<span class="p">(</span><span class="m">7</span><span class="p">))</span> <span class="o">%&gt;%</span> filter<span class="p">(</span>dte<span class="o">&lt;</span>race_date<span class="p">,</span> dte<span class="o">&gt;=</span>week_before<span class="p">)</span> <span class="o">%&gt;%</span> group_by<span class="p">(</span>number<span class="p">,</span> year<span class="p">,</span> race_date<span class="p">)</span> <span class="o">%&gt;%</span> summarize<span class="p">(</span>pweek_prcp_in<span class="o">=</span><span class="kp">sum</span><span class="p">(</span>prcp_in<span class="p">),</span> pweek_snow_in<span class="o">=</span><span class="kp">sum</span><span class="p">(</span>snow_in<span class="p">))</span> all_wx <span class="o">&lt;-</span> race_day_wx <span class="o">%&gt;%</span> inner_join<span class="p">(</span>week_before_race_day_wx<span class="p">)</span> <span class="o">%&gt;%</span> mutate<span class="p">(</span>tavg_f<span class="o">=</span><span class="p">(</span>tmin_f<span class="o">+</span>tmax_f<span class="p">)</span><span class="o">/</span><span class="m">2.0</span><span class="p">,</span> snow_label<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span>snow_in<span class="o">&gt;</span><span class="m">0</span><span class="p">,</span> <span class="s">&#39;*&#39;</span><span class="p">,</span> <span class="kc">NA</span><span class="p">),</span> pweek_snow_label<span class="o">=</span><span class="kp">ifelse</span><span class="p">(</span>pweek_snow_in<span class="o">&gt;</span><span class="m">0</span><span class="p">,</span> <span class="s">&#39;*&#39;</span><span class="p">,</span> <span class="kc">NA</span><span class="p">))</span> <span class="o">%&gt;%</span> select<span class="p">(</span>number<span class="p">,</span> year<span class="p">,</span> race_date<span class="p">,</span> tmin_f<span class="p">,</span> tmax_f<span class="p">,</span> tavg_f<span class="p">,</span> prcp_in<span class="p">,</span> snow_in<span class="p">,</span> snwd_in<span class="p">,</span> awnd_mph<span class="p">,</span> wsf2_mph<span class="p">,</span> pweek_prcp_in<span class="p">,</span> pweek_snow_in<span class="p">,</span> snow_label<span class="p">,</span> pweek_snow_label<span class="p">);</span> write_csv<span class="p">(</span>all_wx<span class="p">,</span> <span class="s">&quot;all_wx.csv&quot;</span><span class="p">)</span> madis <span class="o">&lt;-</span> src_postgres<span class="p">(</span>host<span class="o">=</span><span class="s">&quot;localhost&quot;</span><span class="p">,</span> dbname<span class="o">=</span><span class="s">&quot;madis&quot;</span><span class="p">)</span> pafa_fbsa <span class="o">&lt;-</span> tbl<span class="p">(</span>madis<span class="p">,</span> build_sql<span class="p">(</span><span class="s">&quot;</span> <span class="s"> WITH pafa AS (</span> <span class="s"> SELECT dt_local, temp_f, wspd_mph</span> <span class="s"> FROM observations</span> <span class="s"> WHERE station_id = &#39;PAFA&#39; AND date_part(&#39;month&#39;, dt_local) = 9),</span> <span class="s"> fbsa AS (</span> <span class="s"> SELECT dt_local, temp_f, wspd_mph</span> <span class="s"> FROM observations</span> <span class="s"> WHERE station_id = &#39;FBSA2&#39; AND date_part(&#39;month&#39;, dt_local) = 9)</span> <span class="s"> SELECT pafa.dt_local, pafa.temp_f AS pafa_temp_f, pafa.wspd_mph as pafa_wspd_mph,</span> <span class="s"> fbsa.temp_f AS ester_dome_temp_f, fbsa.wspd_mph as ester_dome_wspd_mph</span> <span class="s"> FROM pafa</span> <span class="s"> INNER JOIN fbsa ON</span> <span class="s"> pafa.dt_local BETWEEN fbsa.dt_local - interval &#39;15 minutes&#39;</span> <span class="s"> AND fbsa.dt_local + interval &#39;15 minutes&#39;&quot;</span><span class="p">))</span> <span class="o">%&gt;%</span> collect<span class="p">()</span> write_csv<span class="p">(</span>pafa_fbsa<span class="p">,</span> <span class="s">&quot;pafa_fbsa.csv&quot;</span><span class="p">)</span> ester_dome_temps <span class="o">&lt;-</span> lm<span class="p">(</span>data<span class="o">=</span>pafa_fbsa<span class="p">,</span> ester_dome_temp_f <span class="o">~</span> pafa_temp_f<span class="p">)</span> <span class="kp">summary</span><span class="p">(</span>ester_dome_temps<span class="p">)</span> <span class="c1"># Model and coefficients are significant, r2 = 0.794</span> <span class="c1"># intercept = -2.69737, slope = 0.94268</span> all_wx_with_ed <span class="o">&lt;-</span> all_wx <span class="o">%&gt;%</span> mutate<span class="p">(</span>ed_min_temp_f<span class="o">=</span><span class="kp">round</span><span class="p">(</span>ester_dome_temps<span class="o">$</span>coefficients<span class="p">[</span><span class="m">1</span><span class="p">]</span><span class="o">+</span> tmin_f<span class="o">*</span>ester_dome_temps<span class="o">$</span>coefficients<span class="p">[</span><span class="m">2</span><span class="p">],</span> <span class="m">1</span><span class="p">),</span> ed_max_temp_f<span class="o">=</span><span class="kp">round</span><span class="p">(</span>ester_dome_temps<span class="o">$</span>coefficients<span class="p">[</span><span class="m">1</span><span class="p">]</span><span class="o">+</span> tmax_f<span class="o">*</span>ester_dome_temps<span class="o">$</span>coefficients<span class="p">[</span><span class="m">2</span><span class="p">],</span> <span class="m">1</span><span class="p">))</span> make_gt <span class="o">&lt;-</span> <span class="kr">function</span><span class="p">(</span>outside<span class="p">,</span> instruments<span class="p">,</span> chamber<span class="p">,</span> width<span class="p">,</span> heights<span class="p">)</span> <span class="p">{</span> gt1 <span class="o">&lt;-</span> ggplot_gtable<span class="p">(</span>ggplot_build<span class="p">(</span>outside<span class="p">))</span> gt2 <span class="o">&lt;-</span> ggplot_gtable<span class="p">(</span>ggplot_build<span class="p">(</span>instruments<span class="p">))</span> gt3 <span class="o">&lt;-</span> ggplot_gtable<span class="p">(</span>ggplot_build<span class="p">(</span>chamber<span class="p">))</span> max_width <span class="o">&lt;-</span> unit.pmax<span class="p">(</span>gt1<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">],</span> gt2<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">],</span> gt3<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">])</span> gt1<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">]</span> <span class="o">&lt;-</span> max_width gt2<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">]</span> <span class="o">&lt;-</span> max_width gt3<span class="o">$</span>widths<span class="p">[</span><span class="m">2</span><span class="o">:</span><span class="m">3</span><span class="p">]</span> <span class="o">&lt;-</span> max_width gt <span class="o">&lt;-</span> gtable<span class="p">(</span>widths <span class="o">=</span> unit<span class="p">(</span><span class="kt">c</span><span class="p">(</span>width<span class="p">),</span> <span class="s">&quot;in&quot;</span><span class="p">),</span> heights <span class="o">=</span> unit<span class="p">(</span>heights<span class="p">,</span> <span class="s">&quot;in&quot;</span><span class="p">))</span> gt <span class="o">&lt;-</span> gtable_add_grob<span class="p">(</span>gt<span class="p">,</span> gt1<span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">1</span><span class="p">)</span> gt <span class="o">&lt;-</span> gtable_add_grob<span class="p">(</span>gt<span class="p">,</span> gt2<span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">1</span><span class="p">)</span> gt <span class="o">&lt;-</span> gtable_add_grob<span class="p">(</span>gt<span class="p">,</span> gt3<span class="p">,</span> <span class="m">3</span><span class="p">,</span> <span class="m">1</span><span class="p">)</span> gt <span class="p">}</span> temps <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>all_wx_with_ed<span class="p">,</span> aes<span class="p">(</span>x<span class="o">=</span>year<span class="p">,</span> ymin<span class="o">=</span>tmin_f<span class="p">,</span> ymax<span class="o">=</span>tmax_f<span class="p">,</span> y<span class="o">=</span>tavg_f<span class="p">))</span> <span class="o">+</span> <span class="c1"># geom_abline(intercept=32, slope=0, color=&quot;blue&quot;, alpha=0.25) +</span> geom_rect<span class="p">(</span>data<span class="o">=</span>all_wx_with_ed <span class="o">%&gt;%</span> <span class="kp">head</span><span class="p">(</span>n<span class="o">=</span><span class="m">1</span><span class="p">),</span> aes<span class="p">(</span>xmin<span class="o">=-</span><span class="kc">Inf</span><span class="p">,</span> xmax<span class="o">=</span><span class="kc">Inf</span><span class="p">,</span> ymin<span class="o">=-</span><span class="kc">Inf</span><span class="p">,</span> ymax<span class="o">=</span><span class="m">32</span><span class="p">),</span> fill<span class="o">=</span><span class="s">&quot;darkcyan&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.25</span><span class="p">)</span> <span class="o">+</span> geom_abline<span class="p">(</span>aes<span class="p">(</span>slope<span class="o">=</span><span class="m">0</span><span class="p">,</span> intercept<span class="o">=</span><span class="kp">mean</span><span class="p">(</span>all_wx_with_ed<span class="o">$</span>tmin_f<span class="p">)),</span> color<span class="o">=</span><span class="s">&quot;darkorange&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.50</span><span class="p">,</span> linetype<span class="o">=</span><span class="m">2</span><span class="p">)</span> <span class="o">+</span> geom_abline<span class="p">(</span>aes<span class="p">(</span>slope<span class="o">=</span><span class="m">0</span><span class="p">,</span> intercept<span class="o">=</span><span class="kp">mean</span><span class="p">(</span>all_wx_with_ed<span class="o">$</span>tmax_f<span class="p">)),</span> color<span class="o">=</span><span class="s">&quot;darkorange&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.50</span><span class="p">,</span> linetype<span class="o">=</span><span class="m">2</span><span class="p">)</span> <span class="o">+</span> geom_abline<span class="p">(</span>aes<span class="p">(</span>slope<span class="o">=</span><span class="m">0</span><span class="p">,</span> intercept<span class="o">=</span><span class="kp">mean</span><span class="p">(</span>all_wx_with_ed<span class="o">$</span>ed_min_temp_f<span class="p">)),</span> color<span class="o">=</span><span class="s">&quot;darkorange&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.50</span><span class="p">,</span> linetype<span class="o">=</span><span class="m">1</span><span class="p">)</span> <span class="o">+</span> geom_abline<span class="p">(</span>aes<span class="p">(</span>slope<span class="o">=</span><span class="m">0</span><span class="p">,</span> intercept<span class="o">=</span><span class="kp">mean</span><span class="p">(</span>all_wx_with_ed<span class="o">$</span>ed_max_temp_f<span class="p">)),</span> color<span class="o">=</span><span class="s">&quot;darkorange&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.50</span><span class="p">,</span> linetype<span class="o">=</span><span class="m">1</span><span class="p">)</span> <span class="o">+</span> geom_linerange<span class="p">(</span>aes<span class="p">(</span>ymin<span class="o">=</span>ed_min_temp_f<span class="p">,</span> ymax<span class="o">=</span>ed_max_temp_f<span class="p">))</span> <span class="o">+</span> <span class="c1"># geom_smooth(method=&quot;lm&quot;, se=FALSE) +</span> geom_linerange<span class="p">(</span>size<span class="o">=</span><span class="m">3</span><span class="p">,</span> color<span class="o">=</span><span class="s">&quot;grey30&quot;</span><span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">,</span> limits<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">),</span> breaks<span class="o">=</span><span class="kp">seq</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">,</span> <span class="m">2</span><span class="p">))</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Temperature (deg F)&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">10</span><span class="p">))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> theme<span class="p">(</span>plot.margin<span class="o">=</span>unit<span class="p">(</span><span class="kt">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0.5</span><span class="p">),</span> <span class="s">&#39;lines&#39;</span><span class="p">))</span> <span class="o">+</span> <span class="c1"># t, r, b, l</span> theme<span class="p">(</span>axis.text.x<span class="o">=</span>element_blank<span class="p">(),</span> axis.title.x<span class="o">=</span>element_blank<span class="p">(),</span> axis.ticks.x<span class="o">=</span>element_blank<span class="p">(),</span> panel.grid.minor.x<span class="o">=</span>element_blank<span class="p">())</span> <span class="o">+</span> ggtitle<span class="p">(</span><span class="s">&quot;Weather during and in the week prior to the Equinox Marathon</span> <span class="s"> Fairbanks Airport Station&quot;</span><span class="p">)</span> prcp <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>all_wx<span class="p">,</span> aes<span class="p">(</span>x<span class="o">=</span>year<span class="p">,</span> y<span class="o">=</span>prcp_in<span class="p">))</span> <span class="o">+</span> geom_bar<span class="p">(</span>stat<span class="o">=</span><span class="s">&quot;identity&quot;</span><span class="p">)</span> <span class="o">+</span> geom_text<span class="p">(</span>aes<span class="p">(</span>y<span class="o">=</span>prcp_in<span class="m">+0.025</span><span class="p">,</span> label<span class="o">=</span>snow_label<span class="p">))</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">,</span> limits<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">),</span> breaks<span class="o">=</span><span class="kp">seq</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">))</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Precipitation (inches)&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">5</span><span class="p">))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> theme<span class="p">(</span>plot.margin<span class="o">=</span>unit<span class="p">(</span><span class="kt">c</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0.5</span><span class="p">),</span> <span class="s">&#39;lines&#39;</span><span class="p">))</span> <span class="o">+</span> <span class="c1"># t, r, b, l</span> theme<span class="p">(</span>axis.text.x<span class="o">=</span>element_blank<span class="p">(),</span> axis.title.x<span class="o">=</span>element_blank<span class="p">(),</span> axis.ticks.x<span class="o">=</span>element_blank<span class="p">(),</span> panel.grid.minor.x<span class="o">=</span>element_blank<span class="p">())</span> pweek_prcp <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>all_wx<span class="p">,</span> aes<span class="p">(</span>x<span class="o">=</span>year<span class="p">,</span> y<span class="o">=</span>pweek_prcp_in<span class="p">))</span> <span class="o">+</span> geom_bar<span class="p">(</span>stat<span class="o">=</span><span class="s">&quot;identity&quot;</span><span class="p">)</span> <span class="o">+</span> geom_text<span class="p">(</span>aes<span class="p">(</span>y<span class="o">=</span>pweek_prcp_in<span class="m">+0.1</span><span class="p">,</span> label<span class="o">=</span>pweek_snow_label<span class="p">))</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">,</span> limits<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">),</span> breaks<span class="o">=</span><span class="kp">seq</span><span class="p">(</span><span class="m">1963</span><span class="p">,</span> <span class="m">2015</span><span class="p">))</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Pre-week precip (inches)&quot;</span><span class="p">,</span> breaks<span class="o">=</span>pretty_breaks<span class="p">(</span>n<span class="o">=</span><span class="m">5</span><span class="p">))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> theme<span class="p">(</span>plot.margin<span class="o">=</span>unit<span class="p">(</span><span class="kt">c</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">0.5</span><span class="p">,</span> <span class="m">0.5</span><span class="p">),</span> <span class="s">&#39;lines&#39;</span><span class="p">),</span> axis.text.x<span class="o">=</span>element_text<span class="p">(</span>angle<span class="o">=</span><span class="m">45</span><span class="p">,</span> hjust<span class="o">=</span><span class="m">1</span><span class="p">,</span> vjust<span class="o">=</span><span class="m">1</span><span class="p">),</span> panel.grid.minor.x<span class="o">=</span>element_blank<span class="p">())</span> rescale <span class="o">&lt;-</span> <span class="m">0.75</span> full_plot <span class="o">&lt;-</span> make_gt<span class="p">(</span>temps<span class="p">,</span> prcp<span class="p">,</span> pweek_prcp<span class="p">,</span> <span class="m">16</span><span class="o">*</span>rescale<span class="p">,</span> <span class="kt">c</span><span class="p">(</span><span class="m">7.5</span><span class="o">*</span>rescale<span class="p">,</span> <span class="m">2.5</span><span class="o">*</span>rescale<span class="p">,</span> <span class="m">3.0</span><span class="o">*</span>rescale<span class="p">))</span> pdf<span class="p">(</span><span class="s">&quot;equinox_weather_grid.pdf&quot;</span><span class="p">,</span> height<span class="o">=</span><span class="m">13</span><span class="o">*</span>rescale<span class="p">,</span> width<span class="o">=</span><span class="m">16</span><span class="o">*</span>rescale<span class="p">)</span> grid.newpage<span class="p">()</span> grid.draw<span class="p">(</span>full_plot<span class="p">)</span> dev.off<span class="p">()</span> fai_ed_temps <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>pafa_fbsa<span class="p">,</span> aes<span class="p">(</span>x<span class="o">=</span>pafa_temp_f<span class="p">,</span> y<span class="o">=</span>ester_dome_temp_f<span class="p">))</span> <span class="o">+</span> geom_rect<span class="p">(</span>data<span class="o">=</span>pafa_fbsa <span class="o">%&gt;%</span> <span class="kp">head</span><span class="p">(</span>n<span class="o">=</span><span class="m">1</span><span class="p">),</span> aes<span class="p">(</span>xmin<span class="o">=-</span><span class="kc">Inf</span><span class="p">,</span> ymin<span class="o">=-</span><span class="kc">Inf</span><span class="p">,</span> xmax<span class="o">=</span><span class="p">(</span><span class="m">32+2.69737</span><span class="p">)</span><span class="o">/</span><span class="m">0.94268</span><span class="p">,</span> ymax<span class="o">=</span><span class="m">32</span><span class="p">),</span> color<span class="o">=</span><span class="s">&quot;black&quot;</span><span class="p">,</span> fill<span class="o">=</span><span class="s">&quot;darkcyan&quot;</span><span class="p">,</span> alpha<span class="o">=</span><span class="m">0.25</span><span class="p">)</span> <span class="o">+</span> geom_point<span class="p">(</span>position<span class="o">=</span>position_jitter<span class="p">())</span> <span class="o">+</span> geom_smooth<span class="p">(</span>method<span class="o">=</span><span class="s">&quot;lm&quot;</span><span class="p">,</span> se<span class="o">=</span><span class="kc">FALSE</span><span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Fairbanks Airport Temperature (degrees F)&quot;</span><span class="p">)</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Ester Dome Temperature (degrees F)&quot;</span><span class="p">)</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> ggtitle<span class="p">(</span><span class="s">&quot;Relationship between Fairbanks Airport and Ester Dome Temperatures</span> <span class="s"> September, 2008-2013&quot;</span><span class="p">)</span> pdf<span class="p">(</span><span class="s">&quot;pafa_fbsa_sept_temps.pdf&quot;</span><span class="p">,</span> height<span class="o">=</span><span class="m">10.5</span><span class="p">,</span> width<span class="o">=</span><span class="m">10.5</span><span class="p">)</span> <span class="kp">print</span><span class="p">(</span>fai_ed_temps<span class="p">)</span> dev.off<span class="p">()</span> fai_ed_wspds <span class="o">&lt;-</span> ggplot<span class="p">(</span>data<span class="o">=</span>pafa_fbsa<span class="p">,</span> aes<span class="p">(</span>x<span class="o">=</span>pafa_wspd_mph<span class="p">,</span> y<span class="o">=</span>ester_dome_wspd_mph<span class="p">))</span> <span class="o">+</span> geom_point<span class="p">(</span>position<span class="o">=</span>position_jitter<span class="p">())</span> <span class="o">+</span> geom_smooth<span class="p">(</span>method<span class="o">=</span><span class="s">&quot;lm&quot;</span><span class="p">,</span> se<span class="o">=</span><span class="kc">FALSE</span><span class="p">)</span> <span class="o">+</span> scale_x_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Fairbanks Airport Wind Speed (MPH)&quot;</span><span class="p">)</span> <span class="o">+</span> scale_y_continuous<span class="p">(</span>name<span class="o">=</span><span class="s">&quot;Ester Dome Wind (MPH)&quot;</span><span class="p">)</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> ggtitle<span class="p">(</span><span class="s">&quot;Relationship between Fairbanks Airport and Ester Dome Wind Speeds</span> <span class="s"> September, 2008-2013&quot;</span><span class="p">)</span> pdf<span class="p">(</span><span class="s">&quot;pafa_fbsa_sept_wspds.pdf&quot;</span><span class="p">,</span> height<span class="o">=</span><span class="m">10.5</span><span class="p">,</span> width<span class="o">=</span><span class="m">10.5</span><span class="p">)</span> <span class="kp">print</span><span class="p">(</span>fai_ed_wspds<span class="p">)</span> dev.off<span class="p">()</span> </pre></div> </div> </div> Tue, 13 Sep 2016 18:31:28 -0800 http://swingleydev.com/blog/p/1999/ weather running Equinox Marathon Buddy, 2001—2016 http://swingleydev.com/blog/p/1998/ <div class="document"> <div class="figure align-right"> <a class="reference external image-reference" href="//media.swingleydev.com/img/photolog/2016/02/buddy_falling_asleep_on_a_house_2016-02.jpg"><img alt="" src="//media.swingleydev.com/img/blog/2016/09/buddy_on_house.jpg" style="width: 300px; height: 169px;" /></a> <p class="caption">Buddy</p> </div> <p>This morning I came down the stairs to a house without Buddy. He liked sleeping on the rug in front of the heater at the bottom of the stairs and he was always the first dog I saw in the morning.</p> <p>Buddy came to us in August 2003 as a two year old and became Andrea’s mighty lead dog. He had the confidence to lead her teams even in single lead by himself, listened to whomever was driving, and tolerated all manner of misbehavior from whatever dog was next to him. He retired from racing after eleven years, but was still enjoying himself and pulling hard up to his last race.</p> <p>Our friend, musher, and writer Carol Kaynor wrote this about him in 2012:</p> <blockquote> <p>But it will be Buddy who will move me nearly to tears. He will drive for 6 full miles. On the very far side of 10 years old, with his eleventh birthday coming up in a month, he will bring us home to fourth place for the day and a respectable time for the distance. I’ll step off that sled as happy as if I’d won.</p> <p>It wasn’t me pushing. I don’t get any credit for a run like that. It was Buddy pushing himself, like the champion he is.</p> </blockquote> <p>Read the whole post here: <a class="reference external" href="https://carolkaynor.wordpress.com/2012/02/25/tribute-to-a-champion/">Tribute to a champion</a>.</p> <p>After he retired, he enjoyed walking on the trails around our house, running around in the dog yard with the younger dogs, but most of all, relaxing in the house on the dog beds. He was a big, sweet, patient dog that took everything in stride and who wanted all the love and attention we could give him. The spot at the bottom of the stairs is empty now, and we will miss him.</p> <div class="figure align-center"> <a class="reference external image-reference" href="//media.swingleydev.com/img/photolog/2012/03/buddy_post_day_1.jpg"><img alt="" src="//media.swingleydev.com/img/blog/2016/09/buddy_post_day_1_600.jpg" style="width: 450px; height: 600px;" /></a> <p class="caption">Buddy in lead in Tok, 2012</p> </div> <div class="figure align-center"> <a class="reference external image-reference" href="//media.swingleydev.com/img/photolog/2012/06/mr_buddy.jpg"><img alt="" src="//media.swingleydev.com/img/blog/2016/09/mr_buddy_600.jpg" style="width: 600px; height: 600px;" /></a> <p class="caption">Mr. Buddy</p> </div> </div> Fri, 09 Sep 2016 07:28:42 -0800 http://swingleydev.com/blog/p/1998/ Buddy memorial Earliest 80+ degree daily maximum temperature in Fairbanks http://swingleydev.com/blog/p/1997/ <div class="document"> <p>This morning’s weather forecast:</p> <pre class="literal-block"> SUNNY. HIGHS IN THE UPPER 70S TO LOWER 80S. LIGHT WINDS. </pre> <p>May 13th seems very early in the year to hit 80 degrees in Fairbanks, so I decided to check it out. What I’m doing here is selecting all the dates where the temperature is above 80°F, then ranking those dates by year and date, and extracting the “winner” for each year (where <tt class="docutils literal">rank</tt> is 1).</p> <div class="highlight"><pre><span class="k">WITH</span> <span class="n">warm</span> <span class="k">AS</span> <span class="p">(</span> <span class="k">SELECT</span> <span class="k">extract</span><span class="p">(</span><span class="k">year</span> <span class="k">from</span> <span class="n">dte</span><span class="p">)</span> <span class="k">AS</span> <span class="k">year</span><span class="p">,</span> <span class="n">dte</span><span class="p">,</span> <span class="n">c_to_f</span><span class="p">(</span><span class="n">tmax_c</span><span class="p">)</span> <span class="k">AS</span> <span class="n">tmax_f</span> <span class="k">FROM</span> <span class="n">ghcnd_pivot</span> <span class="k">WHERE</span> <span class="n">station_name</span> <span class="o">=</span> <span class="s1">&#39;FAIRBANKS INTL AP&#39;</span> <span class="k">AND</span> <span class="n">c_to_f</span><span class="p">(</span><span class="n">tmax_c</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">80</span><span class="p">.</span><span class="mi">0</span><span class="p">),</span> <span class="n">ranked</span> <span class="k">AS</span> <span class="p">(</span> <span class="k">SELECT</span> <span class="k">year</span><span class="p">,</span> <span class="n">dte</span><span class="p">,</span> <span class="n">tmax_f</span><span class="p">,</span> <span class="n">row_number</span><span class="p">()</span> <span class="n">OVER</span> <span class="p">(</span><span class="n">PARTITION</span> <span class="k">BY</span> <span class="k">year</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">dte</span><span class="p">)</span> <span class="k">AS</span> <span class="n">rank</span> <span class="k">FROM</span> <span class="n">warm</span><span class="p">)</span> <span class="k">SELECT</span> <span class="n">dte</span><span class="p">,</span> <span class="k">extract</span><span class="p">(</span><span class="n">doy</span> <span class="k">from</span> <span class="n">dte</span><span class="p">)</span> <span class="k">AS</span> <span class="n">doy</span><span class="p">,</span> <span class="n">round</span><span class="p">(</span><span class="n">tmax_f</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="k">as</span> <span class="n">tmax_f</span> <span class="k">FROM</span> <span class="n">ranked</span> <span class="k">WHERE</span> <span class="n">rank</span> <span class="o">=</span> <span class="mi">1</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">doy</span><span class="p">;</span> </pre></div> <p>And the results:</p> <table border="1" class="tosf docutils"> <caption>Earliest 80 degree dates, Fairbanks Airport</caption> <colgroup> <col width="27%" /> <col width="27%" /> <col width="47%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Date</th> <th class="head">Day of year</th> <th class="head">High temperature (°F)</th> </tr> </thead> <tbody valign="top"> <tr><td>1995-05-09</td> <td>129</td> <td>80.1</td> </tr> <tr><td>1975-05-11</td> <td>131</td> <td>80.1</td> </tr> <tr><td>1942-05-12</td> <td>132</td> <td>81.0</td> </tr> <tr><td>1915-05-14</td> <td>134</td> <td>80.1</td> </tr> <tr><td>1993-05-16</td> <td>136</td> <td>82.0</td> </tr> <tr><td>2002-05-20</td> <td>140</td> <td>80.1</td> </tr> <tr><td>2015-05-22</td> <td>142</td> <td>80.1</td> </tr> <tr><td>1963-05-22</td> <td>142</td> <td>84.0</td> </tr> <tr><td>1960-05-23</td> <td>144</td> <td>80.1</td> </tr> <tr><td>2009-05-24</td> <td>144</td> <td>80.1</td> </tr> <tr><td>…</td> <td>…</td> <td>…</td> </tr> </tbody> </table> <p>If we hit 80°F today, it’ll be the fourth earliest day of year to hit that temperature since records started being kept in 1904.</p> <p><span class="red">Update:</span> We didn’t reach 80°F on the 13th, but got to 82°F on May 14th, tied with that date in 1915 for the fourth earliest 80 degree temperature.</p> </div> Fri, 13 May 2016 06:02:10 -0800 http://swingleydev.com/blog/p/1997/ Fairbanks temperature weather climate