R/seqmds.stress.R

Defines functions seqmds.stress

Documented in seqmds.stress

seqmds.stress <- function(seqdist,mds) {
  datadist <- as.dist(seqdist)
  res <- numeric(length=ncol(mds$points))
  for(i in 1:ncol(mds$points)) {
    fitteddist <- dist(mds$points[,1:i],diag=TRUE,upper=TRUE)
    res[i] <- sqrt(sum((datadist-fitteddist)^2)/sum(datadist^2))
  }
  return(res)
}

Try the seqhandbook package in your browser

Any scripts or data that you put into this service are public.

seqhandbook documentation built on April 3, 2023, 5:45 p.m.