Re: [R] Sampling with replacement

2010-06-17 Thread Jim Lemon
On 06/17/2010 03:27 AM, Somnath Somnath wrote: Thanks for all those reply. Is there any general rule to determine how many samples I would get from a population of size "n", I draw a sample of size "m" ("m" may be greater than "n") if sample is drawn with replacement? Hi Somnath, If you mean "h

Re: [R] Sampling with replacement

2010-06-16 Thread Johannes Huesing
Somnath Somnath [Wed, Jun 16, 2010 at 07:27:32PM CEST]: > Thanks for all those reply. Is there any general rule to determine how many > samples I would get from a population of size "n", I draw a sample of size > "m" ("m" may be greater than "n") if sample is drawn with replacement? m^n -- Joh

Re: [R] Sampling with replacement

2010-06-16 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Somnath Somnath > Sent: Wednesday, June 16, 2010 10:28 AM > To: r-help@r-project.org > Subject: Re: [R] Sampling with replacement > > Thanks for all t

Re: [R] Sampling with replacement

2010-06-16 Thread Somnath Somnath
Thanks for all those reply. Is there any general rule to determine how many samples I would get from a population of size "n", I draw a sample of size "m" ("m" may be greater than "n") if sample is drawn with replacement? Thanks, 2010/6/16 Jorge Ivan Velez > Hi Rafael, > > You might try: > > >

Re: [R] Sampling with replacement

2010-06-16 Thread Tom La Bone
How about library(TeachingSampling) SupportWR(20,4) Tom -- View this message in context: http://r.789695.n4.nabble.com/Sampling-with-replacement-tp2257450p2257644.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

Re: [R] Sampling with replacement

2010-06-16 Thread Jorge Ivan Velez
Hi Rafael, You might try: > r <- expand.grid(rep(list(1:20), 4)) > dim(r) [1] 16 4 HTH, Jorge 2010/6/16 Rafael Björk <> > If you for some reason want to be shown all the possible combinations, try > expand.grid(1:20,1:20,1:20,1:20) (ugly code). Don't use this for sampling. > > hth Ra

Re: [R] Sampling with replacement

2010-06-16 Thread David Winsemius
On Jun 16, 2010, at 10:20 AM, Somnath Somnath wrote: Dear all, good morning, I have a population, let say members are tagged with some simple number like 1,2,3,...20. I want to draw a sample with replacement of size 4 (say, can be more than 20 also). Already answered on the list. Is t

Re: [R] Sampling with replacement

2010-06-16 Thread Rafael Björk
If you for some reason want to be shown all the possible combinations, try expand.grid(1:20,1:20,1:20,1:20) (ugly code). Don't use this for sampling. hth Rafael 2010/6/16 Jorge Ivan Velez > Try > > sample(20, 4, replace = TRUE) > > HTH, > Jorge > > > On Wed, Jun 16, 2010 at 10:20 AM, Somnath So

Re: [R] Sampling with replacement

2010-06-16 Thread Jorge Ivan Velez
Try sample(20, 4, replace = TRUE) HTH, Jorge On Wed, Jun 16, 2010 at 10:20 AM, Somnath Somnath <> wrote: > Dear all, good morning, > > I have a population, let say members are tagged with some simple number > like > 1,2,3,...20. I want to draw a sample with replacement of size 4 (say, can > be

Re: [R] Sampling with replacement

2010-06-16 Thread Jun Shen
sample(1:20,4,replace=TRUE) should do it. Jun On Wed, Jun 16, 2010 at 9:20 AM, Somnath Somnath wrote: > Dear all, good morning, > > I have a population, let say members are tagged with some simple number > like > 1,2,3,...20. I want to draw a sample with replacement of size 4 (say, can > be > mo

[R] Sampling with replacement

2010-06-16 Thread Somnath Somnath
Dear all, good morning, I have a population, let say members are tagged with some simple number like 1,2,3,...20. I want to draw a sample with replacement of size 4 (say, can be more than 20 also). Is there any R function which will show me all such possible samples? Thanks [[alternative