Thursday, January 26, 2012

All I Don’t Know About Surveys

I believe my survey experiment Survey Time illustrated later in this post and in Google’s Visualization of Survey Responses mainly pointed out how ignorant I am about the very complicated science of surveying from building the survey to the visualization of the results.  Thanks very much though to all the fine folks who responded, and I’m always open to suggestions through this survey or the traditional methods of commenting, Twittering, or emailing.  I also really appreciate Markus Gesmann’s post Feedback from vignette survey for giving me the idea and Michael Friendly’s for helping me think through the visualization.  I have not had a chance to read, but

this appears to be the Bible of survey and non-quantitative visualization.  Also, I got a big kick out of this Advanced logo: a language for learning since at 7 seven years old the Logo turtle introduced me to programming and assured my destiny of a lifetime of geekdom.

Unfortunately, this visualization is not my most stunning or best work, but I wanted to make sure that I shared for anyone that might find it helpful or inspirational.   There are lots of ways to get Google Docs into R, but I choose the easiest and least elegant.  Google allows publishing to the web as csv.

From TimelyPortfolio
From TimelyPortfolio

Then we can simply use the base read.csv file to access the results to get the following visualization of the survey.  If you want to see the full set of results, go to

From TimelyPortfolio

R code in Gist (click to download)  One comment recommended that I do not show the code in the post.  Please let me know if you agree or disagree.

Thanks again to everyone who responded and all my loyal readers.

Wednesday, January 18, 2012

Look Over My Shoulder with Hangout?

Inspired by the post More Office Hours in 2012 and the survey results, I thought I would offer office hours while blogging/playing in R.  If anyone is interested, please send me an email at kent.russell at, or just look for me at Google Hangout.  I’ll do my first 1/18/2012 from 4:27 pm to 5:00 pm central.


follow up: got 3 participants in my Hangout experiment all through, but unfortunately nobody knew about R or my blog.  Maybe I should switch to an unlisted Hangout if that is possible.

Tuesday, January 17, 2012

Google’s Visualization of Survey Responses

As I try to develop the most beautiful and informative visualization of the survey responses Survey Time, I thought I should have a base case on which I could improve.  Fortunately, Google offers a visualization, which I think is actually pretty good.  Thanks to everyone who has responded.  Please respond (takes less than 1 minute) if you have not yet.

Foreign Currencies and US 10y Treasury Yields

Since I explored the relationship between the Japanese Yen and the US 10y Treasury Yield on Friday, I thought it might be worthwhile to extend the exploration to a much broader range of currencies. I personally am most interested on how Asian Central Bank manipulation has affected the US 10y yield, and how if that changes what might be the impact to world markets. Please let me know your thoughts.

From TimelyPortfolio
From TimelyPortfolio

R code in GIST:

Friday, January 13, 2012

Are We Japanese?

Most of the discussion trying to determine if the U.S. is Japan 20 years later focuses on the economy and the stock market.  However, one of the biggest and most persistent correlations between Japan and the U.S. are the Japanese Yen and the U.S. 10 Year Treasury Yield.  I think it is essential to really try to explore this relationship to help determine “How Japanese are we?”  With the US $ in decline, it is hard to imagine the continued persistence of this dynamic. (Thanks reader teramonagi for catching an error.)

From TimelyPortfolio

For additional thoughts on Japan, please see my post Japan Intentional or Accidental Pursuit of Deflation.

R code in GIST:

Thursday, January 12, 2012

Stocks When Bonds are Extreme

In Extreme Bond Returns, I did not consider the context of extreme bond returns, so let’s examine annual returns for the Dow Jones Industrial Average when bonds experience extreme annual returns.  I was very surprised that stocks performed extremely well when bonds also did extremely well.  Unfortunately, 6 of the 8 periods all occurred during the incredible 30 year bond bull 1980-2011, so it is difficult to come to any universal conclusions.

From TimelyPortfolio

And a little different look with lattice

From TimelyPortfolio

R code from GIST:

Quick Update on the Components of Bond Returns

In Real Squeeze, -1% Guaranteed Real Real Return! Yummy??, and Historical Sources of Bond Returns, I offer some historical perspective on the only sources of bond returns: inflation, real returns, and credit.  Assuming no credit risk in US Treasuries (probably not a good assumption given this Bloomberg quote on CDS on US Treasuries), the formula is fixed, and all inputs except inflation are provided ex-ante.  While bond prices can fluctuate wildly (Extreme Bond Returns), the experience over the life of a bond and a bond index is predetermined by the yield to maturity.  Unfortunately, that guaranteed experience in inflation or deflation is not so pleasant.

While everyone should know R, I understand that some readers would prefer an easier route.  FRED as usual comes to the rescue.  Unfortunately though, labeling is not allowed.  The codes can be translated as follows:

  • DBAA = total return on BAA
  • DBAA – (DGS10 – DFII10) = credit return
  • DGS10 – DFII10 = inflation (expected)
  • DGS10 = real return

In the spirit of continuous improvement, here is the chart now using lattice and latticeExtra.

From TimelyPortfolio

R code now in GIST:

Wednesday, January 11, 2012

Survey Time

After I completed the vignette survey, I was amazed with the process, functionality, and potential R integration from Google Docs forms.  I just had to make one of my own. As I try to say in each post, I love comments, suggestions, and feedback.  Please let me know what you think.

Anyone who would like to see the results real-time, please see and Google’s visualization

Tuesday, January 10, 2012

Production Quality Bullets?

Incrementalism can lead to good (in design) or bad (in politics) outcomes.  Subtle changes to reports can often yield significant benefits.  I hope I was able to achieve a positive experience with just a couple modifications to Better Bullets. To achieve this result, please use the newest excelgrf_macros.xlsm.

From TimelyPortfolio

I think the next version might take our formatting abilities a little too far, but I will show it just as another alternative.

From TimelyPortfolio

So far I have not heard any comments or suggestions.  Please send them my way.  I am aware that the instructions are fairly sparse. I hope to do a screencast very soon.

Monday, January 9, 2012

R in Axys (Impossible Dream)

It has always been a dream of mine to incorporate R graphs and analysis in an Advent Axys report.  The unbelievable work from the guys at Statconn make this dream possible.  If we use the same perhstsp.rep created for Better Bullets, and then apply a little Excel macro magic excelgrf_macros.xlsm with help from RExcel and PerformanceAnalytics, we can go from

From TimelyPortfolio
From TimelyPortfolio


From TimelyPortfolio

I never really expected to be able to accomplish this.  Roll Tide!

Better Bullets

As I reread my Few’s Bullets in Axys Reports post, I think the better way to visualize this

From TimelyPortfolio

would be to make the max the max from the entire series, so the scale is consistent.

From TimelyPortfolio

The very slightly changed Excel file with the new line of code is here. Everything else is the same as Few’s Bullets in Axys Reports.

As always, I love comments and suggestions.  Please let me know your thoughts.

Friday, January 6, 2012

Few’s Bullets in Axys Reports

Just a couple of days ago, I would have said what I am about to show was impossible in Axys reports.  However, with the very fine work from Fabrice Rimlinger and a little stretching of the boundaries, I have been able to get bullet performance graphs in an Axys performance report.  For more on Stephen Few’s innovative bullet charts, see or for his books see

Just like in Axys Combo Incremental Improvement, we will run a custom report (in this case an amended Axys perhist perhstsp.rep) and use excelgrf_macros.xlsm to get our new macro sparkbullet.

From TimelyPortfolio
From TimelyPortfolio

And we get something amazing but not all that pretty.  I’ll take it though.  Please see the updated Better Bullets for an even better version of this chart.

From TimelyPortfolio

Extreme Bond Returns

20 years of data is nowhere near enough to satisfy my insatiable appetite for bigger datasets.  While I showed Record Long Term Treasury Returns with Vanguard’s US Long Treasury mutual fund, its 20 year life is not sufficient to give me comfort risking money.  What happens when we take the Moody’s AAA rate series dating back to 1919?

My opinion changes dramatically when I include 70 more years, and the opportunity is much less certain.

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio

R code from GIST:

Axys and Graphic Design

I am sure most of my normal readers discovered a long time ago that I have no degree in graphic design, but that does not mean that I cannot try.  To further the proof of concept and hopefully inspire some thought, here is an initial pass at graphic design on Axys Combo Incremental Improvement.

From TimelyPortfolio

Thursday, January 5, 2012

Axys Combo Incremental Improvement

As I experiment more with Power of Sparklines in Advent Axys, I thought my first real challenge would be to get two charts with one report.  In my mind, client reporting generally contains four major sections:

    1. Performance
    2. Activity Summary
    3. Historical Value
    4. Allocation/Current Holdings

For this incremental improvement, I will work on 2 (Activity Summary) and 3 (Historical Value).  The new Excel file can be downloaded at excelgrf_macros.xlsm and our fancy new Axys report at actimval.rep.  I accept no credit for the code in the report since most comes from the standard Axys activity.rep and mval.rep.

The steps will be very similar to those taken in Power of Sparklines in Advent Axys.

First run actimval.rep in Axys reports.

From TimelyPortfolio

Then click graph

From TimelyPortfolio

which brings up the second graph dialog box where we can input the location and name of the Excel file and our new macro.

From TimelyPortfolio

And hopefully you will get something similar to this. Not pretty but certainly a step in the right direction.

From TimelyPortfolio

Currently, most of this is more proof of concept and experimentation, but by the end of all this, I foresee some mighty clean and impressive report packages.  Please comment and contribute.  I know this is pretty domain specific, so let me know if you are out there.  As far as I know the only folks professionally pursuing Axys custom reporting besides Advent are and

Tuesday, January 3, 2012

Power of Sparklines in Advent Axys

I recently discovered the amazing work of Fabrice Rimlinger at and thought of what I believe is a novel way of using the Microsoft Excel integration with Advent Axys reports to potentially achieve a dashboard style report.  This would be far more visually compelling and informative than anything else I have seen in Axys.  For this report, we will just use the standard Axys Portfolio Summary Report and then an Excel macro  Please also install the appropriate Excel add-in from

I know the audience for this will be more limited than my general audience.  I might move these Axys report discussions to my incomplete and defunct site.

For the R lover, I am hoping to also incorporate the unbelievable RExcel from