Statistical Simulations
Simulations marked RVLS are from the
Rice Virtual Laboratory for Statistics ; those marked UAH are from the University of Alabama at Huntsville.
Introductory simulations
- Descriptive Statistics (RVLS)
If you can master painting the histogram in this demonstration, you will learn about the mean and median and skewness. It will also provide an illustration of how to set up a table to compute the variance and standard deviation.
- Histogram demonstration (RVLS)
The number of bin widths can be important! Try especially the Old Faithful data.
(The two graphs below show cross-validation statistics; don't worry about what they are,
but note that clicking on the plus signs below those graphs changes bin widths.
Try to pick out the WORST histogram by clicking on the plus signs.)
- Correlation (RVLS)
Animation of how correlation changes when you change the scatter of X and Y. Type a larger number into the Standard error of estimate box to increase the scatter of Y, and a larger number into the Standard deviation of X box to increase the scatter of X.
The Pearson's r number is what we call rho or the correlation coefficient .
- Regression by eye (RVLS)
How good are you at seeing the relation between two variables?
Try drawing your own line and comparing it to the regression line fit by the computer (check the box below the plot for the computer's line).
On the right, you also have a chance to guess the correlation
-
Coin Tossing (UAH) Toss many coins
You can set the number of coins and the probability of heads by using the sliders on the applet, and see a histogram representing the results as well. The instructions below apply to many of the applets from the University of Alabama.
Single-step your way through the demo (use the button marked with the PLAY symbol from a CD player) to see the ball fall in slow motion (with sound effects); use the Fast Forward symbol for a continuous run. I find the settings Update 10 and Stop 1000 to result in a nicer distribution than the defaults. (This seems to be the case with most UAH demos).
- Do you think coin tossing is REALLY random?
Check out this paper by Persi Diaconis and
Susan Holmes and Richard Montgomery on "Dynamical Bias in the Coin Toss".
Binomial and normal distributions
-
Galton's Quincunx (UAH)
Francis Galton was an important statistician of the 19th century; Quincunx is Latin for "whatchamacallit."
The applet will contribute a lot to your understanding of the binomial distribution.
-
Rolling Dice (UAH)
Rolling two dice is another way to generate a binomial distribution.
Here you get to choose the number of dice to roll by using the slider.
Be able to describe what happens to the distribution as you increase the number of dice from 1 to 2 to 10 to 30 -- this is key to understanding the material.
You can also load the dice by clicking on the symbol of a die.
What happens if you increase the probability on 1? on 3 and 4?
Again, compare what happens when you roll one die to what happens when you roll 15 or so. Pay attention to the little boxplot under the histogram; it will indicate the interquartile range of outcomes.
Conditional Probability
-
Coin and Die (UAH) Toss a coin, then roll a die.
Note that what makes this interesting is that one of the dice is loaded. If you toss heads and roll the red die, the probability of getting a one or six is higher than would be the case with a fair die.
Changing the slider to guarantee heads (move it to p = 1.00) will show you that the odds of getting a 6 conditonal on heads differ from the odds of a 6 conditional on tails (move the slider to p = 0.00 to see this in the simulation).
-
Die and coin (UAH) Roll a die, then toss a coin.
Note that the resulting distribution graphs the random variable which shows the number of heads you obtain in N tosses -- where N is determined by the pips on the die.
Despite the fact that both the die and the coin are fair by default, the initial distribution is skewed. Can you explain why?
Hypothesis testing -- Sample and population
( Sampling distributions (RVLS)
Even though the population may be skewed, the distribution of the mean tends toward the normal.
To get the main point, you should choose a Skewed or Custom distribution from the first drop-down menu.
- Sample mean distributions (UAH)
Again showing that the mean is normally distributed, even if the underlying distribution is not. In this simulation, change the population distribution from Normal (the results are pretty obvious) to Gamma or Poisson (both skewed population distributions). What happens as you increase the number of observations in the sample is shown by adjusting the slider bar labeled n = 1 to n = 50 .
- Another way to see the Central Limit Theorem in action is to run the EcLS program and issue the command (cltdemo).
Regression analysis
-
Reliability and Regression analysis (RVLS)
In this exercise, you can increase the standard deviations of the X and Y values. There is an interesting contrast between increasing the S.D. of X and increasing the S.D. of Y.
What happens to the slope value if only the X-variable is measured with error?
What happens to the slope estimate if only the Y-variable is measured with error?