Click here to see the SAS code.
Click here to see the example.
---------------------------------------------------------------
I got us_employment.xls from near the bottom of this page:
http://barrdear.com/john/tag/weekly-hours/
From the following blog:
http://barrdear.com/john/2009/02/11/perspective-comparing-recession/
I'm imitating the following graph:
weekly_hours_workedc.png
First, a comment - I'm a little "leery" about this graph ...
By scaling the left & right axes differently, and *also* scaling
them in such a way that they don't show the maximum spread of the
data (ie, scaling so that there is an unnecessary white-space gap)
I think this graph might be somewhat misleading. By rescaling it
in other ways, it could have just as easily shown any portion of
the graph having the 2 lines matching. Nonetheless, I still
think it's an "interesting" graph, and a good starting point
for discussion.
Technical Details:
I used SAS/Access to read the data directly from the spreadsheet.
I then used "proc gplot" with a 'plot' and a 'plot2' statement
(the plot2 plots against the right-axis). It was a little tricky
getting the 2 legends side-by-side ... I used a title2 to add blank
space, and then I applied legend "offset" to move the legends into
that blank space. And I used annotate to draw the text box with
the extra info inside the graph.
One enhancement - I colored the axis labels to match the line
the corresponded to it. This helps you know exactly which line
goes with which axis. And I also cleaned-up and simplified
the date axis a little.
Back to Samples Index