I have 4000 observations that I need to randomly relabel 1000 times and then calculate the mean of the 1000 values at each of the 4000 points. Any ideas for where to begin? Thanks Kevin -- View this message in context: http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3463100.html Sent from the R help mailing list archive at Nabble.com.
Can you explain this a bit more. At the moment I don't see what you are trying to achieve. "calculate the mean of the 1000 values at each of the 4000 points" does not seem to make sense. --- On Wed, 4/20/11, kmatthews <kevin-matthews at uiowa.edu> wrote:> From: kmatthews <kevin-matthews at uiowa.edu> > Subject: [R] Random Relabelling > To: r-help at r-project.org > Received: Wednesday, April 20, 2011, 10:04 AM > I have 4000 observations that I need > to randomly relabel 1000 times and then > calculate the mean of the 1000 values at each of the 4000 > points.? Any ideas > for where to begin? > > Thanks > Kevin >
Hi: How about y <- rnorm(4000) ymat <- rowMeans(replicate(1000, y[sample(4000)])) hist(ymeans) system.time({y <- rnorm(4000); yy <- rowMeans(replicate(1000, y[sample(4000)]))}) user system elapsed 0.19 0.03 0.22 HTH, Dennis On Wed, Apr 20, 2011 at 7:04 AM, kmatthews <kevin-matthews at uiowa.edu> wrote:> I have 4000 observations that I need to randomly relabel 1000 times and then > calculate the mean of the 1000 values at each of the 4000 points. ?Any ideas > for where to begin? > > Thanks > Kevin > > -- > View this message in context: http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3463100.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. >
Apparently Analagous Threads
- Re: [common PATCH 3/3] mlcustomize: do not relabel if not enforcing (RHBZ#1828952)
- SELinux relabel API
- Re: [libvirt] [PATCH tck] Relabel SELinux when customizing virt-builder image
- Re: [common PATCH 3/3] mlcustomize: do not relabel if not enforcing (RHBZ#1828952)
- [PATCH 0/2] Implement virt-builder --selinux-relabel option.