Directions for Chi-Square for One and for Two Variables Datasets: One_way_chi_square.sav and Two_way_Chi_square.sav One-way Chi-square 1. Open the dataset containing the already grouped frequency of student blood type data. Notice the organization of the data: on each row is the possible blood type (string variable) followed by the count of students with that blood type, followed by a numeric code (nominal) for each blood type (1 = O, 2 = A, etc.). SPSS requires the number codes in order to conduct the one-way chisquare test. 2. Because the data are already summarized, you ll need to weight the data so that SPSS knows that each row represents more than one subject. Use Data / Weight cases and move the Count variable into the Weight cases by box. Press OK.
3. With your weighted data, select Analyze / Nonparametric tests / Chi-Square. 4. Use the Right-pointing arrow to move Blood_code into the Test Variable List. Notice the string variable, Blood_type, does not even appear in the list of possible variables. In the Expected Values panel, click on Values:. Enter the known population proportion for each blood type. Enter these in the order determined by the Blood_code variable. For example, Type O blood was coded as 1, so type its population proportion (.44) into the Values box, and then press Add. The value will appear in the list box. Next, enter the population proportion for Type A blood type (.41) because this blood type has a code of 2. Keep going until all values are entered and appear in the list box. Finally, press OK.
5. Your results appear in the Output window. Value of chi-square and p-value. Observed, and expected counts. The larger the Residual, the more that cell is contributing to the size of the Chi-square. Two-way Chi-square 1. Open the dataset containing the lost letter data. Notice how the data are organized. Each row contains a string variable code for the neighborhood (downtown, suburbia, or campus), a string variable code for whether the letter was returned (yes or no), and the count of how many letters fell into this (combined) category. In contrast to one-way chisquares, when you have a two-way design, SPSS can handle string variables for the categorical variables. SPSS can also handle numeric codes for these variables, so it is up to you.
2. Because the data are already summarized, you need to tell SPSS to weight the data so that each row is treated as more than one letter. Use Data / Weight cases to do this. Choose Weight cases by and bring the Count variable into the Frequency variable box. Click the OK button. 3. Choose Analyze / Descriptives / Crosstabs. 4. Move the variable you want to form the rows of your table into the Row(s) box and move the variable you want to form the Columns into its box. If you want SPSS to generate a clustered barchart, click the box to ask for the display.
5. Click the Statistics button, and check the boxes for the Chi-square and for Phi (the effect size measure). Click Continue. 6. Click the Cells button. In the Counts panel, check the boxes to see both the Observed and the Expected values for each cell. In the Percentages panel, check EITHER the Row or the Column boxes depending on how you set up your table in Step 4 and on which variable you want the results percentaged. In this example, type of Neighborhood was chosen to form the columns of the table and type of return was chosen to be the rows. If you want to see the percentage of returned and not returned letters within each neighborhood, then you want to percentage on the columns. If you want to know the percent of returned letters that came from each neighborhood, you would percentage on rows. If you want to see both row and column percentages and won t get confused by the more complicated output, you can check both boxes.
7. Press Continue and then OK. The results appear in the Output window. Percent within a Neighborhood (column) Value of Chi-square and p-value Effect size measure. Take value of Phi and square it: 2 =.05. 5% of the variability in whether a letter is or is not returned is related to the neighborhood in which it was lost. This is a small effect.
8. If you requested a clustered Bar Chart, it appears at the bottom of your results. Often the bar charts requested in this way do not look as desired. In this case, you can use the Chart Editor to make changes or you can create an entirely new clustered Bar Chart by using the Graphs / Legacy Dialogs /Bar command. Here is an example of a clustered bar chart created from scratch.