Statistics 110E -- Statistical and Data Analysis-Psychology/Biological Sciences

Statistic 110 Lab 6

JMP IN Topics

  1. 2 x 2 Contingency Tables
To illustrate the commands for analyzing a contingency table, we will use the data from HW problem 17, Chapter 12.

Preliminaries for Exercise 12:17

  1. Start up JMP IN
  2. Double-Click on "0 Rows" in the upper left corner of the spreadsheet. In the Pop-Up window, specify the number of rows to add, 4, corresponding to the 4 cells in the table. Click on Add or simply hit Enter.
  3. Add columns for the two categorical variables: "Helped" with possible values "Yes" or "No" and "Observer" with possible values "Male" or "Female". To convert a column to a categorical variable, select the column, and then under the Cols menu, select Column Info. In the pop-up window, change the data type to Character. The left box at the top of the column should have a "N" for Nominal data. The four rows should correspond to all possible combinations of the two variables making up the 4 cells in the table.
  4. Add a numerical column for the cell counts, "Counts". Enter the corresponding counts for each row. Click on the right-hand box at the top of the column, and select "F" for Freq or frequency.

This form of data entry assumes that the data have already been summarized into a 2 x 2 table. If you have raw data, i.e. the categories for each individual observation, you would have n rows with just the 2 columns for the categories, and no "Count" variable (i.e. counts would all be one).

Analyses

  1. Go to the Analyze menu and select "Fit Y by X"

  2. Select "Helped" as the "Y" and select "Observer" as the "X". "Counts" should appear in the Freq field.

  3. The Analysis type should be "Contingency Table, Crosstab"

  4. Click on OK.

Output

  1. The plot at the top is a Mosaic plot. It shows the proportions that helped picked up/did not help pick up pencils for Males and Females. (basically a stacked Bar-graph). This provides a very nice visual impression of the differences between the two groups.

  2. The second box contains the Cross-tabulated table. Verify that the numbers are correctly entered! To get the Expected Counts and Chi-Square values for each cell and percentages, click on the right arrow next to "Crosstabs" and select the corresponding items to toggle them on (there should be a check next to them).

  3. The last box has the output for testing if there is a statistical relationship. The only row that we need for now is the row corresponding to "Pearson". The column labeled "ChiSquare" has the chi-squared summary measure. Verify that it is the sum of the Chi^2 values given in 2 or what you get by hand. The Prob>ChiSq column has the corresponding p-value, which is the proportion of other samples that would have a ChiSquare summary statistic as large or larger than what we observed based on chance alone (i.e. when there really is no relationship between gender and helping).

  4. To test if the relationship is statistically significant, compare the ChiSquare value to 3.84. If the ChiSquare summary statistic is greater than 3.84, then there is a statistically significant association between the gender of the observer and whether they would help pick up the pencils. You can also use the p-value, so if the p-value is less than 0.05, then there is a statistically significant association.

  5. Save your output to a journal file and clean up any extraneous information (i.e. delete output that we have not discussed such as Fisher's exact test).