code etc for Think Stats book http://greenteapress.com/thinkstats/