If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below. If you don't like Google AdSense in the posts, register or log in above.

Using rnd() in VBA

Hi, I am using a sheet which is generating a lot of uniform random numbers. Therefore, rather than using the activecell.formula = "-rand()" method I have been trying to use rnd() instead. However, I am getting the feeling that the numbers generated the latter way are not completely random. I am going of the fact that I generating two functions and then plotting them, and the plots are looking quite different. Does anyone know if this could in fact be the case?

Re: Using rnd() in VBA

Without going into too much detail, my sheet generates two random numbers. The first random numbers outcome is like tossing a coin; if the result is greater than a predetermined value it generates a time value from a particular distribution, if its less it uses another distribution. The second random number is used as the value of x to get the PDF of that particular distribution.
I have used two methods of generating random numbers:
method 1:

To test my hunch I generated 400 observations 100 hundred times with each method. The only thing that was different was the lines of code above. I took the sum of the result of the two functions which are generated and recorded them. I then ran independant samples t-tests on the data. The result was that for both functions the methods of generating the random number proved to be statistically significant at the p<0.001 level, with an eta squared of 0.0761, 0.0732 respectively.