Re: [R] counting values with some conditions in a simulation

2011-11-25 Thread Jeff Newmiller
A) you need to reply-all to keep the discussion on the mailing list. B) you need to post in plain text. C) this has the arbitrary smell of homework. This is not a homework help line. D) You are overwriting your accumulation variable "sumt" after each test. Since you are not handling this calcul

Re: [R] counting values with some conditions in a simulation

2011-11-25 Thread Jeff Newmiller
You need to read the posting guide. Provide a reproducible code sample, simplified, with self-contained data. You might find the "ave" function useful if you are working with vectorized simulations. --- Jeff Newmiller

Re: [R] counting values with some conditions in a simulation

2011-11-25 Thread jim holtman
How are you computing the sum? Does FAQ 7.31 apply? Showing at least a sample of your code would help. On Friday, November 25, 2011, Sl K wrote: > Dear R users, > > I am running simulations (1000), and in my simulation I am looking at > specific sums. For example, if the sum is >=4 then count t

[R] counting values with some conditions in a simulation

2011-11-25 Thread Sl K
Dear R users, I am running simulations (1000), and in my simulation I am looking at specific sums. For example, if the sum is >=4 then count this, if say <3, then don't count, if the sum=3, then generate a random number from uniform distribution, if this number is say less than 0.5, then count thi