![]() |
TFQA: Tools for Quantitative Archaeology |
TFQA Home |
SAMPMEAN: Learn About SamplingThis simple program is included as a useful tool for teaching about sampling. It has two views. A histogram of the current random sample's values, and a histogram of the sample mean values for the samples thus far selected. When prompted, One toggles between the two views with a "T". The program computes a population mean and asks for a sample size and a number of trials. It then picks a random sample (with replacement) of the specified size from the population. It displays on a histogram the location of the population mean with > and with a s for the location of the current sample's mean. Each time "N" is pressed, another sample is selected and its sample mean value is included in the histogram of the sample means. If, at any time, "F" is pressed, the remainder of the trials samples are selected, one by one, and you see all the resulting sample means on the histogram us sample means. Throughout the program execution, running statistics of the samples are listed. SEQUENCE OF PROGRAM PROMPTS Name of File with Population Distribution {.TXT} ? File with list of integer values. Alternately, enter “CON” and type in any number of values followed by <Ctrl>Z. The population to be sampled is described in an ASCII text file. The program expects a list of integers separated by blanks, commas, or carriage returns (or one can answer CON to the request for the file name and type any number of numbers from the keyboard (including carriage returns) followed by a <Ctrl>Z). Either the file or the keyboard-entered list constitutes the (finite) population of integer values under consideration. A population can be generated by the ADFUTIL program. But the ADF file must be edited with a plain text editor (like notepad) to remove the header and number of rows and columns. Sample Size Size of the sample drawn with replacement from the population. Number of Trials ? Number of different random samples to be selected. Histogram Lower Limit {xxx.xx} ?Histogram Upper Limit {xxx.xx} ? Histogram Interval {xxx.xx} ? This gives the user some control over the histogram of sample values selected and the histogram of the sample means. The defaults should often work, but a neater histogram can be produced is you supply these values. Generally, pick a number for the interval width at least as large as the default value to keep the histogram fitting on the screen. [T]oggle Current View, [N]ext Sample, [F]ast ? T Hitting T toggles between the sample view and the cumulative view of the sample means. N goes to the next sample. Hitting F runs through the rest of the samples creating a histogram of the sample means. In the histograms the population mean is shown by a >, the current sample mean by a s, and the grand mean of the sample means as a S. SAMPLE RUN File with Any Number of Integer Population Values {.TXT} ? test
Population Values Read: 40
Population Mean: 147.3000
Sample Size ? 10
Number of Trials ? 100Test Data 6, 151, 217, 121, 13, 272, 68, 250, 193, 229, 16, 216, 83,
62, 241, 199, 201, 24, 120, 168, 127, 247, 54, 147, 222, 54, 33,
83, 105, 196, 226, 210, 237, 264, 243, 205, 167, 100, 113, 9
|
| Home | Top | Program Overview | Ordering | Documentation | Bibliography |
| Page Updated: 29 May 2026 |