Hi all, this is OT, but maybe someone can give me a clue. I've got data from eye tracker experiments (750 data points). These figures show how the data lock like |** * ***** |*** ****** | ** **** | * * | | * * | | * |-------------- |--------------- Y axes display velocity, x axes display time, * are the data points. My question is if there is a method to compare these graphs statistical and decide if they are different from each other or not. Maybe I can divide the x axes into several intervals and compare the means? Thanks for any suggestions, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi Sven, I am just doing something similar- my graphs are densities of nonnegative r.v's (with all probability mass at fixed bounded interval). Then I compute their "distance" by dist (mva package needed), i.e. my.dist<-dist(t(cbind(dens1$y, dens2$y))) (provided that dist1$x==dist2$x, of course) The problem of course is, how to decide about statistical and/or "practical" significance of a difference. I cannot remain myself of some correct statistical test of such hypothesis H: f_1 \eqiv f_2 (given that at least the family of f_1, f_2 is known) vs. H_1: f_1 \neq f_2 The Kolmogorov-Smirnov may be not sensitive to some alternatives. But still the comparison of (appropriate kernel estimates of) densities may be of some help. Jan ------------------------------------------------- designed for _monospaced_ font ------------------------------------------------- /- Jan Svatos, Sokolovska 855/225 -/ /- Data Analyst, Prague 9 -/ /- Eurotel Praha 190 00 -/ /- jan_svatos at eurotel.cz Czechia -/ ------------------------------------------------- - - - Original message: - - - From: owner-r-help at stat.math.ethz.ch Send: 10/22/01 3:14:11 PM To: R-Help <r-help at stat.math.ethz.ch> Subject: [R] OT: compare several graphs Hi all, this is OT, but maybe someone can give me a clue. I've got data from eye tracker experiments (750 data points). These figures show how the data lock like |** * ***** |*** ****** | ** **** | * * | | * * | | * |-------------- |--------------- Y axes display velocity, x axes display time, * are the data points. My question is if there is a method to compare these graphs statistical and decide if they are different from each other or not. Maybe I can divide the x axes into several intervals and compare the means? Thanks for any suggestions, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I am not sure too, if method I proposed is statistically sound (probably not, as the way the density is estimated depends on chosen kernel, bandwidth,... and I had not do any "optimization" of this kind). dist() and Euclidean distance: Yes, I am not sure, if use of Euclidean distance is appropriate, probably weighted distance (with weights defined by theoretical density, if available) would be better. The resample approach is interesting and for testing is definitely better than plain Euclidean distance I proposed. (My use of distances was motivated only to compare the magnitude of differences as I tried to decide, what profiles/graphs are more/less similar to given "typical" profile, and no testing was involved). OTOH, this test would probably not be sensitive to shift/location alternatives, as I have checked experimentally. Thanks, Jan> >Jan Svatos > >> >> Hi Sven, >> >> I am just doing something similar- >> my graphs are densities of nonnegative r.v's (with all probability massat>> fixed bounded interval). >> Then I compute their "distance" by dist (mva package needed), i.e. >> >> my.dist<-dist(t(cbind(dens1$y, dens2$y))) >> >> (provided that dist1$x==dist2$x, of course) >> The problem of course is, how to decide about statistical and/or >> "practical" significance of a difference. >> I cannot remain myself of some correct statistical test of suchhypothesis>>Kaspar Pflugshaupt: > >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 notsure>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 > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._