If someone proposes a bet to you, then you should be suspicious that they already know they're going to win. And one frequent topic of such bets is the weather... What if I bet you there's a city in Canada with a warmer average January temperature than Raleigh, NC? You might think you're poised to make some easy money, eh? Well, be warned - watch out for old guys, and their weather bets!
This interesting bit of weather trivia was actually mentioned by someone who read my previous blog post about parts of Canada being farther south than parts of the US. Brian Rupert pointed out in the comments that Canada's mildest city (Victoria) typically experiences warmer winters than Raleigh, NC (the area I live in). With an open mind, I knew this might be possible - but of course I wanted to see the data for myself!
I did a web search, and found that I could see the monthly average temperature data for Raleigh & Victoria on the climate-data.org website. I copy-n-pasted the data to a text file, so I could easily read it into my SAS job.
In addition to the data, their website also provided graphs. Below is their graph for the monthly average temperature in Raleigh. But their graph is a bit crowded/cluttered for the question I wanted to answer. In addition to the temperature line graph, they also overlaid a bar chart showing the rainfall. Having all the extra information in the graph made it harder to see the information I was interested in. Also, using their website, I would need to look at two separate graphs to compare Raleigh and Victoria.
My Preliminary Graph
I used the following minimal code to get a basic graph of the temperature data for the two cities, plotted together so you can easily compare them. And if you look very closely, you can see that the blue line (Victoria) is slightly above the red line (Raleigh) for the month of January.
My Final Graph
If you've read my previous blog posts, you already know that I'm not one to leave a simple graph alone. I like to add customizations that help make the data easier to understand, and the questions being asked about the data easier to answer. Therefore I added a few customizations:
- I added the 'degrees' symbol to the numeric values along the y-axis, so it's more obvious that they are temperature values.
- I created a user-defined-format to show the numeric month values (1-12) along the x-axis as the text words (Jan-Dec).
- I added very light/subtle markers along the lines, so you can tell where the actual monthly values are (as opposed to the interpolated sections of the line).
- I added some reference lines, to help put the data into context.
- Rather than using a color legend, I place a label at the end of each line.
- And I add a table of the data values below the x-axis, so you can see the actual data values (this gives you an easy way to see that Raleigh's value is indeed lower than Victoria's value for January).
Were you surprised by this data? What are some factors that keep Victoria so 'warm' in the winter? Feel free to discuss in the comments!
And if you'd like to see the full SAS code used for the final graph, click here.