[R] Permutation columns or boostrapping

From: david v <danova_fr_at_hotmail.com>
Date: Thu 12 Jan 2006 - 04:41:37 EST


Hi,
I want to permutate the following matrix and replace permutated columns. Is it possible to control the number of columns permutated. Let's say I only want to permute two columns. Can i do that with the sample method or should i any bootstrapping method ?? I'm not sure this is the best statisticaly way of doing it...??
So the idea behind is to ramdonly generate 1000 permutated matrices from the original data matrix and estimated the significance of each of the values. Any help would be extremely apreciated..

Here is the code i have so far... that works

x <- matrix(1:10,nr=5,nc=6)
>x

     [,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1 6 1 6 1 6
[2,] 2 7 2 7 2 7
[3,] 3 8 3 8 3 8
[4,] 4 9 4 9 4 9
[5,] 5 10 5 10 5 10

>y<-x[,sample(1:6,replace=TRUE)]
>y

     [,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1 6 6 1 6 6
[2,] 2 7 7 2 7 7
[3,] 3 8 8 3 8 8
[4,] 4 9 9 4 9 9
[5,] 5 10 10 5 10 10

best,
david



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jan 12 04:51:45 2006

This archive was generated by hypermail 2.1.8 : Thu 12 Jan 2006 - 06:24:13 EST