G***G 发帖数: 16778 | 1 given a set of numbers, such as {1,3,8,100,200,4,3,2,5,...}
the totoal number of the numbers is 99.
how to evenly divide the set into three groups?
is there any package in R that can achieve this? | w*******9 发帖数: 1433 | 2 Split based on what criterion? | k*******a 发帖数: 772 | 3 先把 1:99分3组,假设你要的是随机分组
group1<-sample(1:99,33)
group2<-sample((1:99)[-group1],33)
group3<-(1:99)[-c(group1,group2)]
于是,如果你的data是x, 99长度的vector
那么三组就是
x[group1]
x[group2]
x[group3]
【在 G***G 的大作中提到】![](/moin_static193/solenoid/img/up.png) : given a set of numbers, such as {1,3,8,100,200,4,3,2,5,...} : the totoal number of the numbers is 99. : how to evenly divide the set into three groups? : is there any package in R that can achieve this?
| D******n 发帖数: 2836 | 4 y not this
idx <- sample(1:99);
1) x[idx[1:33]]
2) x[idx[34:66]]
3) ...
【在 k*******a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 先把 1:99分3组,假设你要的是随机分组 : group1<-sample(1:99,33) : group2<-sample((1:99)[-group1],33) : group3<-(1:99)[-c(group1,group2)] : 于是,如果你的data是x, 99长度的vector : 那么三组就是 : x[group1] : x[group2] : x[group3]
| G***G 发帖数: 16778 | 5 I may not explain it clearly.
divide the 99 number into three groups and let the three groups with no
significant differnce.
this may be difficult. let us do splitting into two groups first.
10000 numbers divided evenly into two groups.
group1={x1,x2,...x5000}
group2={x5001,x5002,x10000}
the pvalue of significant differnce between group1 and group2 must be
maximum,
which means no significant difference.
【在 D******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : y not this : idx <- sample(1:99); : 1) x[idx[1:33]] : 2) x[idx[34:66]] : 3) ...
| k*******a 发帖数: 772 | 6 you can try permutation then
【在 G***G 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I may not explain it clearly. : divide the 99 number into three groups and let the three groups with no : significant differnce. : this may be difficult. let us do splitting into two groups first. : 10000 numbers divided evenly into two groups. : group1={x1,x2,...x5000} : group2={x5001,x5002,x10000} : the pvalue of significant differnce between group1 and group2 must be : maximum, : which means no significant difference.
| G***G 发帖数: 16778 | 7 combination(10000,5000)/2 times?
【在 k*******a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : you can try permutation then
|
|