Hi R-Help,

I'm trying a develop a test simulation where i evaluate the probability 
of not getting a value of 100 from the function rbinom(6000, 200, .5) 
[indeed, a very small probability].  At the end of each rep, I would 
like to evaluate the output, continue with the loop if the output 
contains the value 100, stop if the output lacks a 100.

How do I get R to evaluate the output after each rep?


 >sim <- function(nn){
 >   for (ii in 1:nn){
 >      ee=rep(rbinom(6000, 200, .5), ii)
 >         if (any(ee==100))
 >      }

Thanks,
Matt MacManes
********************************************************
Matthew D. MacManes
PhD Student
UC- Berkeley
Department of Integrative Biology
Museum of Vertebrate Zoology
3101 VLSB #3140
Berkeley, CA 94720
(510)642-7782
EMAIL: [EMAIL PROTECTED]
WEBSITE: http://ib.berkeley.edu/labs/lacey/

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to