data(UN)
attach(UN)
# enter the power-transformation parameter
# start with 1
Ask(p, function(p) qq.plot(box.cox(gdp, p),
ylab=paste("transformed gdp, power =",p)))
# enter an expression that evaluates to a 2-vector
# of powers; e.g., start with c(1,1); then interactively
# identify points in each plot
Ask(p, function(p) scatterplot(box.cox(gdp,p[1]),
box.cox(infant.mortality, p[2]),
xlab=paste("transformed GDP/capita, power =",p[1]),
ylab=paste("transformed infant mortality, power =",p[2]),
labels=rownames(UN)))
Run the code above in your browser using DataLab