Re: [R] Iterations of random sampling

2009-03-11 Thread Chuck Cleland
On 3/11/2009 3:15 PM, René Pineda wrote:
> I have a univariate binary (1,0) 230,000 records, I need to make 20,000 
> iterations of random sampling of a fixed size. Where I put the result of the 
> sum of selected records for each repetition

X <- rbinom(23, 1, .5)

sample.sums <- replicate(2, sum(sample(X, 10)))

> Thank's
>  
> _
> 
> of your life
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org 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. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@r-project.org 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.


[R] Iterations of random sampling

2009-03-11 Thread René Pineda

I have a univariate binary (1,0) 230,000 records, I need to make 20,000 
iterations of random sampling of a fixed size. Where I put the result of the 
sum of selected records for each repetition
 
 
Thank's
 
 
_

of your life

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.