Set Parameters for Looking at Sample Contingency Tables

Return to Topics page

This is the start of a trio of pages that demonstrate taking samples from a population that has two independent values, each with discrete multiple characteristics. The purpose of taking such samples is to demonstrate the computation of the χ² values from the contingency table of the sample and to look at the probability estimate for those values.

We start by specifying the row and column characteristics in the underlying population. [The input form for doing this is given at the bottom of this page, below the horizontal line.] We are limited in this to using a single digit, in the range of 2 to 9, for the proportion of the various characteristic values. Thus, if the row variable has 4 characteristics, red, green, blue, and yellow, with the relative proportions of 3, 5,2, and 7, then we could specify that situation by using the value 7253. [In this example we really are not concerned about the colors so we could have specified the distribution as 3527 or 2357 or 3571 and so on.] If there are 5 characteristics to the column variable, square, triangle, circle, star, and hexagon, and they are in the proportion 9:2:4:4:7, then we could specify that as 92447 or as any other arrangement of those digits.

Once we move to the next page a population will be generated and displayed that has the specified proportions of the two variables and those variables will be perfectly independent in that population. The page will display the representative contingency table for the population and it will give a detail listing of the population. [Note that the population will seem small but we could reproduce the list of values any number of times to get as large a population that as large as we want.]

After that, the next page will take 1000 samples from the population. Rather than specify the sample size, on this page we specify the minimum required value in each of the cells of the resulting sample contingeny table. That is, the next page will not stop taking a sample until each cell in the sample contingency table has reached or exceeded that minimum value. The next page also computes and displays the χ² value for each of the 1000 samples, as well as comparing that value to the tabular χ² value for the appropriate degrees of freedom for 10%, 5%, 2%, and 1% right-tail probability.

We access the third page of this trio by clicking on the "sample number" in the table of samples. First, that third page will display the sample contingency table. Then the page displays an augmented contingency table giving the row, column, and grand totals along with the row, column, and total percent for each cell in the original table. Finally the page displays another augmented table this time giving the observed value, the expected value, the (observed-expected) value, the (observed-expected)² value, and the (observed-expected)²/expected value. That contingency table is then follwed by the sum of all the (observed-expected)²/expected values.


Enter the desired row distribution:
(e.g., 492 would be 3 rows with distribution proportions
5/15, 9/15, and 2/15)
Enter the desired column distribution:
(e.g., 5286 would be 4 columns with distribution proportions
5/21, 2/21, 8/21, and 6/21)
Enter the desired minimum cell size for each sample:

Return to Topics page

©Roger M. Palay
Saline, MI 48176
August, 2017