Random Sampling

G

Guest

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.
 
G

Guest

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
 
J

Jerry W. Lewis

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/[email protected]

implements the 2003 algorithm in VBA.

An even better algorithm is the Mersenne Twister

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/FORTRAN/fortran.html
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html

which is implemented in the freeware NtRand

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

Jerry
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top