I have a newbie question, sorry for that. I am doing the metric multidimensional scaling step-by-step in R. Therefore, I have to compute the following:
brs = ars - mean(ar) - mean(as) + mean(a)
I tried it with this code but of course it delivers correct results only for the diagonale:
i <- c(1:5)
j <- c(1:5)
brs <- (A[i,j] - colMeans(A[i,]) - rowMeans(A[,j]) + mean(A))
FYI:
A <- matrix(c(0,-40.5,-8,-50,-24.5,-10.5,0,-4.5,-0.5,-2,-8,-4.5,0,-32,-18,-50,-0.5,-32,0,-12.5,-24.5,-2,-18,-12.5,0),nrow=5)
The result should be a matrix with the following values:
B <- matrix(c(33.8,-21.8,13.7,-21.8,-3.9,-21.8,3.6,2.1,12.6,3.5,13.7,2.1,9.6,-15.9,-9.5,-21.8,12.6,-15.9,22.6,2.5,-3.9,3.5,-9.5,2.5,7.4),nrow=5)