https://github.com/cran/smacof
Raw File
Tip revision: 4bbe116b459ee73e3d78f1ee99b207b054ccbb6d authored by Jan de Leeuw on 11 May 2011, 00:00:00 UTC
version 1.2-0
Tip revision: 4bbe116
monregS.R
# secondary approach to ties

`monregS` <-
function(x, y, w = rep(1,length(x)), block = weighted.mean)
{
#x ... observed distance matrix
#y ... Guttman transformed distances
#w ... weights

  wag <- tapply(w,x,sum)
  yag <- tapply(y,x,mean)
  xag <- tapply(x,x,mean)
  o <- order(xag)
  r <- order(o)
  e <- pavasmacof(yag[o],wag[o])[r]                  #call pava
  return(ifelse(outer(x,xag,"=="),1,0)%*%e)
}

back to top