Re: [R] Splitting a data column randomly into 3 groups

2021-09-06 Thread AbouEl-Makarim Aboueissa
Hi Bert and All: good morning I promise this would be the last time to write about this topic. I come up with this R function (please see below), for sure with your help. It works for all sample sizes. I also provided three different simple examples. with many thanks abou ##

Re: [R] Splitting a data column randomly into 3 groups

2021-09-05 Thread Bert Gunter
In case anyone is still interested in my query, note that if there are n total items to be split into g groups as evenly as possible, if we define this as at most two different size groups whose size differs by 1, then: if n = k*g + r, where 0 <= r < g, then n = k*(g - r) + (k + 1)*r . i.e. g-r

Re: [R] Splitting a data column randomly into 3 groups

2021-09-04 Thread Avi Gross via R-help
om: R-help On Behalf Of AbouEl-Makarim Aboueissa Sent: Saturday, September 4, 2021 5:13 PM To: Thomas Subia Cc: R mailing list Subject: Re: [R] Splitting a data column randomly into 3 groups Dear Thomas: Thank you very much for your input in this matter. The core part of this R code(s) (please s

Re: [R] Splitting a data column randomly into 3 groups

2021-09-04 Thread Bert Gunter
I have a more general problem for you. Given n items and 2 <=g < wrote: > > Dear Thomas: > > > Thank you very much for your input in this matter. > > > The core part of this R code(s) (please see below) was written by *Richard > O'Keefe*. I had three examples with different sample sizes. > > > >

Re: [R] Splitting a data column randomly into 3 groups

2021-09-04 Thread AbouEl-Makarim Aboueissa
Dear Thomas: Thank you very much for your input in this matter. The core part of this R code(s) (please see below) was written by *Richard O'Keefe*. I had three examples with different sample sizes. *First sample of size n1 = 204* divided randomly into three groups of sizes 68. *No problems

Re: [R] Splitting a data column randomly into 3 groups

2021-09-03 Thread AbouEl-Makarim Aboueissa
Hi Richard: Thank you very much for your help in this matter. with thanks abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor, Statistics and Data Science* *Graduate Coordinator* *Department of Mathematics and Statistics* *University of Southern Maine* On Fri, Sep 3,

Re: [R] Splitting a data column randomly into 3 groups

2021-09-03 Thread AbouEl-Makarim Aboueissa
ing this regularly, use of some packages is highly valuable. > > > > Good Luck. > > > > > > > > > > > > From: AbouEl-Makarim Aboueissa > Sent: Thursday, September 2, 2021 9:51 PM > To: Avi Gross > Cc: R mailing list > Subject: Re: [R] Split

Re: [R] Splitting a data column randomly into 3 groups

2021-09-03 Thread Richard O'Keefe
Your question is ambiguous. One reading is n <- length(table$Data) m <- n %/% 3 s <- sample(1:n, n) X <- table$Data[s[1:m]] Y <- table$Data[s[(m+1):(2*m)]] Z <- table$Data[s[(m*2+1):(3*m)]] On Fri, 3 Sept 2021 at 13:31, AbouEl-Makarim Aboueissa wrote: > > Dear All: > > How to

Re: [R] Splitting a data column randomly into 3 groups

2021-09-02 Thread Avi Gross via R-help
r 2, 2021 9:51 PM To: Avi Gross Cc: R mailing list Subject: Re: [R] Splitting a data column randomly into 3 groups Sorry, please forget about it. I believe that I am very serious when I posted my question. with thanks abou __ AbouEl-Makarim Aboueissa, PhD Profes

Re: [R] Splitting a data column randomly into 3 groups

2021-09-02 Thread Jim Lemon
Hi Abou, One way is to shuffle the original data frame using sample(). and split up the result into three equal parts. I was going to provide example code, but Avi's response popped up and I kind of agree with him. Jim On Fri, Sep 3, 2021 at 11:31 AM AbouEl-Makarim Aboueissa wrote: > > Dear

Re: [R] Splitting a data column randomly into 3 groups

2021-09-02 Thread AbouEl-Makarim Aboueissa
t; -Original Message- > From: R-help On Behalf Of AbouEl-Makarim > Aboueissa > Sent: Thursday, September 2, 2021 9:30 PM > To: R mailing list > Subject: [R] Splitting a data column randomly into 3 groups > > Dear All: > > How to split a column data

Re: [R] Splitting a data column randomly into 3 groups

2021-09-02 Thread Avi Gross via R-help
to know how to copy just the ones that were not selected, we could easily ... -Original Message- From: R-help On Behalf Of AbouEl-Makarim Aboueissa Sent: Thursday, September 2, 2021 9:30 PM To: R mailing list Subject: [R] Splitting a data column randomly into 3 groups Dear All: How

[R] Splitting a data column randomly into 3 groups

2021-09-02 Thread AbouEl-Makarim Aboueissa
Dear All: How to split a column data *randomly* into three groups. Please see the attached data. I need to split column #2 titled "Data" with many thanks abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor, Statistics and Data Science* *Graduate Coordinator* *Department of