https://github.com/cran/smacof
Raw File
Tip revision: d643973f74bee86ab6d37073463aa9f1cb5ddc6d authored by Jan de Leeuw on 30 November 2011, 00:00:00 UTC
version 1.2-1
Tip revision: d643973
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