Rbc1356
2012-Jul-19 21:17 UTC
[R] Creating Multiple Repeating samples and Cross Correlating them.
I'm having a lot of trouble getting this done and nothing I've written has been remotely successful. Basically I have about 64 binary data sets stored as vectors, with 72900 entries in each. I am not very familiar with cross correlations, but I was advised that I should create 1000 randomized date sets (used sample() for that) to use as a control, then compare the cross correlation of my real data sets to the controls. First of all I am having trouble creating 1000 different sample()'s of the same vector, and then I am not all too sure how to cross correlate them Nothing seems to produce what I want, all I get are copies of the same sample() of the vector repeated over and over. Please Help? -- View this message in context: http://r.789695.n4.nabble.com/Creating-Multiple-Repeating-samples-and-Cross-Correlating-them-tp4637131.html Sent from the R help mailing list archive at Nabble.com.
John Kane
2012-Jul-20 13:58 UTC
[R] Creating Multiple Repeating samples and Cross Correlating them.
It would help if you supplied some code for us to see what you have tried. However something like this would presumably give you the sample data sets --note only n=100 in the example. mymat <- matrix(NA, ncol= 100, nrow= 100) for (n in 1: 100) { mymat[,n] <- sample(c(0,1), 100, replace = TRUE) } mymat John Kane Kingston ON Canada> -----Original Message----- > From: baileycr at ohsu.edu > Sent: Thu, 19 Jul 2012 14:17:43 -0700 (PDT) > To: r-help at r-project.org > Subject: [R] Creating Multiple Repeating samples and Cross Correlating > them. > > I'm having a lot of trouble getting this done and nothing I've written > has > been remotely successful. Basically I have about 64 binary data sets > stored > as vectors, with 72900 entries in each. I am not very familiar with cross > correlations, but I was advised that I should create 1000 randomized date > sets (used sample() for that) to use as a control, then compare the cross > correlation of my real data sets to the controls. First of all I am > having > trouble creating 1000 different sample()'s of the same vector, and then I > am > not all too sure how to cross correlate them Nothing seems to produce > what I > want, all I get are copies of the same sample() of the vector repeated > over > and over. Please Help? > > -- > View this message in context: > http://r.789695.n4.nabble.com/Creating-Multiple-Repeating-samples-and-Cross-Correlating-them-tp4637131.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.____________________________________________________________ Send any screenshot to your friends in seconds... Works in all emails, instant messengers, blogs, forums and social networks. TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if2 for FREE