Skip to content
Prev 14382 / 398502 Next

OT: compare several graphs

On 22.10.2001 15:30 Uhr, Jan_Svatos at eurotel.cz wrote:

            
I'm not sure if this is statistically sound (comments, please!), but what
about a resampling approach:

  repeat some 1000 times:
     shuffle one column randomly, then compute the distance
  compare your distance to the empirical distribution of
  "resampled distances"

In terms of R code:

  Nreps <- 5000
  dists <- numeric(Nreps)
  for(i in 1:Nreps)
  {
     y2 <- sample(dens2$y)
     dists[i] <- dist(t(cbind(dens1$y, y2)))
  }
  hist(dists)
  quantile(dists, 0.05)


If the original distance is lower than the 5% quantile of the resampled
dists, your two graphs would be "significantly more similar" than "random
graphs". For a two-sided test, you could use

  quantile(dists, c(0.025, 0.975)).

If this makes sense, there is still the problem of the correct distance
measurement. By default, dist() calculates euclidean distances. I'm not sure
it they are appropriate for this kind of data.

As I said, please comment. It's just an idea I had (along the lines of the
"Mantel test").


Cheers

Kaspar Pflugshaupt