https://github.com/cran/smacof
Raw File
Tip revision: 2dfed157e74c5e45bda25065297acd0709f91b47 authored by Jan de Leeuw on 07 February 2009, 01:05:57 UTC
version 0.9-3
Tip revision: 2dfed15
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