[R] Question about random sampling in R

Liaw, Andy andy_liaw at merck.com
Thu Oct 19 20:05:55 CEST 2006


When sampling with replacement (like ordinary bootstrap), each draw is
done independently, and in each draw every point has equal probability
of being drawn.  When sampling without replacement (random permutation),
all possible sequences (permutations) have equal probability of
occurring.  E.g., if the data is 1:2, then (1, 2) has the same
probability of occurring as (2, 1).

Andy

From: tom soyer
> 
> Hi,
> 
> I looked up the help file on sample(), but didn't find the 
> info I was looking for.
> 
> When sample() is used to resample from a distribution, e.g., 
> bootstrap, how does it do it? Does it use an uniform 
> distribution, e.g., runif(), or something else? And, when the 
> help file says:"sample(x) generates a random permutation of 
> the elements of x (or 1:x)", would I be correct if I 
> translate the statement as follows: it means that the order 
> of sequence, which was generated from a uniform distribution, 
> would look like a random normal distribution.
> 
> Thanks,
> 
> Tom
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}



More information about the R-help mailing list