# Normal Distribution Simulator

Get hands-on experience and develop an intuition for statistics.

We can be over-confident in our statistics: "hey look: the mean is 12.2, it must be true!"

Well, let's start with a theoretical true mean and standard deviation, and use it to create some random data (following a Normal Distribution) ... then imagine we recorded that data and see how closely our stats lead us back to the truth!

Play with this to get a good "feel" for data. Try different sample sizes, etc and see what you get. Use "Generate" a lot, and see how the results vary!

images/norm-dist-sim.js

### Example: Testing A New Medicine

You don't know it, but the new medicine actually reduces the risk of heart attack to 0.9 of the usual value, so is very valuable. But results vary widely (standard deviation of 0.3)

Enter 0.9 and 0.3 and 10 samples (testing is expensive!)

Now click "Generate" and see if your research has shown how valuable this new medicine really is (less than 1 is good)

Try "Generate" many times and imagine each one is a "clinical trial". Notice that some may greatly exaggerate the benefit, others may say the medicine makes things worse.

Try different sample sizes, such as 30, 100, 500.

You can also try a mean of 1.0 (the medicine is useless).

## How to Use

For a population that follows a Normal Distribution first enter the True Mean, True Standard Deviation and How Many in Sample in the top three boxes.

Then click "Generate" to generate a random sample of the chosen size from the population.

This will then give you the Sample Mean, the Sample Standard Deviation and the Confidence Interval (choose from 80% to 99.9% from the drop down menu) for the randomly generated sample.

You can then compare the data for the sample with the data for the population.

## Footnote

The data is created using the "Box-Muller Transformation" and then adjusted for your chosen mean and standard deviation.