![]() |
# Fig 14.1: Row sums for log-transformed and log-centred data
library(StatDA) data(moss) sel=c("Ag","Al","As","B","Ba","Bi","Ca","Cd","Co","Cr","Cu","Fe","Hg","K","Mg", "Mn","Mo","Na","Ni","P","Pb","Rb","S","Sb","Si","Sr","Th","Tl","U","V","Zn") x=moss[,sel] # Closure problem with log-centring transformation xgeom=10^apply(log10(x),1,mean) x2=x/xgeom x2.obj=log10(x2) pdf("fig-14-1.pdf",width=9,height=4.5) par(mfcol=c(1,2),mar=c(4,4,2,2)) rs1=apply(x,1,sum) plot(rs1,ylab="Sum over all variables", xlab="Sample order", cex.lab=1.2, cex=0.75, pch=3, lwd=1) abline(h=quantile(rs1,c(0.25,0.75),col=gray(0.6))) rs2=apply(x2,1,sum) plot(rs2,ylab="Sum over all variables (opened)", xlab="Sample order", cex.lab=1.2, cex=0.75, pch=3, lwd=1) abline(h=quantile(rs2,c(0.25,0.75),col=gray(0.6))) dev.off() |