GMACRO CLT echo ############################################################### # # Neither Minitab Inc. nor the author of this MACRO makes # any claim or offers any warranty whatsoever with regard to # the accuracy of this MACRO or its suitability for use, and # Minitab Inc. and the author of this MACRO each disclaims # any liability with respect thereto. # ############################################################### noecho note note The Central Limit Theorem states that if random samples of size n note are repeatedly drawn from a population with a finite mean, mu(y), and note standard deviation, sigma(y), then when n is large, the distribution note of the sample means will be approximately normal with mean equal to note mu(y), and standard deviation equal to (sigma(y))/sqrt(n). note note note Let's examine the effects of the Central Limit Theorem with the note following experiment. Suppose we toss a fair die 1000 times. We note would expect to get about an equal number of 1's, 2's, etc. Let's note look at the distribution of 1000 tosses. This is illustrated in note Graph 1. note note Press Enter to proceed: yesno k1 copy .5 .5 1.5 1.5 1.5 2.5 2.5 2.5 3.5 3.5 3.5 4.5 4.5 4.5 5.5 5.5 5.5 6.5 6.5 c1 copy 0 178 178 0 166 166 0 156 156 0 175 175 0 175 175 0 150 150 0 c2 plot c2 * c1; symbol; type 0; lines c1 c2; title 'Distribution of 1000 Tosses of a Fair Die'; minimum 2 0; maximum 2 300; footnote 'Graph 1'; axis 2; label 'Occurrences'; axis 1; label 'Value of Die'. note note Press Enter to proceed: yesno k1 note note note note note Now suppose we were to toss the die two times and take the note average of the two tosses. We will repeat this experiment 1000 note times also. Let's see what the distribution of the averages note of two tosses looks like. This is illustrated in Graph 2. note note Press Enter to proceed: yesno k1 set c20 .75 .75 1.25 1.25 1.25 1.75 1.75 1.75 2.25 2.25 2.25 2.75 2.75 2.75 3.25 3.25 3.25 3.75 3.75 3.75 4.25 4.25 4.25 4.75 4.75 4.75 5.25 5.25 5.25 5.75 5.75 5.75 6.25 6.25 end set c6 0 39 39 0 46 46 0 90 90 0 91 91 0 142 142 0 150 150 0 139 139 0 133 133 0 86 86 0 56 56 0 28 28 0 end set c3 .5:6.5/.030150753 end pdf c3 c4; normal 3.5 1.20761. let c4 = 500*c4 plot c4*c3; symbol; type 0; title 'Distribution of 1000 Averages of'; title ' Two Tosses of a Fair Die '; minimum 2 0; maximum 2 300; footnote 'Graph 2'; lines c3 c4; type 1; color 4; lines c20 c6; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note Did you notice that with only two tosses the distribution of note the averages was already becoming mound-shaped? note note Suppose that we now toss the die three times and take the note average of the three tosses. Again, we will repeat this note experiment 1000 times. Let's see what happens to the distribution note of the averages. This is illustrated in Graph 3. note note Press Enter to proceed: yesno k1 set c7 .825 .825 1.175 1.175 1.175 1.525 1.525 1.525 1.875 1.875 1.875 2.225 2.225 2.225 2.575 2.575 2.575 2.925 2.925 2.925 3.275 3.275 3.275 3.625 3.625 3.625 3.975 3.975 3.975 4.325 4.325 4.325 4.675 4.675 4.675 5.025 5.025 5.025 5.375 5.375 5.375 5.725 5.725 5.725 6.075 6.075 end set c8 0 6 6 0 14 14 0 23 23 0 34 34 0 51 51 0 95 95 0 117 117 0 273 273 0 116 116 0 107 107 0 83 83 0 42 42 0 20 20 0 14 14 0 5 5 0 end pdf c3 c4; normal 3.5 .986013. let c4 = 350*c4 plot c4*c3; symbol; type 0; title 'Distribution of 1000 Averages of'; title ' Three Tosses of a Fair Die '; footnote 'Graph 3'; minimum 2 0; maximum 2 300; lines c3 c4; type 1; color 4; lines c7 c8; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note Again, the shape of the distribution is quite close to that of note a normal distribution. Did you notice anything else that was note happening to the distribution? note note note note Let's toss the die five times and take the average. Again, we note will repeat this experiment 1000 times. This is note illustrated in Graph 4. note note Press Enter to proceed: yesno k1 set c9 1 1 1.4 1.4 1.4 1.8 1.8 1.8 2.2 2.2 2.2 2.6 2.6 2.6 3 3 3 3.4 3.4 3.4 3.8 3.8 3.8 4.2 4.2 4.2 4.6 4.6 4.6 5 5 5 5.4 5.4 5.4 5.8 5.8 end set c10 0 1 1 0 5 5 0 22 22 0 73 73 0 130 130 0 176 176 0 214 214 0 178 178 0 105 105 0 62 62 0 27 27 0 7 7 0 end pdf c3 c4; normal 3.5 .763763. let c4 = 400*c4 plot c4*c3; symbol ; type 0; title 'Distribution of 1000 Averages of'; title ' Five Tosses of a Fair Die '; footnote 'Graph 4'; minimum 2 0; maximum 2 300; lines c3 c4; type 1; color 4; lines c9 c10; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note Have you begun to notice any patterns in what is happening yet? note note Let's continue to increase the number of tosses that we are note averaging. This time we will toss the die 10 times and take the note average of the 10 tosses. This is illustrated in Graph 5. note note Press Enter to proceed: yesno k1 set c11 1.65 1.65 1.95 1.95 1.95 2.25 2.25 2.25 2.55 2.55 2.55 2.85 2.85 2.85 3.15 3.15 3.15 3.45 3.45 3.45 3.75 3.75 3.75 4.05 4.05 4.05 4.35 4.35 4.35 4.65 4.65 4.65 4.95 4.95 4.95 5.25 5.25 end set c12 0 3 3 0 6 6 0 17 17 0 80 80 0 153 153 0 197 197 0 219 219 0 173 173 0 95 95 0 42 42 0 13 13 0 2 2 0 end pdf c3 c4; normal 3.5 .540062. let c4 = 300*c4 plot c4*c3; symbol ; type 0; title 'Distribution of 1000 Averages of'; title ' Ten Tosses of a Fair Die '; footnote 'Graph 5'; minimum 2 0; maximum 2 300; lines c3 c4; type 1; color 4; lines c11 c12; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note By now I think it is safe to say that we should be observing note two phenomena as we increase the number of tosses. note note First, we should be observing that the shape of the distribution note of averages is really beginning to take on the shape of a normal note distribution. note note Second, we should be observing that as the number of tosses note increases, the distribution becomes narrower and narrower. note note Let's continue increasing the number of tosses. This time we will note toss the die 20 times. This is illustrated in Graph 6. note note Press Enter to proceed: yesno k1 set c13 1.875 1.875 2.125 2.125 2.125 2.375 2.375 2.375 2.625 2.625 2.625 2.875 2.875 2.875 3.125 3.125 3.125 3.375 3.375 3.375 3.625 3.625 3.625 3.875 3.875 3.875 4.125 4.125 4.125 4.375 4.375 4.375 4.625 4.625 4.625 4.875 4.875 end set c14 0 1 1 0 1 1 0 11 11 0 41 41 0 114 114 0 185 185 0 262 262 0 219 219 0 108 108 0 44 44 0 12 12 0 2 2 0 end pdf c3 c4; normal 3.5 .38188. let c4 = 250*c4 plot c4*c3; symbol; type 0; title 'Distribution of 1000 Averages of'; title ' Twenty Tosses of a Fair Die '; footnote 'Graph 6'; minimum 2 0; maximum 2 300; lines c3 c4; type 5; color 4; lines c13 c14; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note We should all by now be fairly convinced of the effects that note increasing the sample size has on the distribution of sample note averages. We will increase the sample size one more time to note reinforce this thought. This time we will toss the die 30 times. note This is illustrated in Graph 7. note note Press Enter to proceed: yesno k1 set c15 2.5 2.5 2.7 2.7 2.7 2.9 2.9 2.9 3.1 3.1 3.1 3.3 3.3 3.3 3.5 3.5 3.5 3.7 3.7 3.7 3.9 3.9 3.9 4.1 4.1 4.1 4.3 4.3 4.3 4.5 4.5 end set c16 0 6 6 0 14 14 0 63 63 0 141 141 0 240 240 0 244 244 0 168 168 0 85 85 0 30 30 0 9 9 0 end pdf c3 c4; normal 3.5 .311805. let c4 = 200*c4 plot c4*c3; symbol ; type 0; title 'Distribution of 1000 Averages of'; title ' Thirty Tosses of a Fair Die '; footnote 'Graph 7'; minimum 2 0; maximum 2 300; lines c3 c4; type 5; color 4; lines c15 c16; type 1; color 2; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'. note note Press Enter to proceed: yesno k1 note note note note Let's review what we have seen. note note We will draw the histograms for samples of size 2, 5, 10, 20, note and 30 together in one plot to see the changes in the note distribution. note note note Press Enter to proceed: yesno k1 plot c4*c3; symbol; type 0; title 'Comparative Distributions of 1000 Averages'; title ' From the Die-Tossing Experiment '; lines c20 c6; type 1; color 2; lines c9 c10; type 1; color 4; lines c11 c12; type 1; color 5; lines c13 c14; type 1; color 3; lines c15 c16; type 1; color 7; axis 2; label 'Occurrences'; axis 1; label 'Value of Average'; footnote 'Red: n = 2 Blue: n = 5 Lt.Blue: n = 10'; footnote ' Green: n = 20 Yellow: n = 30 '. note note Press Enter to proceed: yesno k1 note note The Central Limit Theorem tells us what we SHOULD have observed, note theoretically. Lets' compare this to what we actually DID observe: note note Theoretical Results Observed Results note ------------------- ---------------- note note Sample Standard Standard note Size Mean Deviation Mean Deviation note ------ ---- --------- ----- --------- note 1 3.5 1.707825 3.453 1.7041 note 2 3.5 1.207615 3.527 1.2320 note 3 3.5 0.986013 3.546 0.9503 note 5 3.5 0.763763 3.481 0.7532 note 10 3.5 0.540062 3.506 0.5289 note 20 3.5 0.381879 3.510 0.3891 note 30 3.5 0.311805 3.507 0.3148 note endmacro