#1   Report Post  
Andrea
 
Posts: n/a
Default Random Sampling

I am trying to extract a random sample of 150 numbers from a list of 600 from
the statistical analysis tool.

The problem that I'm having is that the sample keeps coming up with
duplicate numbers.

Can anyone tell me how I can eliminate these duplicates?

Any help would be appreciated

"Jerry W. Lewis" wrote:

The algorithm used depends on your Excel version

http://support.microsoft.com/kb/q86523/
http://support.microsoft.com/kb/q828795/

It also appears that RNGs in the worksheet, Analysis ToolPak, and VBA
each uses a different algorithm. ATP, VBA and pre 2003 worksheet
algorithms are not suitable for serious simmulation work.

http://groups.google.com/groups?selm...g .google.com

implements the 2003 algorithm in VBA.

An even better algorithm is the Mersenne Twister

http://www.math.sci.hiroshima-u.ac.j...at/MT/emt.html
http://www.math.sci.hiroshima-u.ac.j...N/fortran.html
http://www-personal.engin.umich.edu/...neTwister.html

which is implemented in the freeware NtRand

http://www.numtech.com/NtRand/

Jerry

Alex wrote:

Roger

I do not know specifically what algorithm Excel uses to generate a random
sample, but in general, many computers use their 'internal clock' as a source
of a 'random' input and then enter it into an algorithm to come up with a
random sample.

Alex

"Roger" wrote:


When you use the Data Analysis tool, Random Sampling, is there a way to see
how excel comes up with the figures. Ex. You have a set of 5 numbers
1,2,3,4,5. You run a random sample and ask it to output 1 value and excel
spits out 2. Is there a way to see how excel came up with that number? Is
there some behind the scene code that does it or maybe a formula? Any help
would be appreciated.



  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default Random Sampling

http://mcgimpsey.com/excel/udfs/randint.html

--

Regards,

Peo Sjoblom

"Andrea" wrote in message
...
I am trying to extract a random sample of 150 numbers from a list of 600

from
the statistical analysis tool.

The problem that I'm having is that the sample keeps coming up with
duplicate numbers.

Can anyone tell me how I can eliminate these duplicates?

Any help would be appreciated

"Jerry W. Lewis" wrote:

The algorithm used depends on your Excel version

http://support.microsoft.com/kb/q86523/
http://support.microsoft.com/kb/q828795/

It also appears that RNGs in the worksheet, Analysis ToolPak, and VBA
each uses a different algorithm. ATP, VBA and pre 2003 worksheet
algorithms are not suitable for serious simmulation work.


http://groups.google.com/groups?selm...g .google.com

implements the 2003 algorithm in VBA.

An even better algorithm is the Mersenne Twister

http://www.math.sci.hiroshima-u.ac.j...at/MT/emt.html

http://www.math.sci.hiroshima-u.ac.j...N/fortran.html
http://www-personal.engin.umich.edu/...neTwister.html

which is implemented in the freeware NtRand

http://www.numtech.com/NtRand/

Jerry

Alex wrote:

Roger

I do not know specifically what algorithm Excel uses to generate a

random
sample, but in general, many computers use their 'internal clock' as a

source
of a 'random' input and then enter it into an algorithm to come up

with a
random sample.

Alex

"Roger" wrote:


When you use the Data Analysis tool, Random Sampling, is there a way

to see
how excel comes up with the figures. Ex. You have a set of 5 numbers
1,2,3,4,5. You run a random sample and ask it to output 1 value and

excel
spits out 2. Is there a way to see how excel came up with that

number? Is
there some behind the scene code that does it or maybe a formula? Any

help
would be appreciated.





  #3   Report Post  
 
Posts: n/a
Default Random Sampling

Hello Andrea,

You can take my user-defined-function
http://www.sulprobil.com/html/uniqrandint.html

If you want unique random integers let the parameter lMaxOccurrence
stay = 1, if you wwant to allow repetitions, define with this parameter
how many are allowed.

HTH,
Bernd

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
how to use excel to do random sampling stats Excel Discussion (Misc queries) 2 November 9th 05 10:21 PM
Generate random numberes using reference to the other cell. ramana Excel Worksheet Functions 7 October 31st 05 07:09 AM
VBA "Rnd" Function: Truly Random? TheRobsterUK Excel Discussion (Misc queries) 2 September 27th 05 04:50 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"