https://github.com/cran/smacof
Raw File
Tip revision: 31f51733b8b246a6c7acc26db29cad177b2f9a21 authored by Jan de Leeuw on 27 July 2008, 00:00:00 UTC
version 1.0-0
Tip revision: 31f5173
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