smpl is a program that allows you to create a sample mean, based on a random variable of from 2 to 30 values. Each sample mean is the average of two trials. It is used in the datagen package to illustrate the chi-square test.
The random variable is belongs to the set of even numbers, {2,4,6,...}. This makes it easier to address an array of observations, because the average of two trials is always a whole number.
smpl has two parameters:
Example of how to run the program.
smpl 100000 12
In this example, the program makes 2 trials for success on the random variable, 100 thousand times. The random variable is {2,4,6,...,24}. The program prints the probability distribution, the standard deviation, and the chi-square test.
The Chi-square number should fit within the Range 95 percent of the time.
The calculation of probabilities for the sample mean distribution is based on the following book:
Lincoln L. Chao
Statistics for Management
2nd Edition
Palo Alto: The Scientific Press, 1984
Chapter 8, The Normal Probability Distribution
Section 4, Sampling Distribution of the Mean
Lincoln L. Chao published his book while at California State University, Long Beach.
The chi-square test is similar to:
Chapter 12, Chi-square Tests
Section 3, Testing for Goodness of Fit
Formula 12-3
Example 12-4
In Table 12-3, each category in the chi-square test has a different expected frequency. This corresponds to the different expected frequencies for the number of successes.