[R] Sampling in R
Noam Friedman
noamfrie at qos.net.il
Thu Mar 23 11:52:48 CET 2006
Hi all!
I was wondering if you can help me with a little sampling issue I'm
having in R.
I have a database with 100 observations.
I need to sample n=9 sample size, 200 times (i.e. get 200 samples of
size 9).
N (pop. size) =100
Each sample can't contain the same observation more than one time
(i.e. the program needs to check if the obs. has already been sampled
into the sample - it it has, it should put it back and sample again
another obs.)
obviously I need to do this with replacement.
Then, I need to draw (I think the best is with a histogram) the
distribution of the mean of each os the 200 samples.
I guess I need to do a loop for the 'sample' function in R.
I could really use your help.
Regards,
Noam Friedman.
More information about the R-help
mailing list