Category Archives: programming

Bump charts get renamed as SLOPEGRAPHS

Charlie Park has a nice post describing Tufte’s slopegraphs (old chart, new name).

Kaiser Fung likes these a lot; he’s been calling them Bump charts.

I introduce these to my undergrads when we discuss the paired t test.

Tip from kottke.org.
Update (16 July).  James Kierstead publishes an R implementation.

Learn MATLAB, cheap

Cleve Moler, Chairman and Chief Scientist at the MathWorks, has published an online MATLAB texbook, Numerical Computing with MATLAB.  You can download the chapters as individual PDFs, for free.

Tip from the MathWorks, via email. (I knew there was a reason to stay on that mailing list!)

Better than pretty

Pretty R is a syntax formatter for R, it generates highlighted and properly indented R code suitable for including in an HTML document.  Better yet, all the R keywords are linked back to an online reference manual at inside-r.org!  Check it out.

# multiple comparison with aov 
 
s <- read.table("dogFoodSales.txt",header=T)
 
# fit the ANOVA model and perform post hoc test (Tukey's HSD)
 
print( summary( smodel <- aov(sales ~ location, data=s) ) )
print( TukeyHSD(smodel,"location", ordered=TRUE) )
 
# check residuals for normality
 
qqnorm(smodel$residuals)
qqline(smodel$residuals)
print(shapiro.test(smodel$residuals))
 
# check for homogeneity of variance
 
attach(s)
print(bartlett.test(sales ~ location))
 
# just in case, verify with nonparametric test
 
print(kruskal.test(sales ~ location))
 
detach(s)

Tip from the R Bloggers.